org.ow2.clif.console.lib.egui.monitor
Class TableGraphComposite

java.lang.Object
  extended by org.eclipse.swt.widgets.Widget
      extended by org.eclipse.swt.widgets.Control
          extended by org.eclipse.swt.widgets.Scrollable
              extended by org.eclipse.swt.widgets.Composite
                  extended by org.ow2.clif.console.lib.egui.monitor.TableGraphComposite
All Implemented Interfaces:
java.util.EventListener, org.eclipse.jface.viewers.ISelectionChangedListener, org.eclipse.swt.events.PaintListener, org.eclipse.swt.events.SelectionListener, org.eclipse.swt.graphics.Drawable, org.eclipse.swt.internal.SWTEventListener

public class TableGraphComposite
extends org.eclipse.swt.widgets.Composite
implements org.eclipse.jface.viewers.ISelectionChangedListener, org.eclipse.swt.events.SelectionListener, org.eclipse.swt.events.PaintListener

Content of CTabItems.

Author:
Tsirimiaina ANDRIANAVONIMIARINA JAONA, Florian Francheteau, Bruno Dillenseger

Nested Class Summary
 class TableGraphComposite.BladeLabelProvider
           
 class TableGraphComposite.BladeOptionCellModifier
          This class represents the cell modifier for the TableViewer of the Monitoring view
 class TableGraphComposite.BladeTableContentProvider
           
 
Field Summary
 
Fields inherited from class org.eclipse.swt.widgets.Composite
embeddedHandle
 
Fields inherited from class org.eclipse.swt.widgets.Widget
handle
 
Constructor Summary
TableGraphComposite(org.eclipse.swt.widgets.Composite parent, int style, ClifAppFacade clifApp, java.util.Map<java.lang.String,ClifDeployDefinition> selectedTestPlan, java.util.Map<java.lang.String,java.lang.Integer> serverColors)
           
 
Method Summary
 void addBladeOption(BladeOption bladeOption)
          Adds a BladeOption to listBlades.
 void addPoint(java.lang.String injectorID, java.lang.String label, int totalTime, long stat)
          Add point in the graph
 void beginTimer(java.lang.String id)
          Function called when the test is starting.
 java.lang.String constructStatsTree(java.lang.String tabTitle)
          Returns (or creates if directories don't exist) the path where the CSV file will be filled
 void dispose()
           
 Graph getCanvas()
          Get the canvas where graph are drawn
 boolean getCollectDataValue()
          Gets value of Collect check box
 java.lang.Object[] getInjectorsToCollect()
          Get blades whose monitoring data must be picked up
 java.lang.String[] getInjectorsToDisplay()
          Get blades whose monitoring data must be drawn
 org.eclipse.swt.custom.CCombo getViewComboInjectors()
          Get the combo
 void paintControl(org.eclipse.swt.events.PaintEvent e)
           
 void removeAllBlades()
          Removes all BladeOption
 void removeAllPoints()
          Remove all points in the graph
 void removeLastBladeEntered()
          Removes last BladeOption added in listBlades.
 void reset()
          Reset graph draw
 void selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
          Calls when user clicks the cells of blades Table
 void setDelay(int delay)
          Set delay interval beetween two graph redraw
 void setTimeFrame(int nbPoints)
          Set nbpoints to display
 void start()
          Start drawing thread
 void stop()
          Stop drawing thread
 void storeMonitoring(java.lang.String bladeId, java.lang.String[] label, int time, long[] stat)
          Store monitoring data in a CSV File
 void suspendTimer(java.lang.String id)
          Function called when the test is suspending.
 void updateGraph()
          Redraw graph with the new collected stat
 void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent event)
           
 void widgetSelected(org.eclipse.swt.events.SelectionEvent e)
           
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, computeSize, getBackgroundMode, getChildren, getClientArea, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getBorderWidth, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addFocusListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TableGraphComposite

public TableGraphComposite(org.eclipse.swt.widgets.Composite parent,
                           int style,
                           ClifAppFacade clifApp,
                           java.util.Map<java.lang.String,ClifDeployDefinition> selectedTestPlan,
                           java.util.Map<java.lang.String,java.lang.Integer> serverColors)
Parameters:
parent - TabFolder where this widget is added
style - style
clifApp -
selectedTestPlan -
serverColors -
Method Detail

getInjectorsToCollect

public java.lang.Object[] getInjectorsToCollect()
Get blades whose monitoring data must be picked up

Returns:
blades which are true in listen column

getInjectorsToDisplay

public java.lang.String[] getInjectorsToDisplay()
Get blades whose monitoring data must be drawn

Returns:
blades which are true in draw column

storeMonitoring

public void storeMonitoring(java.lang.String bladeId,
                            java.lang.String[] label,
                            int time,
                            long[] stat)
Store monitoring data in a CSV File

Parameters:
bladeId - identifier of the blade
label - blade labels
time - time of measure to collect
stat - blade statistics (corresponding to the label)

constructStatsTree

public java.lang.String constructStatsTree(java.lang.String tabTitle)
Returns (or creates if directories don't exist) the path where the CSV file will be filled

Parameters:
tabTitle - name of the tab where data will be stored
Returns:
String that corresponds to the path where the CSV file will be filled

getCollectDataValue

public boolean getCollectDataValue()
Gets value of Collect check box

Returns:
boolean corresponding to the value of collectDataCheckBox

addBladeOption

public void addBladeOption(BladeOption bladeOption)
Adds a BladeOption to listBlades.

Parameters:
bladeOption - BladeOption to add

removeLastBladeEntered

public void removeLastBladeEntered()
Removes last BladeOption added in listBlades.


removeAllBlades

public void removeAllBlades()
Removes all BladeOption


getCanvas

public Graph getCanvas()
Get the canvas where graph are drawn

Returns:
Graph the canvas.

getViewComboInjectors

public org.eclipse.swt.custom.CCombo getViewComboInjectors()
Get the combo

Returns:
CCombo the combo

beginTimer

public void beginTimer(java.lang.String id)
Function called when the test is starting. Begin the timer for the requested blade.

Parameters:
id -

suspendTimer

public void suspendTimer(java.lang.String id)
Function called when the test is suspending. Suspend the timer for the requested blade.

Parameters:
id -

updateGraph

public void updateGraph()
Redraw graph with the new collected stat


addPoint

public void addPoint(java.lang.String injectorID,
                     java.lang.String label,
                     int totalTime,
                     long stat)
Add point in the graph

Parameters:
injectorID -
label -
totalTime -
stat -

removeAllPoints

public void removeAllPoints()
Remove all points in the graph


dispose

public void dispose()
Overrides:
dispose in class org.eclipse.swt.widgets.Widget

widgetDefaultSelected

public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent event)
Specified by:
widgetDefaultSelected in interface org.eclipse.swt.events.SelectionListener
See Also:
SelectionListener.widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)

selectionChanged

public void selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
Calls when user clicks the cells of blades Table

Specified by:
selectionChanged in interface org.eclipse.jface.viewers.ISelectionChangedListener
See Also:
ISelectionChangedListener.selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)

paintControl

public void paintControl(org.eclipse.swt.events.PaintEvent e)
Specified by:
paintControl in interface org.eclipse.swt.events.PaintListener

widgetSelected

public void widgetSelected(org.eclipse.swt.events.SelectionEvent e)
Specified by:
widgetSelected in interface org.eclipse.swt.events.SelectionListener
See Also:
SelectionListener.widgetSelected(org.eclipse.swt.events.SelectionEvent)

setDelay

public void setDelay(int delay)
Set delay interval beetween two graph redraw

Parameters:
delay -

reset

public void reset()
Reset graph draw


setTimeFrame

public void setTimeFrame(int nbPoints)
Set nbpoints to display

Parameters:
nbPoints -

start

public void start()
Start drawing thread


stop

public void stop()
Stop drawing thread