org.eclipse.ohf.stem.ui.views.map
Class MapControl

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.map.MapControl
All Implemented Interfaces:
ISimulationListener, org.eclipse.swt.graphics.Drawable

public class MapControl
extends org.eclipse.swt.widgets.Composite
implements ISimulationListener

This class is a SWT Composite that displays Lat/Long data adapted from the contents of the canonical graph in a Scenario being simluated. It listens for changes in the Simulation and then redraws its view as appropriate.


Nested Class Summary
 class MapControl.TrackHandler
          This class...
 class MapControl.TranslateHandler
          A helper class that defines a mouse-listener that will provide the user the ability to move the map inside the view.
 
Field Summary
 int mouseX
           
 int mouseY
           
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
MapControl(org.eclipse.swt.widgets.Composite parent)
           
 
Method Summary
 void dispose()
           
 ISimulation getSimulation()
           
 void setSimulation(ISimulation simulation)
          Setting the Simulation has the side-effect of causing the control to remove itself as a listener from any previously set Simulation and adding itself as a listener to the new one.
 void simulationChanged(SimulationEvent event)
           
 
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
 

Field Detail

mouseX

public int mouseX

mouseY

public int mouseY
Constructor Detail

MapControl

public MapControl(org.eclipse.swt.widgets.Composite parent)
Parameters:
parent - the parent Composite of the MapControl
Method Detail

simulationChanged

public void simulationChanged(SimulationEvent event)
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)

getSimulation

public final ISimulation getSimulation()
Returns:
the simulation

setSimulation

public final void setSimulation(ISimulation simulation)
Setting the Simulation has the side-effect of causing the control to remove itself as a listener from any previously set Simulation and adding itself as a listener to the new one. It will also cause the image to be initialized from the contents of the new Simulation as appropriate.

Parameters:
simulation - the simulation whose Lat/Long data will be rendered.

dispose

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