Class CubeNavigator
- All Implemented Interfaces:
Navigator<CubeAspect>
- Since:
- 4 Oct 2013
- Author:
- Mark Taylor
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ConfigKey<boolean[]>
Config key to select which axes zoom will operate on. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclick
(Surface surface, Point pos, int ibutt, Supplier<CoordSequence> dposSupplier) Mouse click gesture.static CubeNavigator
createNavigator
(boolean isIso, ConfigMap config) Creates a navigator instance from a config map.Drag gesture.Terminating drag gesture.static ConfigKey<?>[]
getConfigKeys
(boolean isIso) Returns the config keys for use with this navigator.getNavOptions
(Surface surface, Point pos) Returns a description of the available navigation gestures and the behaviour they cause when the mouse is positioned at a particular point.Mouse wheel gesture.
-
Field Details
-
ZOOMAXES_KEY
Config key to select which axes zoom will operate on.
-
-
Constructor Details
-
CubeNavigator
public CubeNavigator(double zoomFactor, boolean[] axisFlags) Constructor.- Parameters:
zoomFactor
- amount of zoom for one mouse wheel clickaxisFlags
- 3-element array of flags for whether a zoom operation will zoom in X, Y, Z directions; if null, drag zoom will be along 2 facing axes
-
-
Method Details
-
drag
Description copied from interface:Navigator
Drag gesture.Drag gestures typically indicate panning, and in this case should preferably have the outcome that the same data position remains under the cursor before and after the pan (from
origin
toevt.getPoint()
).- Specified by:
drag
in interfaceNavigator<CubeAspect>
- Parameters:
surface
- initial plot surfacepos
- current mouse positionibutt
- logical mouse button index of dragorigin
- starting point of the drag gesture- Returns:
- navigation action indicated by the gesture, or null for no change
-
endDrag
Description copied from interface:Navigator
Terminating drag gesture. This method is invoked following a sequence of drags when the mouse button has been released.- Specified by:
endDrag
in interfaceNavigator<CubeAspect>
- Parameters:
surface
- initial plot surfacepos
- current mouse positionibutt
- logical mouse button index of terminated dragorigin
- starting point of drag gesture- Returns:
- navigation action indicated by the gesture, or null for no change
-
wheel
Description copied from interface:Navigator
Mouse wheel gesture.Wheel gestures usually indicate zooming, and in this case should preferably have the outcome that the same data position remains at the mouse position before and after the zoom.
- Specified by:
wheel
in interfaceNavigator<CubeAspect>
- Parameters:
surface
- initial plot surfacepos
- current mouse positionwheelrot
- number of wheel rotation clicks- Returns:
- navigation action indicated by the gesture, or null for no change
-
click
public NavAction<CubeAspect> click(Surface surface, Point pos, int ibutt, Supplier<CoordSequence> dposSupplier) Description copied from interface:Navigator
Mouse click gesture.Note that other elements of the plotting system may intercept some mouse clicks for other purposes, so the navigator may not receive all clicks. For instance the topcat plot window currently intercepts button-1 clicks and interprets them as row selection requests. Typically this navigator method may only get invoked for modified or non-button-1 clicks.
Implementation of this gesture may require identifying a data position from a screen position, which is not always trivial, for instance in a 3D plot one graphics position maps to a line of data positions. The
dposIt
argument can optionally be supplied to cope with such instances. If a data pos cannot be determined, null is returned. IfdposIt
is absent, the method will run quickly. If it's present, the method may or may not run slowly by iterating over the data points.- Specified by:
click
in interfaceNavigator<CubeAspect>
- Parameters:
surface
- initial plot surfacepos
- current mouse positionibutt
- logical mouse button indexdposSupplier
- iterable over dataDimCount-element arrays representing all the data space positions plotted, or null- Returns:
- navigation action indicated by the gesture, or null for no change
-
getConfigKeys
Returns the config keys for use with this navigator.- Parameters:
isIso
- whether navigator will be configured for isotropic mode- Returns:
- config keys
-