|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.awt.Component
|
+--freegraph.GraphPlane
GraphPlane is a X-Y or cartesian coordinate plane which draws the axis and a list of GraphPlaneItems (typically instances of ExpressionEvaluator). The GraphPlane handles the zooming with the mouse and can be monitored with GraphPlaneListener to receive notification of axis changes or mouse position changes.
No Graphics2D is used to keep it compatible with Java 1.1.
| Field Summary | |
static int |
XMAX_DEFAULT
|
static int |
XMIN_DEFAULT
|
static int |
YMAX_DEFAULT
|
static int |
YMIN_DEFAULT
|
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
GraphPlane()
constructs a new GraphPlane |
|
| Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
dispatches action events from the popup menu. |
void |
addGraphPlaneItem(GraphPlaneItem gp)
adds a GraphPlaneItem to be drawn when the graph is drawn |
void |
addGraphPlaneListener(GraphPlaneListener l)
adds a GraphPlaneListener to receive events about the mouse location and the size of the GraphPlane. |
int |
convertX(double x)
Converts a graph X value to a component X value |
int |
convertY(double y)
Converts from a graph Y value to a component Y value |
double |
deconvertX(int x)
Converts from a component X value to a graph X value |
double |
deconvertY(int y)
Converts from a component Y value to a graph Y value |
double |
getXMax()
returns the maximum X value for the GraphPlane |
double |
getXMin()
returns the minimum X value for the GraphPlane |
double |
getYMax()
returns the maximum Y value for the GraphPlane |
double |
getYMin()
returns the minimum Y value for the GraphPlane |
java.util.Enumeration |
graphPlaneItems()
returns an Enumeration of the GraphPlanItems |
void |
mouseClicked(java.awt.event.MouseEvent event)
|
void |
mouseDragged(java.awt.event.MouseEvent event)
draws the zoom (invert) rectangle |
void |
mouseMoved(java.awt.event.MouseEvent event)
converts the position of the mouse to graph coordinates and fires event to GraphPlaneListeners. |
void |
mousePressed(java.awt.event.MouseEvent event)
If the left mouse button is pressed, global variables are used to store the mouse location for use with a zoom. If right mouse button is pressed, the popup menu is displayed. |
void |
mouseReleased(java.awt.event.MouseEvent event)
If a zoom rectangle is being drawn, the graph's axis are changed and the graph is updated. |
void |
paint(java.awt.Graphics g)
paints the graph by drawing the axis and then drawing each GraphPlaneItem. |
void |
removeGraphPlaneItem(GraphPlaneItem gp)
removes a GraphPlaneItem |
void |
removeGraphPlaneListener(GraphPlaneListener l)
removes a GraphPlaneListener |
void |
reset()
resets the GraphPlane to its default values |
void |
zoomin()
zooms out the graph |
void |
zoomout()
zooms in the graph |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static int XMIN_DEFAULT
public static int YMIN_DEFAULT
public static int XMAX_DEFAULT
public static int YMAX_DEFAULT
| Constructor Detail |
public GraphPlane()
| Method Detail |
public double getXMax()
public double getXMin()
public double getYMax()
public double getYMin()
public java.util.Enumeration graphPlaneItems()
public void addGraphPlaneItem(GraphPlaneItem gp)
public void removeGraphPlaneItem(GraphPlaneItem gp)
public void addGraphPlaneListener(GraphPlaneListener l)
public void removeGraphPlaneListener(GraphPlaneListener l)
public void reset()
public void zoomout()
public void zoomin()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenerpublic void paint(java.awt.Graphics g)
paint in class java.awt.Componentpublic int convertX(double x)
public double deconvertX(int x)
public int convertY(double y)
public double deconvertY(int y)
public void mouseClicked(java.awt.event.MouseEvent event)
public void mousePressed(java.awt.event.MouseEvent event)
public void mouseReleased(java.awt.event.MouseEvent event)
public void mouseDragged(java.awt.event.MouseEvent event)
public void mouseMoved(java.awt.event.MouseEvent event)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||