|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.quinncurtis.chart3djava.ChartObj
com.quinncurtis.chart3djava.GraphObj
com.quinncurtis.chart3djava.ChartMouseListener
com.quinncurtis.chart3djava.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(ChartPoint3D 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. |
ChartPoint3D |
getZoomMax(int nmode)
This method returns the final zoom rectangle maximum values using the coordinate system specified by nmode. |
ChartPoint3D |
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. |
ChartDimension3D |
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. |
static void |
interpolatepoint3D(ChartPoint3D known1,
ChartPoint3D known2,
ChartPoint3D partknown,
int plane)
Uses linear interpolation to determine the values of a 3D point based one the values of other points in the same plane. |
static void |
interpolatepoint3D2(ChartPoint3D known1,
ChartPoint3D known2,
ChartPoint3D known3,
ChartPoint3D partknown,
int plane)
Uses linear interpolation to determine the values of a 3D point based one the values of other points in the same plane. |
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(ChartDimension3D 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(ChartDimension3D 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.chart3djava.ChartMouseListener |
---|
addChartMouseListener, copy, getEnable, getMouseListenerEnable, removeChartMouseListener, setEnable, setMouseListenerEnable |
Methods inherited from class com.quinncurtis.chart3djava.ChartObj |
---|
copy, getChartObjIDCntr, getChartObjType, getThisChartObjID |
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 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.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.Method Detail |
---|
public int errorCheck(int nerror)
errorCheck
in class ChartMouseListener
nerror
- Current error state
public void copy(ChartZoom source)
source
- The source zoom object.public java.lang.Object clone()
clone
in class ChartMouseListener
public int pushZoomStack()
public int popZoomStack()
public void setZoomEnable(boolean enable)
enable
- True turns the mouse listener on.public void addZoomListener()
public void removeZoomListener()
public boolean getZoomEnable()
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 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 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 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 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 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 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 static void interpolatepoint3D(ChartPoint3D known1, ChartPoint3D known2, ChartPoint3D partknown, int plane)
known1
- Known 3D point #1 on plane.known2
- Known 3D point #2 on plane.partknown
- A 3D point with either only one parameter (x, y or z) known.plane
- Specifies what plane to solve forpublic static void interpolatepoint3D2(ChartPoint3D known1, ChartPoint3D known2, ChartPoint3D known3, ChartPoint3D partknown, int plane)
known1
- Known 3D point #1 on plane.known2
- Known 3D point #2 on plane.known3
- Known 3D point #3 on plane.partknown
- A 3D point with either only one parameter (x, y or z) known.plane
- Specifies what plane to solve forpublic ChartPoint3D 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 ChartPoint3D 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 void draw(java.awt.Graphics2D g2)
draw
in class ChartMouseListener
g2
- The graphics context.public void setZoomXEnable(boolean bzoomx)
bzoomx
- True signifies that the x dimension is affected by the zoom operation.public void setZoomYEnable(boolean bzoomy)
bzoomy
- True signifies that the y dimension is affected by the zoom operation.public boolean getZoomXEnable()
public boolean getZoomYEnable()
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 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.public int getZoomXRoundMode()
public int getZoomYRoundMode()
public void setButtonMask(int buttonmask)
setButtonMask
in class ChartMouseListener
buttonmask
- Specifies what mouse button is trapped as the mouse zoom button.public int getButtonMask()
getButtonMask
in class ChartMouseListener
public void setZoomStackEnable(boolean on)
on
- True turns on the zoom stack.public boolean getZoomStackEnable()
public void setZoomRangeLimits(ChartDimension3D 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 ChartDimension3D getZoomRangeLimitsRatio()
public void setZoomRangeLimitsRatio(ChartDimension3D ratio)
ratio
- Sets the zoom range limits.public boolean checkIntersection(ChartPoint3D testpoint, NearestPointData np)
checkIntersection
in class ChartMouseListener
np
- Nearest point information for data based objects.testpoint
- The test point.
public boolean getZoomObjActive()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |