Package org.jmol.viewer
Class ActionManager
- java.lang.Object
-
- org.jmol.viewer.ActionManager
-
- All Implemented Interfaces:
EventManager
- Direct Known Subclasses:
ActionManagerMT
public class ActionManager extends java.lang.Object implements EventManager
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ActionManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private int
addToMeasurement(int atomIndex, Point3fi nearestPoint, boolean dblClick)
private void
assignNew()
private void
atomOrPointPicked(int atomIndex, Point3fi ptClicked)
(package private) void
bind(java.lang.String desc, java.lang.String name)
(package private) boolean
bnd(int mouseAction, int... jmolActions)
private void
bondPicked(int index)
private void
calcRectRubberBand()
private void
checkClickAction(int x, int y, long time, int clickedCount)
private void
checkDragWheelAction(int dragWheelAction, int x, int y, int deltaX, int deltaY, long time, int mode)
void
checkHover()
private boolean
checkMotionRotateZoom(int mouseAction, int x, int deltaX, int deltaY, boolean isDrag)
private void
checkPressedAction(int x, int y, long time)
private void
checkReleaseAction(int x, int y, long time, boolean dragRelease)
private void
checkTwoAtomAction(Point3fi ptClicked, int atomIndex)
private boolean
checkUserAction(int mouseAction, int x, int y, int deltaX, int deltaY, long time, int mode)
void
clear()
protected void
clearBindings()
protected void
clearMouseInfo()
(package private) void
createActions()
void
dispose()
private void
doPopup(int x, int y)
private void
dragSelected(int a, int deltaX, int deltaY, boolean isPickingDrag)
change actual coordinates of selected atoms from set dragSeleted TRUE or set PICKING DRAGSELECTED Basically, set dragSelected adds new functionality to Jmol with alt-drag and alt-shift drag, and set picking dragSelected replaces the standard mouse drag with a move action and also adds rotate and z-shift options.private void
enterMeasurementMode(int iAtom)
(package private) void
exitMeasurementMode(java.lang.String refreshWhy)
private int
findNearestAtom(int x, int y, Point3fi nearestPoint, boolean isClicked)
static int
getActionFromName(java.lang.String name)
static java.lang.String
getActionName(int i)
int
getAtomPickingMode()
java.lang.String
getBindingInfo(java.lang.String qualifiers)
int
getBondPickingMode()
(package private) int
getCurrentX()
(package private) int
getCurrentY()
protected float
getDegrees(float delta, boolean isX)
Transform a screen pixel change to an angular change such that a full sweep of the dimension (up to 500 pixels) corresponds to 180 degrees of rotation.private float
getExitRate()
private MeasurementPending
getMP()
static int
getPickingMode(java.lang.String str)
static java.lang.String
getPickingModeName(int pickingMode)
java.lang.String
getPickingState()
(package private) int
getPickingStyle()
static int
getPickingStyleIndex(java.lang.String str)
static java.lang.String
getPickingStyleName(int pickingStyle)
private Point3fi
getPoint(java.util.Map<java.lang.String,java.lang.Object> t)
(package private) Rectangle
getRubberBand()
private void
getSequence()
(package private) boolean
isDraggedIsShiftDown()
private boolean
isDrawOrLabelAction(int a)
boolean
isMTClient()
boolean
isMTServer()
private boolean
isRubberBandSelect(int action)
private boolean
isSelectAction(int action)
private boolean
isZoomArea(int x)
boolean
keyPressed(int key, int modifiers)
called by MouseManager.keyPressedvoid
keyReleased(int key)
boolean
keyTyped(int keyChar, int modifiers)
private void
minimize(boolean dragDone)
void
mouseAction(int mode, long time, int x, int y, int count, int buttonMods)
void
mouseEnterExit(long time, int x, int y, boolean isExit)
(package private) static void
newAction(int i, java.lang.String name, java.lang.String info)
private void
pickLabel(int iatom)
void
processMultitouchEvent(int groupID, int eventType, int touchID, int iData, javajs.util.P3 pt, long time)
Specific to ActionManagerMT -- for processing SparshUI gesturesprivate int
queueAtom(int atomIndex, Point3fi ptClicked)
private void
reset()
private void
resetMeasurement()
private void
runScript(java.lang.String script)
private void
selectAtoms(java.lang.String item)
private void
selectRb(int action)
private void
setAtomsPicked(javajs.util.BS bs, java.lang.String msg)
protected void
setBinding(Binding newBinding)
protected void
setCurrent(long time, int x, int y, int mods)
void
setDragAtomIndex(int iatom)
(package private) void
setGestureSwipeFactor(float factor)
void
setModeMouse(int modeMouse)
only NONE (-1) is implemented; it just stops the hoverWatcher thread so that the vwr references are all removedprotected void
setMotion(int cursor, boolean inMotion)
private void
setMouseActions(int count, int buttonMods, boolean isRelease)
(package private) void
setMouseDragFactor(float factor)
void
setMouseMode()
(package private) void
setMouseWheelFactor(float factor)
void
setPickingMode(int pickingMode)
(package private) void
setPickingStyle(int pickingStyle)
void
setViewer(Viewer vwr, java.lang.String commandOptions)
void
startHoverWatcher(boolean isStart)
private void
toggleMeasurement()
(package private) void
unbindAction(java.lang.String desc, java.lang.String name)
boolean
userAction(int action, java.lang.Object[] params)
If the user has created a function to handle this action, run it and cancel action processing if that function returns an explicit FALSE;boolean
userActionEnabled(int action)
protected void
zoomByFactor(int dz, int x, int y)
private void
zoomTo(int atomIndex)
-
-
-
Field Detail
-
vwr
protected Viewer vwr
-
haveMultiTouchInput
protected boolean haveMultiTouchInput
-
isMultiTouch
protected boolean isMultiTouch
-
b
public Binding b
-
jmolBinding
private Binding jmolBinding
-
pfaatBinding
private Binding pfaatBinding
-
dragBinding
private Binding dragBinding
-
rasmolBinding
private Binding rasmolBinding
-
predragBinding
private Binding predragBinding
-
LEFT_DRAGGED
private int LEFT_DRAGGED
-
hoverWatcherThread
protected java.lang.Thread hoverWatcherThread
-
dragGesture
private Gesture dragGesture
-
ACTION_assignNew
public static final int ACTION_assignNew
- See Also:
- Constant Field Values
-
ACTION_center
public static final int ACTION_center
- See Also:
- Constant Field Values
-
ACTION_clickFrank
public static final int ACTION_clickFrank
- See Also:
- Constant Field Values
-
ACTION_connectAtoms
public static final int ACTION_connectAtoms
- See Also:
- Constant Field Values
-
ACTION_deleteAtom
public static final int ACTION_deleteAtom
- See Also:
- Constant Field Values
-
ACTION_deleteBond
public static final int ACTION_deleteBond
- See Also:
- Constant Field Values
-
ACTION_depth
public static final int ACTION_depth
- See Also:
- Constant Field Values
-
ACTION_dragAtom
public static final int ACTION_dragAtom
- See Also:
- Constant Field Values
-
ACTION_dragDrawObject
public static final int ACTION_dragDrawObject
- See Also:
- Constant Field Values
-
ACTION_dragDrawPoint
public static final int ACTION_dragDrawPoint
- See Also:
- Constant Field Values
-
ACTION_dragLabel
public static final int ACTION_dragLabel
- See Also:
- Constant Field Values
-
ACTION_dragMinimize
public static final int ACTION_dragMinimize
- See Also:
- Constant Field Values
-
ACTION_dragMinimizeMolecule
public static final int ACTION_dragMinimizeMolecule
- See Also:
- Constant Field Values
-
ACTION_dragSelected
public static final int ACTION_dragSelected
- See Also:
- Constant Field Values
-
ACTION_dragZ
public static final int ACTION_dragZ
- See Also:
- Constant Field Values
-
ACTION_multiTouchSimulation
public static final int ACTION_multiTouchSimulation
- See Also:
- Constant Field Values
-
ACTION_navTranslate
public static final int ACTION_navTranslate
- See Also:
- Constant Field Values
-
ACTION_pickAtom
public static final int ACTION_pickAtom
- See Also:
- Constant Field Values
-
ACTION_pickIsosurface
public static final int ACTION_pickIsosurface
- See Also:
- Constant Field Values
-
ACTION_pickLabel
public static final int ACTION_pickLabel
- See Also:
- Constant Field Values
-
ACTION_pickMeasure
public static final int ACTION_pickMeasure
- See Also:
- Constant Field Values
-
ACTION_pickNavigate
public static final int ACTION_pickNavigate
- See Also:
- Constant Field Values
-
ACTION_pickPoint
public static final int ACTION_pickPoint
- See Also:
- Constant Field Values
-
ACTION_popupMenu
public static final int ACTION_popupMenu
- See Also:
- Constant Field Values
-
ACTION_reset
public static final int ACTION_reset
- See Also:
- Constant Field Values
-
ACTION_rotate
public static final int ACTION_rotate
- See Also:
- Constant Field Values
-
ACTION_rotateBranch
public static final int ACTION_rotateBranch
- See Also:
- Constant Field Values
-
ACTION_rotateSelected
public static final int ACTION_rotateSelected
- See Also:
- Constant Field Values
-
ACTION_rotateZ
public static final int ACTION_rotateZ
- See Also:
- Constant Field Values
-
ACTION_rotateZorZoom
public static final int ACTION_rotateZorZoom
- See Also:
- Constant Field Values
-
ACTION_select
public static final int ACTION_select
- See Also:
- Constant Field Values
-
ACTION_selectAndDrag
public static final int ACTION_selectAndDrag
- See Also:
- Constant Field Values
-
ACTION_selectAndNot
public static final int ACTION_selectAndNot
- See Also:
- Constant Field Values
-
ACTION_selectNone
public static final int ACTION_selectNone
- See Also:
- Constant Field Values
-
ACTION_selectOr
public static final int ACTION_selectOr
- See Also:
- Constant Field Values
-
ACTION_selectToggle
public static final int ACTION_selectToggle
- See Also:
- Constant Field Values
-
ACTION_selectToggleExtended
public static final int ACTION_selectToggleExtended
- See Also:
- Constant Field Values
-
ACTION_setMeasure
public static final int ACTION_setMeasure
- See Also:
- Constant Field Values
-
ACTION_slab
public static final int ACTION_slab
- See Also:
- Constant Field Values
-
ACTION_slabAndDepth
public static final int ACTION_slabAndDepth
- See Also:
- Constant Field Values
-
ACTION_slideZoom
public static final int ACTION_slideZoom
- See Also:
- Constant Field Values
-
ACTION_spinDrawObjectCCW
public static final int ACTION_spinDrawObjectCCW
- See Also:
- Constant Field Values
-
ACTION_spinDrawObjectCW
public static final int ACTION_spinDrawObjectCW
- See Also:
- Constant Field Values
-
ACTION_stopMotion
public static final int ACTION_stopMotion
- See Also:
- Constant Field Values
-
ACTION_swipe
public static final int ACTION_swipe
- See Also:
- Constant Field Values
-
ACTION_translate
public static final int ACTION_translate
- See Also:
- Constant Field Values
-
ACTION_wheelZoom
public static final int ACTION_wheelZoom
- See Also:
- Constant Field Values
-
ACTION_count
public static final int ACTION_count
- See Also:
- Constant Field Values
-
actionInfo
static final java.lang.String[] actionInfo
-
actionNames
static final java.lang.String[] actionNames
-
apm
private int apm
picking modes set picking....
-
bondPickingMode
private int bondPickingMode
-
PICKING_MK_RESET
public static final int PICKING_MK_RESET
- See Also:
- Constant Field Values
-
PICKING_OFF
public static final int PICKING_OFF
- See Also:
- Constant Field Values
-
PICKING_IDENTIFY
public static final int PICKING_IDENTIFY
- See Also:
- Constant Field Values
-
PICKING_LABEL
public static final int PICKING_LABEL
- See Also:
- Constant Field Values
-
PICKING_CENTER
public static final int PICKING_CENTER
- See Also:
- Constant Field Values
-
PICKING_DRAW
public static final int PICKING_DRAW
- See Also:
- Constant Field Values
-
PICKING_SPIN
public static final int PICKING_SPIN
- See Also:
- Constant Field Values
-
PICKING_SYMMETRY
public static final int PICKING_SYMMETRY
- See Also:
- Constant Field Values
-
PICKING_DELETE_ATOM
public static final int PICKING_DELETE_ATOM
- See Also:
- Constant Field Values
-
PICKING_DELETE_BOND
public static final int PICKING_DELETE_BOND
- See Also:
- Constant Field Values
-
PICKING_SELECT_ATOM
public static final int PICKING_SELECT_ATOM
- See Also:
- Constant Field Values
-
PICKING_SELECT_GROUP
public static final int PICKING_SELECT_GROUP
- See Also:
- Constant Field Values
-
PICKING_SELECT_CHAIN
public static final int PICKING_SELECT_CHAIN
- See Also:
- Constant Field Values
-
PICKING_SELECT_MOLECULE
public static final int PICKING_SELECT_MOLECULE
- See Also:
- Constant Field Values
-
PICKING_SELECT_POLYMER
public static final int PICKING_SELECT_POLYMER
- See Also:
- Constant Field Values
-
PICKING_SELECT_STRUCTURE
public static final int PICKING_SELECT_STRUCTURE
- See Also:
- Constant Field Values
-
PICKING_SELECT_SITE
public static final int PICKING_SELECT_SITE
- See Also:
- Constant Field Values
-
PICKING_SELECT_MODEL
public static final int PICKING_SELECT_MODEL
- See Also:
- Constant Field Values
-
PICKING_SELECT_ELEMENT
public static final int PICKING_SELECT_ELEMENT
- See Also:
- Constant Field Values
-
PICKING_MEASURE
public static final int PICKING_MEASURE
- See Also:
- Constant Field Values
-
PICKING_MEASURE_DISTANCE
public static final int PICKING_MEASURE_DISTANCE
- See Also:
- Constant Field Values
-
PICKING_MEASURE_ANGLE
public static final int PICKING_MEASURE_ANGLE
- See Also:
- Constant Field Values
-
PICKING_MEASURE_TORSION
public static final int PICKING_MEASURE_TORSION
- See Also:
- Constant Field Values
-
PICKING_MEASURE_SEQUENCE
public static final int PICKING_MEASURE_SEQUENCE
- See Also:
- Constant Field Values
-
PICKING_NAVIGATE
public static final int PICKING_NAVIGATE
- See Also:
- Constant Field Values
-
PICKING_CONNECT
public static final int PICKING_CONNECT
- See Also:
- Constant Field Values
-
PICKING_STRUTS
public static final int PICKING_STRUTS
- See Also:
- Constant Field Values
-
PICKING_DRAG_SELECTED
public static final int PICKING_DRAG_SELECTED
- See Also:
- Constant Field Values
-
PICKING_DRAG_MOLECULE
public static final int PICKING_DRAG_MOLECULE
- See Also:
- Constant Field Values
-
PICKING_DRAG_ATOM
public static final int PICKING_DRAG_ATOM
- See Also:
- Constant Field Values
-
PICKING_DRAG_MINIMIZE
public static final int PICKING_DRAG_MINIMIZE
- See Also:
- Constant Field Values
-
PICKING_DRAG_MINIMIZE_MOLECULE
public static final int PICKING_DRAG_MINIMIZE_MOLECULE
- See Also:
- Constant Field Values
-
PICKING_INVERT_STEREO
public static final int PICKING_INVERT_STEREO
- See Also:
- Constant Field Values
-
PICKING_ASSIGN_ATOM
public static final int PICKING_ASSIGN_ATOM
- See Also:
- Constant Field Values
-
PICKING_ASSIGN_BOND
public static final int PICKING_ASSIGN_BOND
- See Also:
- Constant Field Values
-
PICKING_ROTATE_BOND
public static final int PICKING_ROTATE_BOND
- See Also:
- Constant Field Values
-
PICKING_IDENTIFY_BOND
public static final int PICKING_IDENTIFY_BOND
- See Also:
- Constant Field Values
-
PICKING_DRAG_LIGAND
public static final int PICKING_DRAG_LIGAND
- See Also:
- Constant Field Values
-
PICKING_DRAG_MODEL
public static final int PICKING_DRAG_MODEL
- See Also:
- Constant Field Values
-
pickingModeNames
private static final java.lang.String[] pickingModeNames
-
PICKINGSTYLE_SELECT_JMOL
public static final int PICKINGSTYLE_SELECT_JMOL
picking styles- See Also:
- Constant Field Values
-
PICKINGSTYLE_SELECT_CHIME
public static final int PICKINGSTYLE_SELECT_CHIME
- See Also:
- Constant Field Values
-
PICKINGSTYLE_SELECT_RASMOL
public static final int PICKINGSTYLE_SELECT_RASMOL
- See Also:
- Constant Field Values
-
PICKINGSTYLE_SELECT_PFAAT
public static final int PICKINGSTYLE_SELECT_PFAAT
- See Also:
- Constant Field Values
-
PICKINGSTYLE_SELECT_DRAG
public static final int PICKINGSTYLE_SELECT_DRAG
- See Also:
- Constant Field Values
-
PICKINGSTYLE_MEASURE_ON
public static final int PICKINGSTYLE_MEASURE_ON
- See Also:
- Constant Field Values
-
PICKINGSTYLE_MEASURE_OFF
public static final int PICKINGSTYLE_MEASURE_OFF
- See Also:
- Constant Field Values
-
pickingStyleNames
private static final java.lang.String[] pickingStyleNames
-
pickingStyle
private int pickingStyle
-
pickingStyleSelect
private int pickingStyleSelect
-
pickingStyleMeasure
private int pickingStyleMeasure
-
rootPickingStyle
private int rootPickingStyle
-
MAX_DOUBLE_CLICK_MILLIS
private static final long MAX_DOUBLE_CLICK_MILLIS
- See Also:
- Constant Field Values
-
MININUM_GESTURE_DELAY_MILLISECONDS
protected static final long MININUM_GESTURE_DELAY_MILLISECONDS
- See Also:
- Constant Field Values
-
SLIDE_ZOOM_X_PERCENT
private static final int SLIDE_ZOOM_X_PERCENT
- See Also:
- Constant Field Values
-
DEFAULT_MOUSE_DRAG_FACTOR
public static final float DEFAULT_MOUSE_DRAG_FACTOR
- See Also:
- Constant Field Values
-
DEFAULT_MOUSE_WHEEL_FACTOR
public static final float DEFAULT_MOUSE_WHEEL_FACTOR
- See Also:
- Constant Field Values
-
DEFAULT_GESTURE_SWIPE_FACTOR
public static final float DEFAULT_GESTURE_SWIPE_FACTOR
- See Also:
- Constant Field Values
-
XY_RANGE
public static final int XY_RANGE
- See Also:
- Constant Field Values
-
gestureSwipeFactor
private float gestureSwipeFactor
-
mouseDragFactor
protected float mouseDragFactor
-
mouseWheelFactor
protected float mouseWheelFactor
-
current
protected final MouseState current
-
moved
protected final MouseState moved
-
clicked
private final MouseState clicked
-
pressed
private final MouseState pressed
-
dragged
private final MouseState dragged
-
pressedCount
protected int pressedCount
-
clickedCount
protected int clickedCount
-
drawMode
private boolean drawMode
-
labelMode
private boolean labelMode
-
dragSelectedMode
private boolean dragSelectedMode
-
measuresEnabled
private boolean measuresEnabled
-
haveSelection
private boolean haveSelection
-
hoverActive
private boolean hoverActive
-
mp
private MeasurementPending mp
-
dragAtomIndex
private int dragAtomIndex
-
mkBondPressed
private boolean mkBondPressed
set to true in checkPressedAction if the screen coordinates of the press are relatively close to the coordinates of the hover that highlighted the bond, indicating that we can alias a left-click to a shift-left-click
-
rubberbandSelectionMode
private boolean rubberbandSelectionMode
-
rectRubber
private final Rectangle rectRubber
-
isAltKeyReleased
private boolean isAltKeyReleased
-
keyProcessing
private boolean keyProcessing
-
isMultiTouchClient
protected boolean isMultiTouchClient
-
isMultiTouchServer
protected boolean isMultiTouchServer
-
pressAction
private int pressAction
-
dragAction
private int dragAction
-
clickAction
private int clickAction
-
measurementQueued
private MeasurementPending measurementQueued
-
zoomTrigger
public boolean zoomTrigger
-
selectionWorking
private boolean selectionWorking
-
-
Method Detail
-
setViewer
public void setViewer(Viewer vwr, java.lang.String commandOptions)
- Parameters:
vwr
-commandOptions
-
-
checkHover
public void checkHover()
-
processMultitouchEvent
public void processMultitouchEvent(int groupID, int eventType, int touchID, int iData, javajs.util.P3 pt, long time)
Specific to ActionManagerMT -- for processing SparshUI gestures- Parameters:
groupID
-eventType
-touchID
-iData
-pt
-time
-
-
bind
void bind(java.lang.String desc, java.lang.String name)
- Parameters:
desc
-name
-
-
clearBindings
protected void clearBindings()
-
unbindAction
void unbindAction(java.lang.String desc, java.lang.String name)
-
newAction
static void newAction(int i, java.lang.String name, java.lang.String info)
-
createActions
void createActions()
-
getActionName
public static java.lang.String getActionName(int i)
-
getActionFromName
public static int getActionFromName(java.lang.String name)
-
getBindingInfo
public java.lang.String getBindingInfo(java.lang.String qualifiers)
-
setBinding
protected void setBinding(Binding newBinding)
-
bnd
boolean bnd(int mouseAction, int... jmolActions)
-
isDrawOrLabelAction
private boolean isDrawOrLabelAction(int a)
-
getBondPickingMode
public int getBondPickingMode()
-
getPickingModeName
public static final java.lang.String getPickingModeName(int pickingMode)
-
getPickingMode
public static final int getPickingMode(java.lang.String str)
-
getPickingStyleName
public static final java.lang.String getPickingStyleName(int pickingStyle)
-
getPickingStyleIndex
public static final int getPickingStyleIndex(java.lang.String str)
-
getAtomPickingMode
public int getAtomPickingMode()
-
setPickingMode
public void setPickingMode(int pickingMode)
-
getPickingState
public java.lang.String getPickingState()
-
getPickingStyle
int getPickingStyle()
-
setPickingStyle
void setPickingStyle(int pickingStyle)
-
setGestureSwipeFactor
void setGestureSwipeFactor(float factor)
-
setMouseDragFactor
void setMouseDragFactor(float factor)
-
setMouseWheelFactor
void setMouseWheelFactor(float factor)
-
isDraggedIsShiftDown
boolean isDraggedIsShiftDown()
-
setCurrent
protected void setCurrent(long time, int x, int y, int mods)
-
getCurrentX
int getCurrentX()
-
getCurrentY
int getCurrentY()
-
setMouseMode
public void setMouseMode()
-
clearMouseInfo
protected void clearMouseInfo()
-
setDragAtomIndex
public void setDragAtomIndex(int iatom)
-
isMTClient
public boolean isMTClient()
-
isMTServer
public boolean isMTServer()
-
dispose
public void dispose()
-
clear
public void clear()
-
startHoverWatcher
public void startHoverWatcher(boolean isStart)
-
setModeMouse
public void setModeMouse(int modeMouse)
only NONE (-1) is implemented; it just stops the hoverWatcher thread so that the vwr references are all removed- Parameters:
modeMouse
-
-
keyPressed
public boolean keyPressed(int key, int modifiers)
called by MouseManager.keyPressed- Specified by:
keyPressed
in interfaceEventManager
- Parameters:
key
-modifiers
-- Returns:
- true if handled
-
keyTyped
public boolean keyTyped(int keyChar, int modifiers)
- Specified by:
keyTyped
in interfaceEventManager
-
keyReleased
public void keyReleased(int key)
- Specified by:
keyReleased
in interfaceEventManager
-
mouseEnterExit
public void mouseEnterExit(long time, int x, int y, boolean isExit)
- Specified by:
mouseEnterExit
in interfaceEventManager
-
setMouseActions
private void setMouseActions(int count, int buttonMods, boolean isRelease)
-
mouseAction
public void mouseAction(int mode, long time, int x, int y, int count, int buttonMods)
- Specified by:
mouseAction
in interfaceEventManager
- Parameters:
mode
- MOVED PRESSED DRAGGED RELEASED CLICKED WHEELEDtime
-x
-y
-count
-buttonMods
- LEFT RIGHT MIDDLE WHEEL SHIFT ALT CTRL
-
checkPressedAction
private void checkPressedAction(int x, int y, long time)
-
checkDragWheelAction
private void checkDragWheelAction(int dragWheelAction, int x, int y, int deltaX, int deltaY, long time, int mode)
-
dragSelected
private void dragSelected(int a, int deltaX, int deltaY, boolean isPickingDrag)
change actual coordinates of selected atoms from set dragSeleted TRUE or set PICKING DRAGSELECTED Basically, set dragSelected adds new functionality to Jmol with alt-drag and alt-shift drag, and set picking dragSelected replaces the standard mouse drag with a move action and also adds rotate and z-shift options. set dragSelected also allows other picking types, such as set picking SELECT, which uses double-click to start rotating/moving another molecule.- Parameters:
a
-deltaX
-deltaY
-isPickingDrag
-
-
checkReleaseAction
private void checkReleaseAction(int x, int y, long time, boolean dragRelease)
-
checkClickAction
private void checkClickAction(int x, int y, long time, int clickedCount)
-
doPopup
private void doPopup(int x, int y)
-
pickLabel
private void pickLabel(int iatom)
-
checkUserAction
private boolean checkUserAction(int mouseAction, int x, int y, int deltaX, int deltaY, long time, int mode)
-
checkMotionRotateZoom
private boolean checkMotionRotateZoom(int mouseAction, int x, int deltaX, int deltaY, boolean isDrag)
- Parameters:
mouseAction
-x
-deltaX
-deltaY
-isDrag
-- Returns:
- TRUE if motion was a zoom
-
getExitRate
private float getExitRate()
-
isRubberBandSelect
private boolean isRubberBandSelect(int action)
-
getRubberBand
Rectangle getRubberBand()
-
calcRectRubberBand
private void calcRectRubberBand()
-
getDegrees
protected float getDegrees(float delta, boolean isX)
Transform a screen pixel change to an angular change such that a full sweep of the dimension (up to 500 pixels) corresponds to 180 degrees of rotation.- Parameters:
delta
-isX
-- Returns:
- desired scaled rotation, in degrees
-
isZoomArea
private boolean isZoomArea(int x)
-
getPoint
private Point3fi getPoint(java.util.Map<java.lang.String,java.lang.Object> t)
-
findNearestAtom
private int findNearestAtom(int x, int y, Point3fi nearestPoint, boolean isClicked)
-
isSelectAction
private boolean isSelectAction(int action)
-
enterMeasurementMode
private void enterMeasurementMode(int iAtom)
-
getMP
private MeasurementPending getMP()
-
addToMeasurement
private int addToMeasurement(int atomIndex, Point3fi nearestPoint, boolean dblClick)
-
resetMeasurement
private void resetMeasurement()
-
exitMeasurementMode
void exitMeasurementMode(java.lang.String refreshWhy)
-
getSequence
private void getSequence()
-
minimize
private void minimize(boolean dragDone)
-
queueAtom
private int queueAtom(int atomIndex, Point3fi ptClicked)
-
setMotion
protected void setMotion(int cursor, boolean inMotion)
-
zoomByFactor
protected void zoomByFactor(int dz, int x, int y)
-
runScript
private void runScript(java.lang.String script)
-
atomOrPointPicked
private void atomOrPointPicked(int atomIndex, Point3fi ptClicked)
-
assignNew
private void assignNew()
-
bondPicked
private void bondPicked(int index)
-
checkTwoAtomAction
private void checkTwoAtomAction(Point3fi ptClicked, int atomIndex)
-
reset
private void reset()
-
selectAtoms
private void selectAtoms(java.lang.String item)
-
setAtomsPicked
private void setAtomsPicked(javajs.util.BS bs, java.lang.String msg)
-
selectRb
private void selectRb(int action)
-
toggleMeasurement
private void toggleMeasurement()
-
zoomTo
private void zoomTo(int atomIndex)
-
userActionEnabled
public boolean userActionEnabled(int action)
-
userAction
public boolean userAction(int action, java.lang.Object[] params)
If the user has created a function to handle this action, run it and cancel action processing if that function returns an explicit FALSE;- Parameters:
action
-params
-- Returns:
- true to continue with the standard action
-
-