Class graph.G2Dint
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
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: To hide Any pop-window press the key h in the
window. This will hide the window at any time. Depending on your
windowing system the mouse button might have to be pressed in the
popup window to ensure it has the keyboard focus.
- Version:
- 1.9, 1996/07/02 06:01:12.
- Author:
- Leigh Brookshaw
-
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()
-
-
action(Event, Object)
- Handle the Action Events.
-
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
-
keyDown(Event, int)
- Handle the Key Down events.
-
mouseDown(Event, int, int)
- Handle the Mouse Down events
-
mouseDrag(Event, int, int)
- Handle the Mouse Drag events
-
mouseMove(Event, int, int)
-
Handle the Mouse Mouve events
-
mouseUp(Event, int, int)
- Handle the Mouse Up events
-
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()
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
keyDown
public boolean keyDown(Event e,
int key)
- Handle the Key Down events.
- Overrides:
- keyDown in class Graph2D
mouseDown
public boolean mouseDown(Event e,
int x,
int y)
- Handle the Mouse Down events
- Overrides:
- mouseDown in class Component
mouseUp
public boolean mouseUp(Event e,
int x,
int y)
- Handle the Mouse Up events
- Overrides:
- mouseUp in class Component
mouseDrag
public boolean mouseDrag(Event e,
int x,
int y)
- Handle the Mouse Drag events
- Overrides:
- mouseDrag in class Component
mouseMove
public boolean mouseMove(Event e,
int x,
int y)
- Handle the Mouse Mouve events
- Overrides:
- mouseMove in class Component
action
public boolean action(Event e,
Object a)
- Handle the Action Events.
This handler allows external classes (pop-up windows etc.) to
communicate to this class asyncronously.
- Overrides:
- action in class Component
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