Class PTHistogram

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byptolemy.plot.PlotBox
                      extended byptolemy.plot.Histogram
                          extended byPTHistogram
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.print.Printable, java.io.Serializable

public class PTHistogram
extends ptolemy.plot.Histogram

PTHistogram contains three contructors to develop histogram graphs

Author:
Dario Landini (light changes by Pietro Terna; adapted to PTHistogramPlottable interface by Michele Sonnessa)
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class ptolemy.plot.PlotBox
ptolemy.plot.PlotBox.DragListener, ptolemy.plot.PlotBox.ZoomListener
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 boolean useSecondList
           
 boolean useThirdList
           
 
Fields inherited from class ptolemy.plot.Histogram
_currentdataset, _histogram, _points
 
Fields inherited from class ptolemy.plot.PlotBox
_background, _bottomPadding, _colors, _documentBase, _foreground, _grid, _height, _leftPadding, _LOG10SCALE, _lrx, _lry, _padding, _preferredHeight, _preferredWidth, _rangesGivenByZooming, _rightPadding, _sizeHasBeenSet, _topPadding, _ulx, _uly, _usecolor, _width, _wrap, _wrapHigh, _wrapLow, _xBottom, _xhighgiven, _xlog, _xlowgiven, _xMax, _xMin, _xRangeGiven, _xscale, _xTop, _yBottom, _yhighgiven, _ylog, _ylowgiven, _yMax, _yMin, _yRangeGiven, _yscale, _yTop, PTPLOT_RELEASE
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
PTHistogram(int xpos, int ypos, java.lang.String title, java.lang.String xLabel, java.lang.String yLabel, double xRange, double yRange, swarm.collections.ListImpl firstList, java.lang.String caption0)
          First class constructor
PTHistogram(int xpos, int ypos, java.lang.String title, java.lang.String xLabel, java.lang.String yLabel, double xRange, double yRange, swarm.collections.ListImpl firstList, java.lang.String caption0, swarm.collections.ListImpl secondList, java.lang.String caption1)
          Second class constructor
PTHistogram(int xpos, int ypos, java.lang.String title, java.lang.String xLabel, java.lang.String yLabel, double xRange, double yRange, swarm.collections.ListImpl firstList, java.lang.String caption0, swarm.collections.ListImpl secondList, java.lang.String caption1, swarm.collections.ListImpl thirdList, java.lang.String caption2)
          Third class constructor
 
Method Summary
 void addPoints()
          this method should be called by the Observer to paint histogram bars, at every schedule.
 
Methods inherited from class ptolemy.plot.Histogram
_checkDatasetIndex, _drawBar, _drawPlot, _parseLine, addLegend, addPoint, addPoint, clear, fillPlot, samplePlot, setBars, setBinOffset, setBinWidth, writeData, writeFormat
 
Methods inherited from class ptolemy.plot.PlotBox
_deferIfNecessary, _drawPoint, _help, _setButtonsVisibility, _setPadding, _writeOldSyntax, addXTick, addYTick, clearLegends, export, getColor, getColorByName, getDataurl, getDocumentBase, getGrid, getLegend, getMaximumSize, getMinimumSize, getPreferredSize, getTitle, getXLabel, getXLog, getXRange, getXTicks, getYLabel, getYLog, getYRange, getYTicks, init, paintComponent, parseFile, parseFile, print, read, read, resetAxes, setBackground, setBounds, setButtons, setColor, setDataurl, setDocumentBase, setForeground, setGrid, setLabelFont, setSize, setTitle, setTitleFont, setWrap, setXLabel, setXLog, setXRange, setYLabel, setYLog, setYRange, write, write, write, writeOldSyntax, zoom
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

useSecondList

public boolean useSecondList

useThirdList

public boolean useThirdList
Constructor Detail

PTHistogram

public PTHistogram(int xpos,
                   int ypos,
                   java.lang.String title,
                   java.lang.String xLabel,
                   java.lang.String yLabel,
                   double xRange,
                   double yRange,
                   swarm.collections.ListImpl firstList,
                   java.lang.String caption0)
First class constructor

Parameters:
xpos - the horizontal position in pixels (left side is 0)
ypos - the vertical position in pixels (upper side is 0)
title - the title of the histogram
xLabel - the label on the X axis
yLabel - the label on the Y axis
xRange - the right dimension of the histogram
firstList - a data list
caption0 - the caption in legend

PTHistogram

public PTHistogram(int xpos,
                   int ypos,
                   java.lang.String title,
                   java.lang.String xLabel,
                   java.lang.String yLabel,
                   double xRange,
                   double yRange,
                   swarm.collections.ListImpl firstList,
                   java.lang.String caption0,
                   swarm.collections.ListImpl secondList,
                   java.lang.String caption1)
Second class constructor

Parameters:
xpos - the horizontal position in pixels (left side is 0)
ypos - the vertical position in pixels (upper side is 0)
title - the title of the histogram
xLabel - the label on the X axis
yLabel - the label on the Y axis
xRange - the right dimension of the histogram
firstList - a first data list
caption0 - the first caption in legend
secondList - a second data list
caption1 - the second caption in legend

PTHistogram

public PTHistogram(int xpos,
                   int ypos,
                   java.lang.String title,
                   java.lang.String xLabel,
                   java.lang.String yLabel,
                   double xRange,
                   double yRange,
                   swarm.collections.ListImpl firstList,
                   java.lang.String caption0,
                   swarm.collections.ListImpl secondList,
                   java.lang.String caption1,
                   swarm.collections.ListImpl thirdList,
                   java.lang.String caption2)
Third class constructor

Parameters:
xpos - the horizontal position in pixels (left side is 0)
ypos - the vertical position in pixels (upper side is 0)
title - the title of the histogram
xLabel - the label on the X axis
yLabel - the label on the Y axis
xRange - the right dimension of the histogram
firstList - a first data list
caption0 - the first caption in legend
secondList - a second data list
caption1 - the secondf caption in legend
thirdList - a third data list
Method Detail

addPoints

public void addPoints()
this method should be called by the Observer to paint histogram bars, at every schedule. It paints a point for each number contained in the lists of the single object.