de.erichseifert.gral.plots
Class PlotNavigator

java.lang.Object
  extended by de.erichseifert.gral.plots.PlotNavigator

public class PlotNavigator
extends Object

Class that controls the zoom of a Plot.


Constructor Summary
PlotNavigator(Plot plot)
          Creates a new PlotZoomer object that is responsible for the specified plot.
 
Method Summary
 Number getCenter(Axis axis)
          Returns the center point of the specified axis.
 Plot getPlot()
          Returns the plot stored in this instance.
 double getZoom()
          Returns the average zoom factor of all axes.
 double getZoomMax()
          Returns the minimal zoom factor.
 double getZoomMin()
          Returns the minimal zoom factor.
 void reset()
          Resets the plot's zoom to the original value.
 void setCenter(Axis axis, Number center)
          Sets a new center point for the specified axis.
 void setZoom(double zoomNew)
          Sets the plot's zoom level to the specified value.
 void setZoomMax(double max)
          Sets the maximal zoom factor.
 void setZoomMin(double min)
          Sets the minimal zoom factor.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlotNavigator

public PlotNavigator(Plot plot)
Creates a new PlotZoomer object that is responsible for the specified plot.

Parameters:
plot - Plot to be zoomed.
Method Detail

getPlot

public Plot getPlot()
Returns the plot stored in this instance.

Returns:
Stored plot object.

getZoom

public double getZoom()
Returns the average zoom factor of all axes.

Returns:
Average zoom factor of all axes.

setZoom

public void setZoom(double zoomNew)
Sets the plot's zoom level to the specified value.

Parameters:
zoomNew - New zoom level.

getCenter

public Number getCenter(Axis axis)
Returns the center point of the specified axis.

Parameters:
axis - Axis.
Returns:
Center point in axis units.

setCenter

public void setCenter(Axis axis,
                      Number center)
Sets a new center point for the specified axis.

Parameters:
axis - Axis.
center - New center point in axis units.

reset

public void reset()
Resets the plot's zoom to the original value.


getZoomMin

public double getZoomMin()
Returns the minimal zoom factor.

Returns:
Minimal zoom factor.

setZoomMin

public void setZoomMin(double min)
Sets the minimal zoom factor.

Parameters:
min - New minimal zoom factor.

getZoomMax

public double getZoomMax()
Returns the minimal zoom factor.

Returns:
Maximal zoom factor.

setZoomMax

public void setZoomMax(double max)
Sets the maximal zoom factor.

Parameters:
max - New maximal zoom factor.


Copyright © 2009-2010. All Rights Reserved.