org.eclipse.ohf.stem.ui.views
Class SimulationControl

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.eclipse.ohf.stem.ui.views.SimulationControl
All Implemented Interfaces:
java.util.EventListener, ISimulationListener, org.eclipse.swt.events.ControlListener, org.eclipse.swt.graphics.Drawable, org.eclipse.swt.internal.SWTEventListener

public class SimulationControl
extends org.eclipse.swt.widgets.Composite
implements ISimulationListener, org.eclipse.swt.events.ControlListener

This class is an SWT control that displays the status/state of an ISimulation and allows the ISimulation to be managed.


Field Summary
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
SimulationControl(org.eclipse.swt.widgets.Composite parent, ISimulation simulation)
          Constructor
 
Method Summary
 void controlMoved(org.eclipse.swt.events.ControlEvent event)
          Event handler method for moved window events.
 void controlResized(org.eclipse.swt.events.ControlEvent event)
          Compute the new bounds for the simulation control after resizing.
 void dispose()
           
 ISimulation getSimulation()
           
 void pause()
          Pause the simulation
 void reset()
          Reset the simulation and the controls.
 void run()
          Run the simulation
 void simulationChanged(SimulationEvent event)
          This is where the simulation control hears about changes in the simulation it is managing.
 void step()
          Step the simulation
 void stop()
          Stop the simulation
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, computeSize, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, 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, getBorderWidth, 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, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimulationControl

public SimulationControl(org.eclipse.swt.widgets.Composite parent,
                         ISimulation simulation)
Constructor

Parameters:
parent -
simulation -
Method Detail

controlResized

public void controlResized(org.eclipse.swt.events.ControlEvent event)
Compute the new bounds for the simulation control after resizing.

Specified by:
controlResized in interface org.eclipse.swt.events.ControlListener
Parameters:
event -

controlMoved

public void controlMoved(org.eclipse.swt.events.ControlEvent event)
Event handler method for moved window events.

Specified by:
controlMoved in interface org.eclipse.swt.events.ControlListener
Parameters:
event -

getSimulation

public ISimulation getSimulation()
Returns:
the simulation to which this control is attached or associated

dispose

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

simulationChanged

public void simulationChanged(SimulationEvent event)
This is where the simulation control hears about changes in the simulation it is managing. It is really only interested in all events generated by the active simulation

Specified by:
simulationChanged in interface ISimulationListener
Parameters:
event - the event that records what happened to the simulation.
See Also:
ISimulationListener.simulationChanged(org.eclipse.ohf.stem.jobs.simulation.SimulationEvent)

run

public void run()
Run the simulation


pause

public void pause()
Pause the simulation


reset

public void reset()
Reset the simulation and the controls.


step

public void step()
Step the simulation


stop

public void stop()
Stop the simulation