freegraph
Class GraphingApplet

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--java.applet.Applet
                          |
                          +--freegraph.GraphingApplet
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, GraphPlaneListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class GraphingApplet
extends java.applet.Applet
implements java.awt.event.ActionListener, GraphPlaneListener

Applet for GraphPlane. Provides an text field to enter functions, and a list box to view them. The applet can either be "in line," or drawn on the HTML page, or can be just a button which will create a separate frame for the graphing. (Because of re-draw problems on IE, it works better as a separate frame...plus it can be resized.)

See Also:
Serialized Form

Field Summary
 
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
GraphingApplet()
          constructs a new GraphingApplet
GraphingApplet(boolean inFrame)
          Creates a new GraphingApplet, with the provided InFrame property.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          called by buttons and other components.
 void axisChanged(double xMin, double yMin, double xMax, double yMax)
          called when the axis change on graph
 java.lang.String getAppletInfo()
           
 java.lang.String getParameter(java.lang.String key, java.lang.String def)
          returns the value of a parameter as a String.
 int getParameterAsInt(java.lang.String key, int def)
          returns the value of a parameter as an int.
 int getParameterAsInt(java.lang.String key, int def, int radix)
          returns the value of a parameter as an int.
 java.lang.String[][] getParameterInfo()
           
 void init()
          initializes the Applet by calling internalInit which sets up the GUI
static void main(java.lang.String[] args)
           
 void mousePosMoved(double xPos, double yPos)
          called when the mouse moves on graph, the position is shown on the screen
 
Methods inherited from class java.applet.Applet
destroy, getAccessibleContext, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GraphingApplet

public GraphingApplet(boolean inFrame)
Creates a new GraphingApplet, with the provided InFrame property.

Parameters:
inFrame - sets the InFrame property for the Applet. If inFrame is true, the applet does not try to access the Applet's stub because it is null

GraphingApplet

public GraphingApplet()
constructs a new GraphingApplet

Method Detail

init

public void init()
initializes the Applet by calling internalInit which sets up the GUI

Overrides:
init in class java.applet.Applet

getAppletInfo

public java.lang.String getAppletInfo()
Overrides:
getAppletInfo in class java.applet.Applet

getParameterInfo

public java.lang.String[][] getParameterInfo()
Overrides:
getParameterInfo in class java.applet.Applet

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
called by buttons and other components. Reponds with appropriate action.

Specified by:
actionPerformed in interface java.awt.event.ActionListener

mousePosMoved

public void mousePosMoved(double xPos,
                          double yPos)
called when the mouse moves on graph, the position is shown on the screen

Specified by:
mousePosMoved in interface GraphPlaneListener

axisChanged

public void axisChanged(double xMin,
                        double yMin,
                        double xMax,
                        double yMax)
called when the axis change on graph

Specified by:
axisChanged in interface GraphPlaneListener

getParameter

public java.lang.String getParameter(java.lang.String key,
                                     java.lang.String def)
returns the value of a parameter as a String. If the parameter is not defined, def is returned.


getParameterAsInt

public int getParameterAsInt(java.lang.String key,
                             int def)
returns the value of a parameter as an int. If the parameter is not defined, def is returned. The parameter is parsed to integer using the default radix of 10


getParameterAsInt

public int getParameterAsInt(java.lang.String key,
                             int def,
                             int radix)
returns the value of a parameter as an int. If the parameter is not defined, def is returned. The parameter is parsed to integer using the provided radix


main

public static void main(java.lang.String[] args)