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

Variable Index

 o drag
Set to true when a rectangle is being dragged out by the mouse
 o userlimits
User limits.
 o xaxis
Attached X Axis which must be registered with this class.
 o yaxis
Attached Y Axis which must be registered with this class.

Constructor Index

 o G2Dint()

Method Index

 o action(Event, Object)
Handle the Action Events.
 o attachAxis(Axis)
Attach axis to be used for the drag scaling.
 o createXAxis()
Create Xaxis to be used for the drag scaling
 o createYAxis()
Create Yaxis to be used for the drag scaling
 o getClosestPoint(int, int)
Find the closest data point to the cursor
 o keyDown(Event, int)
Handle the Key Down events.
 o mouseDown(Event, int, int)
Handle the Mouse Down events
 o mouseDrag(Event, int, int)
Handle the Mouse Drag events
 o mouseMove(Event, int, int)
Handle the Mouse Mouve events
 o mouseUp(Event, int, int)
Handle the Mouse Up events
 o update(Graphics)
New update method incorporating mouse dragging.

Variables

 o drag
  protected boolean drag
Set to true when a rectangle is being dragged out by the mouse
 o userlimits
  protected boolean userlimits
User limits. The user has set the limits using the mouse drag option
 o 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.
 o 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.

Constructors

 o G2Dint
  public G2Dint()

Methods

 o createXAxis
  public Axis createXAxis()
Create Xaxis to be used for the drag scaling
 o createYAxis
  public Axis createYAxis()
Create Yaxis to be used for the drag scaling
 o 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
 o update
  public void update(Graphics g)
New update method incorporating mouse dragging.
Overrides:
update in class Graph2D
 o keyDown
  public boolean keyDown(Event e,
                         int key)
Handle the Key Down events.
Overrides:
keyDown in class Graph2D
 o mouseDown
  public boolean mouseDown(Event e,
                           int x,
                           int y)
Handle the Mouse Down events
Overrides:
mouseDown in class Comonent
 o mouseUp
  public boolean mouseUp(Event e,
                         int x,
                         int y)
Handle the Mouse Up events
Overrides:
mouseUp in class Comonent
 o mouseDrag
  public boolean mouseDrag(Event e,
                           int x,
                           int y)
Handle the Mouse Drag events
Overrides:
mouseDrag in class Comonent
 o mouseMove
  public boolean mouseMove(Event e,
                           int x,
                           int y)
Handle the Mouse Mouve events
Overrides:
mouseMove in class Comonent
 o 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 Comonent
 o 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