All Packages Class Hierarchy This Package Previous Next Index
Class graph.G2Dint
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Canvas
|
+----graph.Graph2D
|
+----graph.G2Dint
- public class G2Dint
- extends Graph2D
- implements MouseListener, MouseMotionListener, KeyListener
This class is an extension of Graph2D class.
It adds interactive selection of the plotting range
and can display the mouse position in user coordinates.
Mouse Events
- MouseDown
- Starts the range selection
- MouseDrag
- Drag out a rectangular range selection
- MouseUp
- Replot with modified plotting range.
-
KeyDown Events
- R
- Redraw plot with default limits
- r
- Redraw plot using current limits
- m
- Pop window to enter manually plot range
- c
- Toggle pop-up window that displays the mouse position
in user coordinates
- d
- Show coordinates of the closest data point to the cursor
- D
- Hide data coordinates pop-window
- h
- This key pressed in Any pop-window at any-time will hide it.
Note: Due to differences in event handling between Java
1.0 and 1.1, this feature no longer works. A Close button has
been added to the pop-windows instead.
- Version:
- $Revision: 1.1.1.1 $, $Date: 1999/11/15 20:37:48 $.
- Author:
- Leigh Brookshaw, Daren Stotler
-
drag
- Set to true when a rectangle is being dragged out by the mouse
-
userlimits
- User limits.
-
xaxis
- Attached X Axis which must be registered with this class.
-
yaxis
- Attached Y Axis which must be registered with this class.
-
G2Dint()
- Constructor implemented to set up listeners.
-
attachAxis(Axis)
- Attach axis to be used for the drag scaling.
-
createXAxis()
- Create Xaxis to be used for the drag scaling
-
createYAxis()
- Create Yaxis to be used for the drag scaling
-
getClosestPoint(int, int)
- Find the closest data point to the cursor
-
keyPressed(KeyEvent)
- Handle keyDown events.
-
keyReleased(KeyEvent)
-
-
keyTyped(KeyEvent)
- Handle the Key Down events.
-
mouseClicked(MouseEvent)
-
-
mouseDragged(MouseEvent)
- Handle the Mouse Drag events
-
mouseEntered(MouseEvent)
-
-
mouseExited(MouseEvent)
-
-
mouseMoved(MouseEvent)
-
Handle the Mouse Mouve events
-
mousePressed(MouseEvent)
- Handle the Mouse Down events
-
mouseReleased(MouseEvent)
- Handle the Mouse Up events
-
rangeAction()
-
Replace the original action method, intended to be generic, with
a specific one for clarity.
-
update(Graphics)
- New update method incorporating mouse dragging.
drag
protected boolean drag
- Set to true when a rectangle is being dragged out by the mouse
userlimits
protected boolean userlimits
- User limits. The user has set the limits using the mouse drag option
xaxis
protected Axis xaxis
- Attached X Axis which must be registered with this class.
This is one of the axes used to find the drag range.
If no X axis is registered no mouse drag.
yaxis
protected Axis yaxis
- Attached Y Axis which must be registered with this class.
This is one of the axes used to find the drag range.
If no Y axis is registered no mouse drag.
G2Dint
public G2Dint()
- Constructor implemented to set up listeners.
createXAxis
public Axis createXAxis()
- Create Xaxis to be used for the drag scaling
createYAxis
public Axis createYAxis()
- Create Yaxis to be used for the drag scaling
attachAxis
public void attachAxis(Axis a)
- Attach axis to be used for the drag scaling. X axes are assumed to
have Axis position Axis.BOTTOM or Axis.TOP. Y axes are assumed
to have position Axis.LEFT or Axis.RIGHT.
- Parameters:
- a - Axis to attach
- Overrides:
- attachAxis in class Graph2D
- See Also:
- Axis
update
public void update(Graphics g)
- New update method incorporating mouse dragging.
- Overrides:
- update in class Graph2D
keyTyped
public void keyTyped(KeyEvent e)
- Handle the Key Down events.
- Overrides:
- keyTyped in class Graph2D
keyPressed
public void keyPressed(KeyEvent e)
- Handle keyDown events.
- Overrides:
- keyPressed in class Graph2D
keyReleased
public void keyReleased(KeyEvent e)
- Overrides:
- keyReleased in class Graph2D
mousePressed
public void mousePressed(MouseEvent e)
- Handle the Mouse Down events
mouseReleased
public void mouseReleased(MouseEvent e)
- Handle the Mouse Up events
mouseEntered
public void mouseEntered(MouseEvent e)
mouseExited
public void mouseExited(MouseEvent e)
mouseClicked
public void mouseClicked(MouseEvent e)
mouseDragged
public void mouseDragged(MouseEvent e)
- Handle the Mouse Drag events
mouseMoved
public void mouseMoved(MouseEvent e)
- Handle the Mouse Mouve events
rangeAction
public void rangeAction()
- Replace the original action method, intended to be generic, with
a specific one for clarity. This method will be invoked by an instance
of the Range class.
getClosestPoint
protected double[] getClosestPoint(int ix,
int iy)
- Find the closest data point to the cursor
All Packages Class Hierarchy This Package Previous Next Index