edu.stanford.hci.dtools.statechart
Class StatechartEditor

java.lang.Object
  extended by org.eclipse.ui.part.WorkbenchPart
      extended by org.eclipse.ui.part.EditorPart
          extended by org.eclipse.gef.ui.parts.GraphicalEditor
              extended by org.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette
                  extended by edu.stanford.hci.dtools.statechart.StatechartEditor
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.gef.commands.CommandStackListener, org.eclipse.ui.IEditorPart, org.eclipse.ui.ISaveablePart, org.eclipse.ui.ISelectionListener, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2, org.eclipse.ui.part.IWorkbenchPartOrientation

public class StatechartEditor
extends org.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette

This software is distributed under the BSD License.

This code is partially based on code that is copyright (c) 2004 Elias Volanakis. See License.txt

Author:
Elias Volanakis, Michael Bernstein ( mbernst(AT)stanford.edu ), Bjoern Hartmann ( bjoern(AT)stanford.edu )

Nested Class Summary
 class StatechartEditor.ShapesOutlinePage
          Creates an outline pagebook for this editor.
 
Field Summary
 
Fields inherited from interface org.eclipse.ui.IEditorPart
PROP_DIRTY, PROP_INPUT
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
StatechartEditor()
          Create a new StatechartEditor instance.
 
Method Summary
 void commandStackChanged(java.util.EventObject event)
           
 void doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
           
 void doSaveAs()
           
 void executeCommand(org.eclipse.gef.commands.Command c)
          Added to allow the StatechartEditor to execute any command we want
 java.lang.Object getAdapter(java.lang.Class type)
           
 DiagramModel getModel()
           
 double getZoom()
          returns the current zoom level
 boolean isSaveAsAllowed()
           
 void selectionChanged(org.eclipse.ui.IWorkbenchPart part, org.eclipse.jface.viewers.ISelection selection)
           
 void setDeviceConfiguration(DeviceConfiguration newConfig, java.util.Map<IOComponent,IOComponent> deviceMapping, java.util.Map<StateModel,java.util.List<ComponentConnectionModel>> componentConnectionMap)
          Given a new device configuration and mapping, updates all of the children with the new information
 void updatePaletteForDeviceConfiguration(DeviceConfiguration newConfig)
           
 org.eclipse.draw2d.geometry.Point xformCoordinates(org.eclipse.draw2d.geometry.Point in)
          transforms coordinates from mouse x,y positions in editor window to scaled+panned x,y positions in diagram space
 
Methods inherited from class org.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette
createPartControl
 
Methods inherited from class org.eclipse.gef.ui.parts.GraphicalEditor
dispose, init, isDirty, setFocus
 
Methods inherited from class org.eclipse.ui.part.EditorPart
getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setInitializationData
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPropertyListener, getContentDescription, getOrientation, getPartName, getSite, getTitle, getTitleImage, removePropertyListener, 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, removePropertyListener
 

Constructor Detail

StatechartEditor

public StatechartEditor()
Create a new StatechartEditor instance. This is called by the Workspace.

Method Detail

commandStackChanged

public void commandStackChanged(java.util.EventObject event)
Specified by:
commandStackChanged in interface org.eclipse.gef.commands.CommandStackListener
Overrides:
commandStackChanged in class org.eclipse.gef.ui.parts.GraphicalEditor

doSave

public void doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
Specified by:
doSave in interface org.eclipse.ui.ISaveablePart
Specified by:
doSave in class org.eclipse.ui.part.EditorPart

doSaveAs

public void doSaveAs()
Specified by:
doSaveAs in interface org.eclipse.ui.ISaveablePart
Specified by:
doSaveAs in class org.eclipse.ui.part.EditorPart

getAdapter

public java.lang.Object getAdapter(java.lang.Class type)
Specified by:
getAdapter in interface org.eclipse.core.runtime.IAdaptable
Overrides:
getAdapter in class org.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette

getModel

public DiagramModel getModel()

executeCommand

public void executeCommand(org.eclipse.gef.commands.Command c)
Added to allow the StatechartEditor to execute any command we want

Parameters:
c -

setDeviceConfiguration

public void setDeviceConfiguration(DeviceConfiguration newConfig,
                                   java.util.Map<IOComponent,IOComponent> deviceMapping,
                                   java.util.Map<StateModel,java.util.List<ComponentConnectionModel>> componentConnectionMap)
Given a new device configuration and mapping, updates all of the children with the new information

Parameters:
newConfig -
deviceMapping -

updatePaletteForDeviceConfiguration

public void updatePaletteForDeviceConfiguration(DeviceConfiguration newConfig)

selectionChanged

public void selectionChanged(org.eclipse.ui.IWorkbenchPart part,
                             org.eclipse.jface.viewers.ISelection selection)
Specified by:
selectionChanged in interface org.eclipse.ui.ISelectionListener
Overrides:
selectionChanged in class org.eclipse.gef.ui.parts.GraphicalEditor
See Also:
ISelectionListener.selectionChanged(IWorkbenchPart, ISelection)

isSaveAsAllowed

public boolean isSaveAsAllowed()
Specified by:
isSaveAsAllowed in interface org.eclipse.ui.ISaveablePart
Specified by:
isSaveAsAllowed in class org.eclipse.ui.part.EditorPart

xformCoordinates

public org.eclipse.draw2d.geometry.Point xformCoordinates(org.eclipse.draw2d.geometry.Point in)
transforms coordinates from mouse x,y positions in editor window to scaled+panned x,y positions in diagram space


getZoom

public double getZoom()
returns the current zoom level