|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
weka.gui.beans.StripChart
Bean that can display a horizontally scrolling strip chart. Can display multiple plots simultaneously
Nested Class Summary | |
private class |
StripChart.StripPlotter
|
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 | |
protected java.awt.Color[] |
m_colorList
default colours for colouring lines |
private java.util.LinkedList |
m_dataList
Holds the data to be plotted. |
private int |
m_iheight
Width and height of the off screen image |
private int |
m_iwidth
|
private java.awt.Font |
m_labelFont
|
private java.awt.FontMetrics |
m_labelMetrics
|
private javax.swing.JPanel |
m_legendPanel
Class providing a panel for the legend |
private java.util.Vector |
m_legendText
|
private java.lang.Object |
m_listenee
|
private Logger |
m_log
|
private double |
m_max
Max value for the y axis |
private double |
m_min
Min value for the y axis |
private double |
m_oldMax
|
private double |
m_oldMin
|
private java.awt.Image |
m_osi
The off screen image for rendering to |
private javax.swing.JFrame |
m_outputFrame
|
private StripChart.StripPlotter |
m_plotPanel
|
private double[] |
m_previousY
|
private int |
m_refreshFrequency
Plot every m_refreshFrequency'th point |
private int |
m_refreshWidth
Shift the plot by this many pixels every time a point is plotted |
private javax.swing.JPanel |
m_scalePanel
Class providing a panel for displaying the y axis |
private java.lang.Thread |
m_updateHandler
|
protected BeanVisual |
m_visual
|
private int |
m_xCount
|
private int |
m_xValFreq
Print x axis labels every m_xValFreq points |
private boolean |
m_yScaleUpdate
Scale update requested |
Fields inherited from class javax.swing.JPanel |
|
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.Container |
|
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 | |
StripChart()
|
Method Summary | |
void |
acceptDataPoint(ChartEvent e)
Accept a data point (encapsulated in a chart event) to plot |
void |
acceptDataPoint(double[] dataPoint)
Accept a data point to plot |
boolean |
connectionAllowed(java.lang.String eventName)
Returns true if, at this time, the object will accept a connection via the named event |
void |
connectionNotification(java.lang.String eventName,
java.lang.Object source)
Notify this object that it has been registered as a listener with a source for recieving events described by the named event This object is responsible for recording this fact. |
private int |
convertToPanelY(double yval)
|
void |
disconnectionNotification(java.lang.String eventName,
java.lang.Object source)
Notify this object that it has been deregistered as a listener with a source for named event. |
java.util.Enumeration |
enumerateRequests()
Describe enumerateRequests method here. |
int |
getRefreshFreq()
Get the refresh frequency |
BeanVisual |
getVisual()
Get the visual appearance of this bean |
int |
getXLabelFreq()
Get the frequency by which x axis values are printed |
java.lang.String |
globalInfo()
Global info for this bean |
private void |
initPlot()
|
static void |
main(java.lang.String[] args)
Tests out the StripChart from the command line |
private static java.lang.String |
numToString(double num)
|
void |
performRequest(java.lang.String request)
Describe performRequest method here. |
private void |
readObject(java.io.ObjectInputStream ois)
Provide some necessary initialization after object has been deserialized. |
java.lang.String |
refreshFreqTipText()
GUI Tip text |
void |
setLog(Logger logger)
Set a logger |
void |
setRefreshFreq(int freq)
Set how often (in x axis points) to refresh the display |
private void |
setRefreshWidth()
|
void |
setVisual(BeanVisual newVisual)
Set the visual appearance of this bean |
void |
setXLabelFreq(int freq)
Set the frequency for printing x label values |
void |
showChart()
Popup the chart panel |
private void |
startHandler()
|
void |
stop()
Stop any processing that the bean might be doing. |
protected void |
updateChart(double[] dataPoint)
Update the plot |
void |
useDefaultVisual()
Use the default visual appearance for this bean |
java.lang.String |
xLabelFreqTipText()
GUI Tip text |
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, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, 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, paintComponent, 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, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, 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 |
protected java.awt.Color[] m_colorList
private transient javax.swing.JFrame m_outputFrame
private transient StripChart.StripPlotter m_plotPanel
private transient java.awt.Image m_osi
private int m_iheight
private int m_iwidth
private double m_max
private double m_min
private boolean m_yScaleUpdate
private double m_oldMax
private double m_oldMin
private java.awt.Font m_labelFont
private java.awt.FontMetrics m_labelMetrics
private java.util.Vector m_legendText
private javax.swing.JPanel m_scalePanel
private javax.swing.JPanel m_legendPanel
private java.util.LinkedList m_dataList
private double[] m_previousY
private transient java.lang.Thread m_updateHandler
protected BeanVisual m_visual
private java.lang.Object m_listenee
private transient Logger m_log
private int m_xValFreq
private int m_xCount
private int m_refreshWidth
private int m_refreshFrequency
Constructor Detail |
public StripChart()
Method Detail |
public java.lang.String globalInfo()
String
valuepublic java.lang.String xLabelFreqTipText()
String
valuepublic void setXLabelFreq(int freq)
freq
- an int
valuepublic int getXLabelFreq()
int
valuepublic java.lang.String refreshFreqTipText()
String
valuepublic void setRefreshFreq(int freq)
freq
- an int
valuepublic int getRefreshFreq()
int
valueprivate void setRefreshWidth()
private void readObject(java.io.ObjectInputStream ois) throws java.io.IOException, java.lang.ClassNotFoundException
ois
- an ObjectInputStream
value
java.io.IOException
- if an error occurs
java.lang.ClassNotFoundException
- if an error occursprivate void initPlot()
private void startHandler()
public void showChart()
private int convertToPanelY(double yval)
protected void updateChart(double[] dataPoint)
dataPoint
- contains y values to plotprivate static java.lang.String numToString(double num)
public void acceptDataPoint(ChartEvent e)
acceptDataPoint
in interface ChartListener
e
- a ChartEvent
valuepublic void acceptDataPoint(double[] dataPoint)
dataPoint
- a double[]
valuepublic void setVisual(BeanVisual newVisual)
setVisual
in interface Visible
newVisual
- a BeanVisual
valuepublic BeanVisual getVisual()
getVisual
in interface Visible
BeanVisual
valuepublic void useDefaultVisual()
useDefaultVisual
in interface Visible
public void stop()
stop
in interface BeanCommon
public void setLog(Logger logger)
setLog
in interface BeanCommon
logger
- a weka.gui.Logger
valuepublic boolean connectionAllowed(java.lang.String eventName)
connectionAllowed
in interface BeanCommon
eventName
- the name of the event
public void connectionNotification(java.lang.String eventName, java.lang.Object source)
connectionNotification
in interface BeanCommon
eventName
- the eventsource
- the source with which this object has been registered as
a listenerpublic void disconnectionNotification(java.lang.String eventName, java.lang.Object source)
disconnectionNotification
in interface BeanCommon
eventName
- the eventsource
- the source with which this object has been registered as
a listenerpublic java.util.Enumeration enumerateRequests()
enumerateRequests
method here.
enumerateRequests
in interface UserRequestAcceptor
Enumeration
valuepublic void performRequest(java.lang.String request)
performRequest
method here.
performRequest
in interface UserRequestAcceptor
request
- a String
value
java.lang.IllegalArgumentException
- if an error occurspublic static void main(java.lang.String[] args)
args
- ignored
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |