com.singularsys.jepexamples.applets
Class FunctionCanvas

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Canvas
          extended by com.singularsys.jepexamples.applets.AbstractCanvas
              extended by com.singularsys.jepexamples.applets.FunctionCanvas
All Implemented Interfaces:
java.awt.event.ComponentListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class FunctionCanvas
extends AbstractCanvas

This class plots a graph using the Jep API.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Canvas
java.awt.Canvas.AccessibleAWTCanvas
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  Node expression
          Expression to evaluate
protected  Jep jep
          Math parser
protected  Variable x
          "x" variable
 
Fields inherited from class com.singularsys.jepexamples.applets.AbstractCanvas
axisColor, bgColor, cenX, cenY, defaultOffX, defaultOffY, defaultScaleX, defaultScaleY, dimensions, gridColor, labelColor, labelFont, lastpos, offX, offY, popup, scaleFont, scaleX, scaleY, showGrid, showScale, showTime, strategy
 
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
FunctionCanvas(Jep jep, Variable x)
          Constructor
 
Method Summary
 void dump()
          Dump the coordinates on the standard output
 Node getExpression()
           
protected  void paintCurve(java.awt.Graphics g)
          Paints the graph of the function.
 void rescaled()
          Called when scale, or offset changed Default action is to call repaint
 void setExpression(Node expression)
           
 
Methods inherited from class com.singularsys.jepexamples.applets.AbstractCanvas
center, clipX, clipY, componentHidden, componentMoved, componentResized, componentShown, getOffX, getOffY, getPopup, getScaleX, getScaleY, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, paint, paintAxes, paintCanvas, paintGrid, paintScale, paintTime, paintWhite, reset, resetCanvas, resized, setOffset, setScale, shiftCanvas, update, xAbsolute, xRelative, yAbsolute, yRelative, zoomCanvas
 
Methods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, 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, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, 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, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

jep

protected Jep jep
Math parser


expression

protected Node expression
Expression to evaluate


x

protected Variable x
"x" variable

Constructor Detail

FunctionCanvas

public FunctionCanvas(Jep jep,
                      Variable x)
Constructor

Method Detail

getExpression

public Node getExpression()

setExpression

public void setExpression(Node expression)

paintCurve

protected void paintCurve(java.awt.Graphics g)
Paints the graph of the function. A null argument cause the values to be dumped to stdout.

Specified by:
paintCurve in class AbstractCanvas

rescaled

public void rescaled()
Description copied from class: AbstractCanvas
Called when scale, or offset changed Default action is to call repaint

Overrides:
rescaled in class AbstractCanvas

dump

public void dump()
Dump the coordinates on the standard output

Specified by:
dump in class AbstractCanvas


Copyright © 2010 Singular Systems http://www.singularsys.com/jep