Example usage for java.awt.event InputEvent isShiftDown

List of usage examples for java.awt.event InputEvent isShiftDown

Introduction

In this page you can find the example usage for java.awt.event InputEvent isShiftDown.

Prototype

public boolean isShiftDown() 

Source Link

Document

Returns whether or not the Shift modifier is down on this event.

Usage

From source file:ucar.unidata.idv.flythrough.Flythrough.java

/**
 * _more_/*from   ww  w  . j ava  2  s.  c  o  m*/
 *
 * @param event _more_
 *
 * @throws RemoteException _more_
 * @throws VisADException _more_
 */
public void displayChanged(DisplayEvent event) throws VisADException, RemoteException {
    if (!isActive()) {
        return;
    }

    double[] viewpoint = viewManager.getDisplayMatrix();
    if (!Misc.arraysEquals(viewpoint, lastViewpoint)) {
        lastViewpoint = viewpoint;
        updateDashboard();
    }

    if (goToClick && (event.getId() == DisplayEvent.MOUSE_PRESSED)) {
        InputEvent inputEvent = event.getInputEvent();
        int mods = inputEvent.getModifiers();
        if ((mods & InputEvent.BUTTON1_MASK) != 0 && !inputEvent.isShiftDown() && !inputEvent.isControlDown()) {
            NavigatedDisplay navDisplay = viewManager.getNavigatedDisplay();
            location = navDisplay.screenToEarthLocation(event.getX(), event.getY());
            doDrive(false, heading);
        }
    }
}