public class TimeNavigator extends Object implements Navigator<TimeAspect>
Modifier and Type | Field and Description |
---|---|
static ConfigKey<boolean[]> |
NAVAXES_KEY
Config key to select which axes zoom will operate on.
|
Constructor and Description |
---|
TimeNavigator(double zoomFactor,
boolean tZoom,
boolean yZoom,
boolean tPan,
boolean yPan)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
NavAction<TimeAspect> |
click(Surface surface,
Point pos,
int ibutt,
java.util.function.Supplier<CoordSequence> dposSupplier)
Mouse click gesture.
|
static TimeNavigator |
createNavigator(ConfigMap config)
Creates a navigator instance from a config map.
|
NavAction<TimeAspect> |
drag(Surface surface,
Point point,
int ibutt,
Point origin)
Drag gesture.
|
NavAction<TimeAspect> |
endDrag(Surface surface,
Point pos,
int ibutt,
Point origin)
Terminating drag gesture.
|
static ConfigKey<?>[] |
getConfigKeys()
Returns the config keys for use with this navigator.
|
static Map<Gesture,String> |
getNavOptions(boolean tUse,
boolean yUse)
Returns a description of available navigator options for a time plot,
given X/Y zoom flags.
|
Map<Gesture,String> |
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.
|
NavAction<TimeAspect> |
wheel(Surface surface,
Point pos,
int wheelrot)
Mouse wheel gesture.
|
public static final ConfigKey<boolean[]> NAVAXES_KEY
public TimeNavigator(double zoomFactor, boolean tZoom, boolean yZoom, boolean tPan, boolean yPan)
zoomFactor
- amount of zoom for one mouse wheel clicktZoom
- true iff wheel operation will zoom in horizontal directionyZoom
- true iff wheel operation will zoom in vertical directiontPan
- true iff drag operation will pan in horizontal directionyPan
- true iff drag operation will pan in vertical directionpublic NavAction<TimeAspect> drag(Surface surface, Point point, int ibutt, Point origin)
Navigator
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
to evt.getPoint()
).
drag
in interface Navigator<TimeAspect>
surface
- initial plot surfacepoint
- current mouse positionibutt
- logical mouse button index of dragorigin
- starting point of the drag gesturepublic NavAction<TimeAspect> endDrag(Surface surface, Point pos, int ibutt, Point origin)
Navigator
endDrag
in interface Navigator<TimeAspect>
surface
- initial plot surfacepos
- current mouse positionibutt
- logical mouse button index of terminated dragorigin
- starting point of drag gesturepublic NavAction<TimeAspect> wheel(Surface surface, Point pos, int wheelrot)
Navigator
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.
wheel
in interface Navigator<TimeAspect>
surface
- initial plot surfacepos
- current mouse positionwheelrot
- number of wheel rotation clickspublic NavAction<TimeAspect> click(Surface surface, Point pos, int ibutt, java.util.function.Supplier<CoordSequence> dposSupplier)
Navigator
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. If dposIt
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.
click
in interface Navigator<TimeAspect>
surface
- initial plot surfacepos
- current mouse positionibutt
- logical mouse button indexdposSupplier
- iterable over dataDimCount-element arrays
representing all the data space positions plotted,
or nullpublic Map<Gesture,String> getNavOptions(Surface surface, Point pos)
Navigator
getNavOptions
in interface Navigator<TimeAspect>
surface
- plot surfacepos
- mouse positionpublic static Map<Gesture,String> getNavOptions(boolean tUse, boolean yUse)
tUse
- true iff X zoom is in effectyUse
- true iff Y zoom is in effectpublic static ConfigKey<?>[] getConfigKeys()
public static TimeNavigator createNavigator(ConfigMap config)
getConfigKeys()
are used.config
- configuration mapCopyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.