Class Histogram

All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer,,,

public class Histogram
extends SApplet

The Histogram Physlet sorts data into bins to form a histogram. The range and number of bins can be set using the Min, Max, and NumBins embedding parameters. Single datum are added to existing bins whereas data sets will either replace the data that has already been sorted or add to existing data depending on the value of the autoReplace flag.

See Also:
Serialized Form

Fields inherited from class
clock, dataConnections, dataListeners, dataSources, lock
Fields inherited from class java.awt.Component
Fields inherited from interface java.awt.image.ImageObserver
Constructor Summary
Method Summary
 void addData( s, int id, double[] x, double[] y)
          Data listener method.
 void addDatum( s, int id, double x, double y)
          Data listener method.
 void clearSeries(int id)
          Set all bins to zero if autoReplace flag is true.
 void deleteSeries(int id)
          Set all bins to zero.
 java.lang.String getAppletInfo()
 SApplet getOwner()
          Data source method.
 java.lang.String getParameter(java.lang.String key, java.lang.String def)
 java.lang.String[][] getParameterInfo()
 double[][] getVariables()
          Data source method.
 java.lang.String[] getVarStrings()
          Data source method.
 void init()
 void reset()
          Reset the initial state.
 void setAutoReplaceData(int id, boolean replace)
          Controls the clear function so that data will either replace or add to the histogram when the addData method is called.
 void setMinMaxBins(double min, double max)
          Set the minimum and maximum values sorted by the histogram.
 void setNumBins(int n)
          Set the number of bins in the histogram.
 void setOwner(SApplet owner)
          Data source method.
Methods inherited from class
addDataListener, addDataSource, cleanupDataConnections, clearAllData, clearData, deleteDataConnection, deleteDataConnections, destroy, forward, getClockID, getClockTime, getDataConnectionFromDL, getDataConnectionFromDS, getDataFromDS, getDataListener, getDataListener, getDataSource, getDataSource, getID, getRunningID, getSourceData, getSourceVariables, isAutoRefresh, isClockRunning, makeDataConnection, pause, removeDataListener, removeDataSource, reverse, setAutoRefresh, setClockContinous, setClockCycle, setClockOneShot, setClockTime, setConnectionBlock, setConnectionListener, setConnectionSmoothing, setConnectionSource, setConnectionStride, setDefault, setDt, setExternalClock, setFPS, setRunningID, setRunningID, setTimeContinuous, setTimeCycle, setTimeOneShot, startClock, stepClock, stepTime, stepTimeBack, stepTimeForward, stopClock, updateDataConnection, updateDataConnections
Methods inherited from class java.applet.Applet
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
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, update, validate
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface
Methods inherited from interface

Constructor Detail


public Histogram()
Method Detail


public void addData( s,
                    int id,
                    double[] x,
                    double[] y)
Data listener method. DO NOT SCRIPT.
Specified by:
addData in interface


public void addDatum( s,
                     int id,
                     double x,
                     double y)
Data listener method. DO NOT SCRIPT.
Specified by:
addDatum in interface


public void clearSeries(int id)
Set all bins to zero if autoReplace flag is true.
Specified by:
clearSeries in interface


public void deleteSeries(int id)
Set all bins to zero.
Specified by:
deleteSeries in interface


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


public SApplet getOwner()
Data source method. DO NOT SCRIPT.
Specified by:
getOwner in interface


public java.lang.String getParameter(java.lang.String key,
                                     java.lang.String def)


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


public double[][] getVariables()
Data source method. DO NOT SCRIPT.
Specified by:
getVariables in interface


public java.lang.String[] getVarStrings()
Data source method. DO NOT SCRIPT.
Specified by:
getVarStrings in interface


public void init()
init in class java.applet.Applet


public void reset()
Reset the initial state. Set all bins to zero.
reset in class SApplet


public void setAutoReplaceData(int id,
                               boolean replace)
Controls the clear function so that data will either replace or add to the histogram when the addData method is called. Whenver a data source sends a complete data set, the histogram can either clear the bins or add the new data to the exisiting data. The default if for all the data in the bins to be replaced. Set this flag to true in order to keep the old data and add the new data. Note: Data sources that supply only a single datum add this datum to existing data. Use the deleteSeries method to clear exisitng data if the autoReplaceData flag has ben set to false.
replace - set to true to replace existing data. set to false to add to existing data.


public void setMinMaxBins(double min,
                          double max)
Set the minimum and maximum values sorted by the histogram.


public void setNumBins(int n)
Set the number of bins in the histogram.


public void setOwner(SApplet owner)
Data source method. DO NOT SCRIPT.
Specified by:
setOwner in interface

Copyright Wolfgang Christian

Visit the Davidson CollegePhyslets Page