dataGraph
Class Bar

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Panel
              extended byjava.applet.Applet
                  extended byedu.davidson.tools.SApplet
                      extended bydataGraph.Bar
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, edu.davidson.tools.SDataListener, java.io.Serializable

public class Bar
extends SApplet
implements edu.davidson.tools.SDataListener

Bar is part of the Davidson College Physlets project. It is a subclass of SApplet and implements inter-applet communication using the SDataListener interface.

The following embedding parameters are defined:

Parameter  Value Description
Value 10 The initial height of the bar.
Min 0 The minimum value.
Max 100.0 The full scale value.
Vertical true Vertical or horizontal display.
ShowControls true Show a text field below the bar.

See Also:
Serialized Form

Nested Class Summary
 class Bar.BarGraph
          Class BarGraph
 
Field Summary
 
Fields inherited from class edu.davidson.tools.SApplet
destroyed
 
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
 
Method Summary
 void addData(edu.davidson.tools.SDataSource s, int id, double[] x, double[] y)
          Method addData
 void addDatum(int id, double x, double y)
          Method addDatum
 void addDatum(edu.davidson.tools.SDataSource s, int id, double x, double y)
          Method addDatum
 void deleteSeries(int id)
          Method deleteSeries
 java.lang.String getAppletInfo()
          Gets information about this applet.
 java.lang.String[][] getParameterInfo()
          Gets the embedding parameter information.
 void setAutoscale(boolean scale)
          Method setAutoscale
 void setBarWidth(int newWidth)
          Method setBarWidth
 void setFormat(java.lang.String str)
          Change the display format for the value field.
 void setLabel(java.lang.String newLabel)
          Method setLabel
 void setMax(double m)
          Method setMax
 void setMin(double m)
          Method setMin
 void setNegRGB(int r, int g, int b)
          Sets the color for the postive bar.
 void setNumericFormat(java.lang.String str)
          Method setNumericFormat
 void setPosRGB(int r, int g, int b)
          Sets the color for the postive bar.
 void setTtile(java.lang.String _title)
          Sets the label.
 void setValue(double v)
          Sets the value of the bar.
 
Methods inherited from class edu.davidson.tools.SApplet
addDataListener, addDataSource, checkAppletNames, cleanupDataConnections, clearAllData, clearData, deleteDataConnection, deleteDataConnections, formatValue, forward, getAppletName, getClockID, getClockTime, getDataFromDS, getDataListener, getDataSource, getDataSource, getDebugLevel, getID, getSourceData, getSourceVariables, isClockRunning, isValidFunction, makeDataConnection, pause, removeDataListener, removeDataSource, reset, reverse, sendDataToListener, setAutoRefresh, setClockContinous, setClockCycle, setClockOneShot, setClockTime, setConnectionBlock, setConnectionListener, setConnectionSmoothing, setConnectionSource, setConnectionStride, setConnectionWindowX, setConnectionWindowY, setDebugLevel, setDefault, setDt, setExternalClock, setFPS, setIndependentClock, setTimeContinuous, setTimeCycle, setTimeOneShot, startClock, stepClock, stepTime, stepTimeBack, stepTimeForward, stop, stopClock, updateDataConnection, updateDataConnections
 
Methods inherited from class java.applet.Applet
destroy, getAccessibleContext, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, init, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.davidson.tools.SDataListener
clearSeries, getID, getOwner, setOwner
 

Method Detail

getAppletInfo

public java.lang.String getAppletInfo()
Gets information about this applet.

Returns:
the information string

getParameterInfo

public java.lang.String[][] getParameterInfo()
Gets the embedding parameter information.

Returns:
the information

setAutoscale

public void setAutoscale(boolean scale)
Method setAutoscale

Parameters:
scale -

setFormat

public void setFormat(java.lang.String str)
Change the display format for the value field. Use UNIX fprint syntax.

Parameters:
str - the format string

setLabel

public void setLabel(java.lang.String newLabel)
Method setLabel

Parameters:
newLabel -

setTtile

public void setTtile(java.lang.String _title)
Sets the label.


setBarWidth

public void setBarWidth(int newWidth)
Method setBarWidth

Parameters:
newWidth -

setMax

public void setMax(double m)
Method setMax

Parameters:
m -

setMin

public void setMin(double m)
Method setMin

Parameters:
m -

setValue

public void setValue(double v)
Sets the value of the bar.

Parameters:
v - the value

setPosRGB

public void setPosRGB(int r,
                      int g,
                      int b)
Sets the color for the postive bar. Color values should be in the range [0...255]

Parameters:
r - red
g - green
b - blue

setNegRGB

public void setNegRGB(int r,
                      int g,
                      int b)
Sets the color for the postive bar. Color values should be in the range [0...255]

Parameters:
r - red
g - green
b - blue

setNumericFormat

public void setNumericFormat(java.lang.String str)
Method setNumericFormat

Parameters:
str -

addDatum

public void addDatum(int id,
                     double x,
                     double y)
Method addDatum

Parameters:
id -
x -
y -

addDatum

public void addDatum(edu.davidson.tools.SDataSource s,
                     int id,
                     double x,
                     double y)
Method addDatum

Specified by:
addDatum in interface edu.davidson.tools.SDataListener
Parameters:
s -
id -
x -
y -

addData

public void addData(edu.davidson.tools.SDataSource s,
                    int id,
                    double[] x,
                    double[] y)
Method addData

Specified by:
addData in interface edu.davidson.tools.SDataListener
Parameters:
s -
id -
x -
y -

deleteSeries

public void deleteSeries(int id)
Method deleteSeries

Specified by:
deleteSeries in interface edu.davidson.tools.SDataListener
Parameters:
id -


Visit the Davidson College Physlet Site for additional information.