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

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()
Constructor implemented to set up listeners.

Method Index

 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 keyPressed(KeyEvent)
Handle keyDown events.
 o keyReleased(KeyEvent)
 o keyTyped(KeyEvent)
Handle the Key Down events.
 o mouseClicked(MouseEvent)
 o mouseDragged(MouseEvent)
Handle the Mouse Drag events
 o mouseEntered(MouseEvent)
 o mouseExited(MouseEvent)
 o mouseMoved(MouseEvent)
Handle the Mouse Mouve events
 o mousePressed(MouseEvent)
Handle the Mouse Down events
 o mouseReleased(MouseEvent)
Handle the Mouse Up events
 o rangeAction()
Replace the original action method, intended to be generic, with a specific one for clarity.
 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()
Constructor implemented to set up listeners.

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 keyTyped
 public void keyTyped(KeyEvent e)
Handle the Key Down events.

Overrides:
keyTyped in class Graph2D
 o keyPressed
 public void keyPressed(KeyEvent e)
Handle keyDown events.

Overrides:
keyPressed in class Graph2D
 o keyReleased
 public void keyReleased(KeyEvent e)
Overrides:
keyReleased in class Graph2D
 o mousePressed
 public void mousePressed(MouseEvent e)
Handle the Mouse Down events

 o mouseReleased
 public void mouseReleased(MouseEvent e)
Handle the Mouse Up events

 o mouseEntered
 public void mouseEntered(MouseEvent e)
 o mouseExited
 public void mouseExited(MouseEvent e)
 o mouseClicked
 public void mouseClicked(MouseEvent e)
 o mouseDragged
 public void mouseDragged(MouseEvent e)
Handle the Mouse Drag events

 o mouseMoved
 public void mouseMoved(MouseEvent e)
Handle the Mouse Mouve events

 o 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.

 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