public abstract class PlotNavigator extends AbstractNavigator
AbstractNavigator.getDirection()
and AbstractNavigator.setDirection(de.erichseifert.gral.navigation.NavigationDirection)
provide a convenient way for setting predefined sets of axes.Modifier and Type | Class and Description |
---|---|
protected static class |
PlotNavigator.NavigationInfo
Data class for storing navigational information for an axis.
|
DEFAULT_ZOOM_FACTOR, DEFAULT_ZOOM_MAX, DEFAULT_ZOOM_MIN
Constructor and Description |
---|
PlotNavigator(Plot plot,
List<String> axesNames)
Initializes a new instance that is responsible for zooming and panning
the axes with the specified names of the specified plot.
|
PlotNavigator(Plot plot,
String... axesNames)
Initializes a new instance that is responsible for zooming and panning
the axes with the specified names of the specified plot.
|
Modifier and Type | Method and Description |
---|---|
protected List<String> |
getAxes()
Returns the names of all axes handled by this object.
|
PointND<? extends Number> |
getCenter()
Returns the current center point.
|
protected abstract int |
getDimensions()
Returns the number dimensions the associated plot can handle.
|
protected abstract Number |
getDimensionValue(String axisName,
PointND<? extends Number> values)
Return the index that can be used to access data for the axis with the
specified name.
|
protected PlotNavigator.NavigationInfo |
getInfo(String axisName)
Returns navigational information for the axis with specified name.
|
protected Plot |
getPlot()
Returns the plot stored in this instance.
|
double |
getZoom()
Returns the current zoom level of the associated object.
|
void |
pan(PointND<? extends Number> deltas)
Moves the center by the relative values of the specified point.
|
void |
reset()
Sets the object's position and zoom level to the default state.
|
protected void |
setAxes(List<String> axesNames)
Sets the names of the axes that should be handled by this object.
|
protected void |
setAxes(String... axesNames)
Sets the names of the axes that should be handled by this object.
|
void |
setCenter(PointND<? extends Number> center)
Sets a new center point.
|
void |
setDefaultState()
Sets the current state as the default state of the object.
|
void |
setZoom(double zoomNew)
Sets the zoom level of the associated object to the specified value.
|
addNavigationListener, centerChanged, connect, disconnect, fireCenterChanged, fireZoomChanged, getDirection, getZoomFactor, getZoomMax, getZoomMin, isPannable, isZoomable, removeNavigationListener, setDirection, setPannable, setZoomable, setZoomFactor, setZoomMax, setZoomMin, zoomChanged, zoomIn, zoomOut
public PlotNavigator(Plot plot, List<String> axesNames)
plot
- AbstractPlot to be zoomed and panned.axesNames
- Names of the axes that should be controlled by this
navigator.public PlotNavigator(Plot plot, String... axesNames)
plot
- AbstractPlot to be zoomed and panned.axesNames
- Names of the axes that should be controlled by this
navigator.protected Plot getPlot()
public double getZoom()
public void setZoom(double zoomNew)
zoomNew
- New zoom level.public PointND<? extends Number> getCenter()
public void setCenter(PointND<? extends Number> center)
center
- New center point in world units.Navigator.isPannable()
,
Navigator.setPannable(boolean)
public void pan(PointND<? extends Number> deltas)
deltas
- Relative values to use for panning.Navigator.isPannable()
,
Navigator.setPannable(boolean)
public void setDefaultState()
public void reset()
protected PlotNavigator.NavigationInfo getInfo(String axisName)
axisName
- Axis name.protected List<String> getAxes()
protected void setAxes(List<String> axesNames)
axesNames
- Names of the axes that should be handled.protected void setAxes(String... axesNames)
axesNames
- Names of the axes that should be handled.protected abstract int getDimensions()
PiePlot
this is 1, for a
two-dimensional plot like XYPlot
this is 2, and so on.protected abstract Number getDimensionValue(String axisName, PointND<? extends Number> values)
getDimensions()
.axisName
- Name of the axis.values
- Data values.Copyright © 2009-2013. All Rights Reserved.