org.keridwen.modelling.monitoring.visualizer
Class LiveMonitoringCurvesViewer

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.keridwen.modelling.monitoring.visualizer.LiveMonitoringCurvesViewer
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, EventListener, Accessible, org.jfree.chart.event.AxisChangeListener, MonitoringModelListener, Visualizer
Direct Known Subclasses:
LiveMonitoringCurvesTreeTableViewer

public class LiveMonitoringCurvesViewer
extends JPanel
implements Visualizer, org.jfree.chart.event.AxisChangeListener

This class is the user interface of the curves plotted when the simulation is monitoring in live to know informations about convergence criteria.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
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.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
LiveMonitoringCurvesViewer(CategoryMonitoringNode categoryMonitoringModel)
          Constructor of LiveMonitoringCurvesViewer.
 
Method Summary
 void addMonitoringNode(MonitoringNode monitoringNode, String curveName, String xUnitName, String yUnitName, String zUnitName, String chartTitle)
          Add monitoringNode used to display a new f(x)=y curve/spectrogram/2D map.
 void axisChanged(org.jfree.chart.event.AxisChangeEvent event)
           
 void categoryMonitoringNodeAdded(CategoryMonitoringNode categoryMonitoringNode)
          A new MonitoringNode is added in the model.
 void cleanLastMeasures()
          Re-initialize all measures considered like last measures.
 CategoryMonitoringNode getCategoryMonitoringNode()
           
 JComponent getComponent()
           
 int getLastCurveId()
           
 List<MonitoringNode> getLastMeasures()
           
 String getNodeName()
           
 void monitoringNodeColorChanged(MonitoringNode monitoringNode, Color newColor)
          The color of the curve represented by a MonitoringNode stored in the MonitoringModel has changed.
 void monitoringNodeRemoved(MonitoringNode monitoringNode)
          A new MonitoringNode is removed in the model.
 void monitoringNodeVisibilityChanged(MonitoringNode monitoringNode, boolean visibility)
          the visibility of a MonitoringNode stored in the MonitoringModel has changed.
 void notifyModelChanged()
          Notify the model changed.
 void notifyNewCurves(MonitoringNode monitoringNode, String visualizerName, String curveName, String xUnitName, String yUnitName, String zUnitName, String chartTitle, String tabTitle)
          Notify a new curve is added to the MonitoringModelListeners stored in this AbstractMonitoringModel.
 void notifyNewMeasure(int curveId, double time, double doubleValue, String curveName, MonitoringNode monitoringNode, String xUnitName, String yUnitName)
          Notify listeners, a new measure is done.
 void removeLastMeasures()
          Remove last measures computed.
 void updateTickMarksCount()
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, 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, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, 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
 

Constructor Detail

LiveMonitoringCurvesViewer

public LiveMonitoringCurvesViewer(CategoryMonitoringNode categoryMonitoringModel)
Constructor of LiveMonitoringCurvesViewer.

Parameters:
monitoringModel - is the MonitoringModel monitored to know informations about convergence of simulation.
categoryMonitoringModel - The reference to the CategoryMonitoringNode represented by this viewer.
Method Detail

categoryMonitoringNodeAdded

public void categoryMonitoringNodeAdded(CategoryMonitoringNode categoryMonitoringNode)
Description copied from interface: MonitoringModelListener
A new MonitoringNode is added in the model.

Specified by:
categoryMonitoringNodeAdded in interface MonitoringModelListener

monitoringNodeRemoved

public void monitoringNodeRemoved(MonitoringNode monitoringNode)
Description copied from interface: MonitoringModelListener
A new MonitoringNode is removed in the model.

Specified by:
monitoringNodeRemoved in interface MonitoringModelListener
Parameters:
monitoringNode - is the MonitoringNode removed.

monitoringNodeVisibilityChanged

public void monitoringNodeVisibilityChanged(MonitoringNode monitoringNode,
                                            boolean visibility)
Description copied from interface: MonitoringModelListener
the visibility of a MonitoringNode stored in the MonitoringModel has changed.

Specified by:
monitoringNodeVisibilityChanged in interface MonitoringModelListener
Parameters:
monitoringNode - The MonitoringNode which has this visibility which has changed.
visibility - the new value of the visibility.

monitoringNodeColorChanged

public void monitoringNodeColorChanged(MonitoringNode monitoringNode,
                                       Color newColor)
Description copied from interface: MonitoringModelListener
The color of the curve represented by a MonitoringNode stored in the MonitoringModel has changed.

Specified by:
monitoringNodeColorChanged in interface MonitoringModelListener
Parameters:
monitoringNode - The MonitoringNode which has this color which has changed.
newColor - the new value of the color.

notifyNewMeasure

public void notifyNewMeasure(int curveId,
                             double time,
                             double doubleValue,
                             String curveName,
                             MonitoringNode monitoringNode,
                             String xUnitName,
                             String yUnitName)
Description copied from interface: MonitoringModelListener
Notify listeners, a new measure is done.

Specified by:
notifyNewMeasure in interface MonitoringModelListener
Parameters:
curveId - the id of the curve plotted in the JFreeChart object.
time - the new time measure done.
doubleValue - the new valued computed associated to the time.
curveName - the name of the curve

updateTickMarksCount

public void updateTickMarksCount()

getComponent

public JComponent getComponent()
Specified by:
getComponent in interface Visualizer
Returns:
the Component of this MonitoringModelListener.

getNodeName

public String getNodeName()
Specified by:
getNodeName in interface Visualizer
Returns:
the name of the MonitoringModelListener.

notifyNewCurves

public void notifyNewCurves(MonitoringNode monitoringNode,
                            String visualizerName,
                            String curveName,
                            String xUnitName,
                            String yUnitName,
                            String zUnitName,
                            String chartTitle,
                            String tabTitle)
Description copied from interface: MonitoringModelListener
Notify a new curve is added to the MonitoringModelListeners stored in this AbstractMonitoringModel.

Specified by:
notifyNewCurves in interface MonitoringModelListener
Parameters:
monitoringNode - the MonitoringNode which contains informations ( DataField ) used to create the new curve.
visualizerName - the name of the visualizer used to know where the new curves must be added.
curveName - the name of the curve used to define the legend.
xUnitName - the name of the x-axis of the new curve.
yUnitName - the name of the y-axis of the new curve.
zUnitName - the name of the z-axis of the new curve.
tabTitle - the name of the tab where is strored this visualizer. It is used to know if you must add the new curve in this visualizer or not.

getLastCurveId

public int getLastCurveId()
Specified by:
getLastCurveId in interface MonitoringModelListener
Specified by:
getLastCurveId in interface Visualizer
Returns:
a unique identifier used to define the id of a new curve which must be added to a view.

addMonitoringNode

public void addMonitoringNode(MonitoringNode monitoringNode,
                              String curveName,
                              String xUnitName,
                              String yUnitName,
                              String zUnitName,
                              String chartTitle)
Description copied from interface: Visualizer
Add monitoringNode used to display a new f(x)=y curve/spectrogram/2D map.

Specified by:
addMonitoringNode in interface Visualizer
Parameters:
monitoringNode - is the MonitoringNode used to store informations used to plot the new curves.
curveName - the name of the curve.
xUnitName - the unit of the x-axis.
yUnitName - the unit of the y-axis.

getCategoryMonitoringNode

public CategoryMonitoringNode getCategoryMonitoringNode()
Specified by:
getCategoryMonitoringNode in interface Visualizer
Returns:
the CategoryMonitoringNode visualize by this Visualizer.

notifyModelChanged

public void notifyModelChanged()
Description copied from interface: MonitoringModelListener
Notify the model changed. This method is used to update user interface.

Specified by:
notifyModelChanged in interface MonitoringModelListener

getLastMeasures

public List<MonitoringNode> getLastMeasures()
Specified by:
getLastMeasures in interface Visualizer
Returns:
the list of curves considered like last measures.

removeLastMeasures

public void removeLastMeasures()
Description copied from interface: MonitoringModelListener
Remove last measures computed.

Specified by:
removeLastMeasures in interface MonitoringModelListener

cleanLastMeasures

public void cleanLastMeasures()
Description copied from interface: MonitoringModelListener
Re-initialize all measures considered like last measures.

Specified by:
cleanLastMeasures in interface MonitoringModelListener

axisChanged

public void axisChanged(org.jfree.chart.event.AxisChangeEvent event)
Specified by:
axisChanged in interface org.jfree.chart.event.AxisChangeListener


Copyright © 2012-2013 Artenum. All Rights Reserved.