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

java.lang.Object
  extended by org.eclipse.core.commands.common.EventManager
      extended by org.eclipse.ui.part.WorkbenchPart
          extended by org.eclipse.ui.part.ViewPart
              extended by org.eclipse.ohf.stem.ui.views.map.InternalMapView
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, ISimulationListener, ISimulationManagerListener, org.eclipse.ui.IPersistable, org.eclipse.ui.ISelectionListener, org.eclipse.ui.IViewPart, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2, org.eclipse.ui.IWorkbenchPart3, org.eclipse.ui.part.IWorkbenchPartOrientation

public class InternalMapView
extends org.eclipse.ui.part.ViewPart
implements org.eclipse.ui.ISelectionListener, ISimulationManagerListener, ISimulationListener

This code is no longer used and is kept for reference purposes only. Delete as needed. DAF This is the view of the internal graphics of STEM. The code creates an independent view inside STEM's perspective. The user has the ability to change the colors that are set when drawing the polygons, and the color of the view's background. The scale of the map can be chosen too, as well as the option to draw the polygons' borders and nearest neighbors.


Nested Class Summary
 class InternalMapView.TrackHandler
          This class...
 class InternalMapView.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
static int DEFAULT_INITIAL_SCALE_SELECTION
          This is the default initial value selected for the scale (ruler)
static java.lang.String ID_MAP_VIEW
          The ID of the Map View.
 int mouseX
           
 int mouseY
           
static int SCALE_MAXIMUM
          The maximum value for the scale
static int SCALE_MINIMUM
          The minimum value for the scale
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
InternalMapView()
          Constructor
 
Method Summary
 void createPartControl(org.eclipse.swt.widgets.Composite parent)
           
 void dispose()
           
 void selectionChanged(org.eclipse.ui.IWorkbenchPart part, org.eclipse.jface.viewers.ISelection selection)
          This method is called whenever ANYTHING is selected in the Eclipse workbench.
 void setFocus()
          This is required by the interface, but we're not using it.
 void simulationChanged(SimulationEvent event)
          In case a specific simulation is changed during the cycle, the map is being updated respectively.
 void simulationsChanged(SimulationManagerEvent event)
          The main view implements the ISimulationManagerListener interface, and therefore listens to the simulation manager that handles the simulations running in the system.
 
Methods inherited from class org.eclipse.ui.part.ViewPart
getViewSite, init, init, saveState, setInitializationData
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, getAdapter, getContentDescription, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, getTitleToolTip, removePartPropertyListener, removePropertyListener, setPartProperty, showBusy
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

ID_MAP_VIEW

public static final java.lang.String ID_MAP_VIEW
The ID of the Map View.

See Also:
Constant Field Values

DEFAULT_INITIAL_SCALE_SELECTION

public static final int DEFAULT_INITIAL_SCALE_SELECTION
This is the default initial value selected for the scale (ruler)

See Also:
SCALE_MINIMUM, SCALE_MAXIMUM, Constant Field Values

SCALE_MINIMUM

public static final int SCALE_MINIMUM
The minimum value for the scale

See Also:
DEFAULT_INITIAL_SCALE_SELECTION, Constant Field Values

SCALE_MAXIMUM

public static final int SCALE_MAXIMUM
The maximum value for the scale

See Also:
DEFAULT_INITIAL_SCALE_SELECTION, Constant Field Values

mouseX

public int mouseX

mouseY

public int mouseY
Constructor Detail

InternalMapView

public InternalMapView()
Constructor

Method Detail

createPartControl

public void createPartControl(org.eclipse.swt.widgets.Composite parent)
Specified by:
createPartControl in interface org.eclipse.ui.IWorkbenchPart
Specified by:
createPartControl in class org.eclipse.ui.part.WorkbenchPart
See Also:
WorkbenchPart.createPartControl(org.eclipse.swt.widgets.Composite)

dispose

public void dispose()
Specified by:
dispose in interface org.eclipse.ui.IWorkbenchPart
Overrides:
dispose in class org.eclipse.ui.part.WorkbenchPart
See Also:
WorkbenchPart.dispose()

setFocus

public void setFocus()
This is required by the interface, but we're not using it.

Specified by:
setFocus in interface org.eclipse.ui.IWorkbenchPart
Specified by:
setFocus in class org.eclipse.ui.part.WorkbenchPart
See Also:
WorkbenchPart.setFocus()

selectionChanged

public void selectionChanged(org.eclipse.ui.IWorkbenchPart part,
                             org.eclipse.jface.viewers.ISelection selection)
This method is called whenever ANYTHING is selected in the Eclipse workbench. It's job is to filter out selections of ISimulation instances and update the polygons list in the MapCanvas

Specified by:
selectionChanged in interface org.eclipse.ui.ISelectionListener
See Also:
ISelectionListener.selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)

simulationsChanged

public void simulationsChanged(SimulationManagerEvent event)
The main view implements the ISimulationManagerListener interface, and therefore listens to the simulation manager that handles the simulations running in the system.

Specified by:
simulationsChanged in interface ISimulationManagerListener
Parameters:
event - the event

simulationChanged

public void simulationChanged(SimulationEvent event)
In case a specific simulation is changed during the cycle, the map is being updated respectively.

Specified by:
simulationChanged in interface ISimulationListener
Parameters:
event - the simulation event