|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.quinncurtis.chart2djava.ChartObj
com.quinncurtis.chart2djava.GraphObj
com.quinncurtis.chart2djava.ChartMouseListener
com.quinncurtis.chart2djava.ChartZoom
public class ChartZoom
This class implements a chart zoom class using the Java MouseInputListener interface. The mouse is used to define a zoom rectangle within one or more PhysicalCoordinates objects, and the PhysicalCoordinates objects are re-scaled to match the extents of the zoom rectangle.
Field Summary |
---|
Constructor Summary | |
---|---|
ChartZoom()
The default ChartZoom constructor. |
|
ChartZoom(ChartView component,
PhysicalCoordinates[] transforms,
int numtransforms,
boolean brescale)
This constructor creates a new ChartZoom object using the specified component and scales. |
|
ChartZoom(ChartView component,
PhysicalCoordinates transform,
boolean brescale)
This constructor creates a new ChartZoom object using the specified component and scale. |
Method Summary | |
---|---|
void |
addZoomListener()
This method installs the Zoom object by adding it to the mouse listener list of the ChartView component. |
boolean |
checkIntersection(ChartPoint2D testpoint,
NearestPointData np)
The checkIntersection method. |
java.lang.Object |
clone()
Returns an object that is a clone of this ChartZoom object. |
void |
copy(ChartZoom source)
Copies the source zoom object. |
void |
draw(java.awt.Graphics2D g2)
The draw method for this class. |
int |
errorCheck(int nerror)
Checks the zoom object for common errors. |
int |
getButtonMask()
This method returns what mouse button is trapped as the mouse zoom button. |
boolean |
getZoomEnable()
This method return true if the Zoom object event listener is active. |
ChartPoint2D |
getZoomMax(int nmode)
This method returns the final zoom rectangle maximum values using the coordinate system specified by nmode. |
ChartPoint2D |
getZoomMin(int nmode)
This method returns the final zoom rectangle minimum values using the coordinate system specified by nmode. |
boolean |
getZoomObjActive()
Returns True if a zoom operation underway. |
ChartDimension |
getZoomRangeLimitsRatio()
This method returns the zoom range limits ratio placed on the zoom operation. |
boolean |
getZoomStackEnable()
Returns True if the zoom stack is on. |
boolean |
getZoomXEnable()
Returns true if the x dimension is affected by the zoom operation. |
int |
getZoomXRoundMode()
Returns the zoom rounding mode for x dimension. |
boolean |
getZoomYEnable()
Returns true if the y dimension is affected by the zoom operation. |
int |
getZoomYRoundMode()
Returns the zoom rounding mode for y dimension. |
void |
mouseClicked(java.awt.event.MouseEvent event)
The dummy mouseClicked event method for this object. |
void |
mouseDragged(java.awt.event.MouseEvent event)
The mouseDragged event listener for this object. |
void |
mouseEntered(java.awt.event.MouseEvent event)
The dummy mouseEntered event method for this object. |
void |
mouseExited(java.awt.event.MouseEvent event)
Dummy event listener for this object. |
void |
mouseMoved(java.awt.event.MouseEvent event)
The dummy mouseMoved event method for this object. |
void |
mousePressed(java.awt.event.MouseEvent event)
The mousePressed event listener for this object. |
void |
mouseReleased(java.awt.event.MouseEvent event)
The mouseReleased event listener for this object. |
int |
popZoomStack()
Pop a set of zoom coordinate systems from the zoom stack and initialize the current scale with these value, and re-scale the associated axes to match. |
int |
pushZoomStack()
Push a set of coordinate systems onto the zoom stack. |
void |
removeZoomListener()
This method uninstalls the Zoom object by removing it from the mouse listener list of the ChartView component. |
void |
setButtonMask(int buttonmask)
This method specifies what mouse button is trapped as the mouse zoom button. |
void |
setZoomEnable(boolean enable)
Once the Zoom object is created and installed using the addMouseMoveListener method, it can be turned on/off using this method. |
void |
setZoomRangeLimits(ChartDimension limits)
This method sets the zoom range limits placed on the zoom operation. |
void |
setZoomRangeLimits(double x,
double y)
This method sets the zoom range limits placed on the zoom operation. |
void |
setZoomRangeLimitsRatio(ChartDimension ratio)
This method sets the zoom range limits placed on the zoom operation. |
void |
setZoomStackEnable(boolean on)
Turns on/off the zoom stack. |
void |
setZoomXEnable(boolean bzoomx)
True signifies that the x dimension is affected by the zoom operation. |
void |
setZoomXRoundMode(int nzoomx)
Sets the zoom rounding mode for x dimension. |
void |
setZoomYEnable(boolean bzoomy)
True signifies that the y dimension is affected by the zoom operation. |
void |
setZoomYRoundMode(int nzoomy)
Sets the zoom rounding mode for y dimension. |
Methods inherited from class com.quinncurtis.chart2djava.ChartMouseListener |
---|
addChartMouseListener, copy, getEnable, getMouseListenerEnable, removeChartMouseListener, setEnable, setMouseListenerEnable |
Methods inherited from class com.quinncurtis.chart2djava.ChartObj |
---|
copy, getChartObjIDCntr, getChartObjType, getThisChartObjID, TypeSafeVectorCopy |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ChartZoom()
public ChartZoom(ChartView component, PhysicalCoordinates[] transforms, int numtransforms, boolean brescale)
component
- A reference to the ChartView object that the chart is placed in.transforms
- An array, size numtransforms, of the PhysicalCoordinates objects associated with the zoom operation.numtransforms
- The number of PhysicalCoordinates objects in the transforms array.brescale
- True designates that the all of the scales should be re-scaled, once
the final zoom rectangle is ascertained.public ChartZoom(ChartView component, PhysicalCoordinates transform, boolean brescale)
component
- A reference to the ChartView object that the chart is placed in.transform
- The PhysicalCoordinates object associated with the scale being zoomed.brescale
- True designates that the scale should be re-scaled, once
the final zoom rectangle is ascertained.Method Detail |
---|
public void addZoomListener()
public boolean checkIntersection(ChartPoint2D testpoint, NearestPointData np)
checkIntersection
in class ChartMouseListener
np
- Nearest point information for data based objects.testpoint
- The test point.
public java.lang.Object clone()
clone
in class ChartMouseListener
public void copy(ChartZoom source)
source
- The source zoom object.public void draw(java.awt.Graphics2D g2)
draw
in class ChartMouseListener
g2
- The graphics context.public int errorCheck(int nerror)
errorCheck
in class ChartMouseListener
nerror
- Current error state
public int getButtonMask()
getButtonMask
in class ChartMouseListener
public boolean getZoomEnable()
public ChartPoint2D getZoomMax(int nmode)
nmode
- The coordinate system of the returned values. Use one of the
coordinate system constants: DEV_POS, PHYS_POS, NORM_GRAPH_POS, NORM_PLOT_POS.public ChartPoint2D getZoomMin(int nmode)
nmode
- The coordinate system of the returned values. Use one of the
coordinate system constants: DEV_POS, PHYS_POS, NORM_GRAPH_POS, NORM_PLOT_POS.public boolean getZoomObjActive()
public ChartDimension getZoomRangeLimitsRatio()
public boolean getZoomStackEnable()
public boolean getZoomXEnable()
public int getZoomXRoundMode()
public boolean getZoomYEnable()
public int getZoomYRoundMode()
public void mouseClicked(java.awt.event.MouseEvent event)
mouseClicked
in interface java.awt.event.MouseListener
mouseClicked
in class ChartMouseListener
event
- The mouse event contains status information about the mouse.public void mouseDragged(java.awt.event.MouseEvent event)
mouseDragged
in interface java.awt.event.MouseMotionListener
mouseDragged
in class ChartMouseListener
event
- The mouse event contains status information about the mouse.public void mouseEntered(java.awt.event.MouseEvent event)
mouseEntered
in interface java.awt.event.MouseListener
mouseEntered
in class ChartMouseListener
event
- The mouse event contains status information about the mouse.public void mouseExited(java.awt.event.MouseEvent event)
mouseExited
in interface java.awt.event.MouseListener
mouseExited
in class ChartMouseListener
event
- The mouse event contains status information about the mouse.public void mouseMoved(java.awt.event.MouseEvent event)
mouseMoved
in interface java.awt.event.MouseMotionListener
mouseMoved
in class ChartMouseListener
event
- The mouse event contains status information about the mouse.public void mousePressed(java.awt.event.MouseEvent event)
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class ChartMouseListener
event
- The mouse event contains status information about the mouse.public void mouseReleased(java.awt.event.MouseEvent event)
mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class ChartMouseListener
event
- The mouse event contains status information about the mouse.public int popZoomStack()
public int pushZoomStack()
public void removeZoomListener()
public void setButtonMask(int buttonmask)
setButtonMask
in class ChartMouseListener
buttonmask
- Specifies what mouse button is trapped as the mouse zoom button.public void setZoomEnable(boolean enable)
enable
- True turns the mouse listener on.public void setZoomRangeLimits(ChartDimension limits)
limits
- Sets the zoom range limits.public void setZoomRangeLimits(double x, double y)
x
- Sets the x-value of the zoom range limits.y
- Sets the y-value of the zoom range limits.public void setZoomRangeLimitsRatio(ChartDimension ratio)
ratio
- Sets the zoom range limits.public void setZoomStackEnable(boolean on)
on
- True turns on the zoom stack.public void setZoomXEnable(boolean bzoomx)
bzoomx
- True signifies that the x dimension is affected by the zoom operation.public void setZoomXRoundMode(int nzoomx)
nzoomx
- Sets the zoom rounding mode for x dimension. Use one of
the auto axis rounding constants: AUTOAXES_NEAR, AUTOAXES_FAR, or AUTOAXES_EXACT.public void setZoomYEnable(boolean bzoomy)
bzoomy
- True signifies that the y dimension is affected by the zoom operation.public void setZoomYRoundMode(int nzoomy)
nzoomy
- Sets the zoom rounding mode for y dimension. Use one of
the auto axis rounding constants: AUTOAXES_NEAR, AUTOAXES_FAR, or AUTOAXES_EXACT.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |