jmathlib
Class Plotter

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--jmathlib.Plotter
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class Plotter
extends java.awt.Panel

See Also:
Serialized Form

Inner classes inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
protected  java.util.Vector curveArray
          a list of curve to be drawn in this Plotter
protected  java.lang.String title
          plotter title
protected  Axis xAxis
          x-axis
protected  Axis yAxis
          y-axis
 
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
Plotter(Curve curve, java.lang.String title, java.awt.Color backGround, Axis xAxis, Axis yAxis)
          Construct a new plotter
 
Method Summary
 void addCurve(Curve curve)
          Add the given curve to the list of curves
 java.awt.Insets getInsets()
          Overriden so as to return (10,10,10,10)
 void paint(java.awt.Graphics g)
          awt.Component paint method
 void redrawBackground()
          Forces an overall repainting of the component
 void removeAllCurves()
          Remove all curves from this plotter's list of curves
 void setRepaintAllMode(boolean repaintAll)
          Set rendering policy ;
 void setTitle(java.lang.String title, java.awt.Color titleColor)
          Set this plotter's title
 void setXAxis(Axis axis)
          Set X-axis to the given Axis
 void setYAxis(Axis axis)
          Set Y-axis to the given Axis
 double[] toGraphCoordinates(java.awt.Point m)
          Converts mouse-coordinates to graph-coordinates
 java.awt.Point toMouseCoordinates(double[] c)
          Converts graph-coordinates to mouse-coordinates
 void update(java.awt.Graphics g)
          Overriden so as to avoid use of double-buffering ; simply call paint(g) w/o repainting the background, except if it's called from redrawBackground.
 
Methods inherited from class java.awt.Panel
addNotify, getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

curveArray

protected java.util.Vector curveArray
a list of curve to be drawn in this Plotter

xAxis

protected Axis xAxis
x-axis

yAxis

protected Axis yAxis
y-axis

title

protected java.lang.String title
plotter title
Constructor Detail

Plotter

public Plotter(Curve curve,
               java.lang.String title,
               java.awt.Color backGround,
               Axis xAxis,
               Axis yAxis)
Construct a new plotter
Parameters:
curve - the first curve ; can be null
backGround - the backGround color
xAxis - the x-axis
yAxis - the y-axis
Method Detail

getInsets

public java.awt.Insets getInsets()
Overriden so as to return (10,10,10,10)
Overrides:
getInsets in class java.awt.Container

addCurve

public void addCurve(Curve curve)
Add the given curve to the list of curves

removeAllCurves

public void removeAllCurves()
Remove all curves from this plotter's list of curves

setXAxis

public void setXAxis(Axis axis)
Set X-axis to the given Axis

setYAxis

public void setYAxis(Axis axis)
Set Y-axis to the given Axis

setTitle

public void setTitle(java.lang.String title,
                     java.awt.Color titleColor)
Set this plotter's title

toMouseCoordinates

public java.awt.Point toMouseCoordinates(double[] c)
Converts graph-coordinates to mouse-coordinates
Parameters:
c - the graph-coordinate of the point to be converted
Returns:
a Point encapsulating mouse-coordinates

toGraphCoordinates

public double[] toGraphCoordinates(java.awt.Point m)
Converts mouse-coordinates to graph-coordinates
Parameters:
m - a Point encapsulating mouse-coordinates
Returns:
the graph-coordinate of the point to be converted

setRepaintAllMode

public void setRepaintAllMode(boolean repaintAll)
Set rendering policy ;
Parameters:
repaintAll - If true, every call to repaint() yields an overall repainting of the component ; Otherwise, only points that have not been drawn yet get painted (so as to speed up intermediate rendering)

redrawBackground

public void redrawBackground()
Forces an overall repainting of the component

update

public void update(java.awt.Graphics g)
Overriden so as to avoid use of double-buffering ; simply call paint(g) w/o repainting the background, except if it's called from redrawBackground.
Overrides:
update in class java.awt.Container

paint

public void paint(java.awt.Graphics g)
awt.Component paint method
Overrides:
paint in class java.awt.Container


jmathlib/ABMOdeSolver.java