org.jmol.viewer
Class MouseManager

java.lang.Object
  extended by org.jmol.viewer.MouseManager
All Implemented Interfaces:
java.awt.event.KeyListener, java.util.EventListener
Direct Known Subclasses:
MouseManager10, MouseManager11

public abstract class MouseManager
extends java.lang.Object
implements java.awt.event.KeyListener


Nested Class Summary
(package private)  class MouseManager.HoverWatcher
           
 
Field Summary
(package private) static int ALT
           
static int ALT_LEFT
           
static int ALT_SHIFT_LEFT
           
private static int BUTTON_MODIFIER_MASK
           
(package private) static int CTRL
           
(package private) static int CTRL_ALT
           
(package private) static int CTRL_ALT_LEFT
           
(package private) static int CTRL_ALT_RIGHT
           
(package private) static int CTRL_ALT_SHIFT_LEFT
           
(package private) static int CTRL_ALT_SHIFT_RIGHT
           
(package private) static int CTRL_LEFT
           
(package private) static int CTRL_MIDDLE
           
(package private) static int CTRL_RIGHT
           
(package private) static int CTRL_SHIFT
           
(package private) static int CTRL_SHIFT_LEFT
           
(package private) static int CTRL_SHIFT_MIDDLE
           
(package private) static int CTRL_SHIFT_RIGHT
           
private  boolean dragSelectedMode
           
private  boolean drawMode
           
private  boolean hoverActive
           
protected  java.lang.Thread hoverWatcherThread
           
(package private)  boolean isAltKeyReleased
           
private  java.lang.String keyBuffer
           
private  boolean keyProcessing
           
private  boolean labelMode
           
(package private) static int LEFT
           
(package private) static int LEFT_MIDDLE_RIGHT
           
(package private) static long MAX_DOUBLE_CLICK_MILLIS
           
private  MeasurementPending measurementPending
           
private  boolean measuresEnabled
           
(package private) static int MIDDLE
           
(package private) static int MIDDLE_RIGHT
           
(package private)  int mouseMovedModifiers
           
protected  long mouseMovedTime
           
protected  int mouseMovedX
           
protected  int mouseMovedY
           
private  int pressedCount
           
private  int previousClickCount
           
private  int previousClickModifiers
           
private  long previousClickTime
           
private  int previousClickX
           
private  int previousClickY
           
private  int previousDragX
           
private  int previousDragY
           
private  int previousPressedModifiers
           
private  long previousPressedTime
           
private  int previousPressedX
           
private  int previousPressedY
           
private  java.awt.Rectangle rectRubber
           
(package private) static int RIGHT
           
private  boolean rubberbandSelectionMode
           
static int SHIFT
           
static int SHIFT_LEFT
           
(package private) static int SHIFT_MIDDLE
           
(package private) static int SHIFT_RIGHT
           
protected  long timeCurrent
           
protected  Viewer viewer
           
(package private) static float wheelClickFractionDown
           
(package private) static float wheelClickFractionUp
           
private  int xAnchor
           
protected  int xCurrent
           
private  int yAnchor
           
protected  int yCurrent
           
 
Constructor Summary
MouseManager(java.awt.Component display, Viewer viewer)
           
 
Method Summary
private  void addKeyBuffer(char ch)
           
private  int addToMeasurement(int atomIndex, Point3fi nearestPoint, boolean dblClick)
           
private  void calcRectRubberBand()
           
(package private)  void checkMotion()
           
private  void checkPointOrAtomClicked(int x, int y, int modifiers, int clickCount)
           
(package private)  void clear()
           
(package private)  void clearClickCount()
           
private  void clearKeyBuffer()
           
private  void enterMeasurementMode()
           
private  void exitMeasurementMode()
           
(package private)  java.awt.Rectangle getRubberBand()
           
(package private) abstract  boolean handleOldJvm10Event(java.awt.Event e)
           
(package private)  void hoverOff()
           
(package private)  void hoverOn(int atomIndex)
           
 void keyPressed(java.awt.event.KeyEvent ke)
           
 void keyReleased(java.awt.event.KeyEvent ke)
           
 void keyTyped(java.awt.event.KeyEvent ke)
           
(package private)  void mouseClicked(long time, int x, int y, int modifiers, int clickCount)
           
(package private)  void mouseDragged(long time, int x, int y, int modifiers)
           
(package private)  void mouseEntered(long time, int x, int y)
           
(package private)  void mouseExited(long time, int x, int y)
           
(package private)  void mouseMoved(long time, int x, int y, int modifiers)
           
(package private)  void mousePressed(long time, int x, int y, int modifiers, boolean isPopupTrigger)
           
(package private)  void mouseReleased(long time, int x, int y, int modifiers)
           
(package private)  void mouseWheel(long time, int rotation, int modifiers)
           
protected  void processKeyEvent(java.awt.event.KeyEvent ke)
           
(package private)  void removeMouseListeners11()
           
(package private)  void removeMouseListeners14()
           
private  void sendKeyBuffer()
           
(package private)  void setModeMouse(int modeMouse)
           
(package private)  void setMouseMode()
           
(package private)  void startHoverWatcher(boolean isStart)
           
private  void toggleMeasurement()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

viewer

protected Viewer viewer

hoverWatcherThread

protected java.lang.Thread hoverWatcherThread

previousDragX

private int previousDragX

previousDragY

private int previousDragY

xCurrent

protected int xCurrent

yCurrent

protected int yCurrent

timeCurrent

protected long timeCurrent

drawMode

private boolean drawMode

labelMode

private boolean labelMode

dragSelectedMode

private boolean dragSelectedMode

measuresEnabled

private boolean measuresEnabled

measurementPending

private MeasurementPending measurementPending

hoverActive

private boolean hoverActive

rubberbandSelectionMode

private boolean rubberbandSelectionMode

xAnchor

private int xAnchor

yAnchor

private int yAnchor

rectRubber

private final java.awt.Rectangle rectRubber

previousClickX

private int previousClickX

previousClickY

private int previousClickY

previousClickModifiers

private int previousClickModifiers

previousClickCount

private int previousClickCount

previousClickTime

private long previousClickTime

previousPressedX

private int previousPressedX

previousPressedY

private int previousPressedY

previousPressedModifiers

private int previousPressedModifiers

previousPressedTime

private long previousPressedTime

pressedCount

private int pressedCount

mouseMovedX

protected int mouseMovedX

mouseMovedY

protected int mouseMovedY

mouseMovedTime

protected long mouseMovedTime

keyBuffer

private java.lang.String keyBuffer

isAltKeyReleased

boolean isAltKeyReleased

keyProcessing

private boolean keyProcessing

MAX_DOUBLE_CLICK_MILLIS

static final long MAX_DOUBLE_CLICK_MILLIS
See Also:
Constant Field Values

LEFT

static final int LEFT
See Also:
Constant Field Values

MIDDLE

static final int MIDDLE
See Also:
Constant Field Values

ALT

static final int ALT
See Also:
Constant Field Values

RIGHT

static final int RIGHT
See Also:
Constant Field Values

CTRL

static final int CTRL
See Also:
Constant Field Values

SHIFT

public static final int SHIFT
See Also:
Constant Field Values

MIDDLE_RIGHT

static final int MIDDLE_RIGHT
See Also:
Constant Field Values

LEFT_MIDDLE_RIGHT

static final int LEFT_MIDDLE_RIGHT
See Also:
Constant Field Values

CTRL_SHIFT

static final int CTRL_SHIFT
See Also:
Constant Field Values

CTRL_ALT

static final int CTRL_ALT
See Also:
Constant Field Values

CTRL_LEFT

static final int CTRL_LEFT
See Also:
Constant Field Values

CTRL_RIGHT

static final int CTRL_RIGHT
See Also:
Constant Field Values

CTRL_MIDDLE

static final int CTRL_MIDDLE
See Also:
Constant Field Values

CTRL_ALT_LEFT

static final int CTRL_ALT_LEFT
See Also:
Constant Field Values

CTRL_ALT_RIGHT

static final int CTRL_ALT_RIGHT
See Also:
Constant Field Values

ALT_LEFT

public static final int ALT_LEFT
See Also:
Constant Field Values

ALT_SHIFT_LEFT

public static final int ALT_SHIFT_LEFT
See Also:
Constant Field Values

SHIFT_LEFT

public static final int SHIFT_LEFT
See Also:
Constant Field Values

CTRL_SHIFT_LEFT

static final int CTRL_SHIFT_LEFT
See Also:
Constant Field Values

CTRL_ALT_SHIFT_LEFT

static final int CTRL_ALT_SHIFT_LEFT
See Also:
Constant Field Values

SHIFT_MIDDLE

static final int SHIFT_MIDDLE
See Also:
Constant Field Values

CTRL_SHIFT_MIDDLE

static final int CTRL_SHIFT_MIDDLE
See Also:
Constant Field Values

SHIFT_RIGHT

static final int SHIFT_RIGHT
See Also:
Constant Field Values

CTRL_SHIFT_RIGHT

static final int CTRL_SHIFT_RIGHT
See Also:
Constant Field Values

CTRL_ALT_SHIFT_RIGHT

static final int CTRL_ALT_SHIFT_RIGHT
See Also:
Constant Field Values

BUTTON_MODIFIER_MASK

private static final int BUTTON_MODIFIER_MASK
See Also:
Constant Field Values

wheelClickFractionUp

static final float wheelClickFractionUp
See Also:
Constant Field Values

wheelClickFractionDown

static final float wheelClickFractionDown
See Also:
Constant Field Values

mouseMovedModifiers

int mouseMovedModifiers
Constructor Detail

MouseManager

MouseManager(java.awt.Component display,
             Viewer viewer)
Method Detail

handleOldJvm10Event

abstract boolean handleOldJvm10Event(java.awt.Event e)

clear

void clear()

startHoverWatcher

void startHoverWatcher(boolean isStart)

removeMouseListeners11

void removeMouseListeners11()

removeMouseListeners14

void removeMouseListeners14()

setModeMouse

void setModeMouse(int modeMouse)

clearKeyBuffer

private void clearKeyBuffer()

addKeyBuffer

private void addKeyBuffer(char ch)

sendKeyBuffer

private void sendKeyBuffer()

keyTyped

public void keyTyped(java.awt.event.KeyEvent ke)
Specified by:
keyTyped in interface java.awt.event.KeyListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent ke)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent ke)
Specified by:
keyReleased in interface java.awt.event.KeyListener

processKeyEvent

protected void processKeyEvent(java.awt.event.KeyEvent ke)

getRubberBand

java.awt.Rectangle getRubberBand()

calcRectRubberBand

private void calcRectRubberBand()

mouseMoved

void mouseMoved(long time,
                int x,
                int y,
                int modifiers)

mouseWheel

void mouseWheel(long time,
                int rotation,
                int modifiers)

mousePressed

void mousePressed(long time,
                  int x,
                  int y,
                  int modifiers,
                  boolean isPopupTrigger)

mouseEntered

void mouseEntered(long time,
                  int x,
                  int y)

mouseExited

void mouseExited(long time,
                 int x,
                 int y)

mouseReleased

void mouseReleased(long time,
                   int x,
                   int y,
                   int modifiers)

clearClickCount

void clearClickCount()

mouseClicked

void mouseClicked(long time,
                  int x,
                  int y,
                  int modifiers,
                  int clickCount)

setMouseMode

void setMouseMode()

checkPointOrAtomClicked

private void checkPointOrAtomClicked(int x,
                                     int y,
                                     int modifiers,
                                     int clickCount)

mouseDragged

void mouseDragged(long time,
                  int x,
                  int y,
                  int modifiers)

checkMotion

void checkMotion()

addToMeasurement

private int addToMeasurement(int atomIndex,
                             Point3fi nearestPoint,
                             boolean dblClick)

enterMeasurementMode

private void enterMeasurementMode()

exitMeasurementMode

private void exitMeasurementMode()

toggleMeasurement

private void toggleMeasurement()

hoverOn

void hoverOn(int atomIndex)

hoverOff

void hoverOff()