edu.stanford.hci.dtools.deviceeditor
Class DeviceEditor

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.deviceeditor.DeviceEditor
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 DeviceEditor
extends org.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette

A graphical editor with flyout palette that can edit .dtd files. The binding between the .dtd file extension and this editor is done in plugin.xml. This code is partially based on code that is copyright (c) 2004 Elias Volanakis. See License.txt

This software is distributed under the BSD License.

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

Nested Class Summary
 class DeviceEditor.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
DeviceEditor()
          Create a new DeviceEditor 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)
          The DeviceEditor can now execute commands we define
 void export(java.util.Map<StateModel,java.util.List<ComponentConnectionModel>> map)
           
 java.lang.Object getAdapter(java.lang.Class type)
           
 DeviceDiagramModel getModel()
           
 double getZoom()
          returns the current zoom level
 boolean isSaveAsAllowed()
           
 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, selectionChanged, 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

DeviceEditor

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

Method Detail

executeCommand

public void executeCommand(org.eclipse.gef.commands.Command c)
The DeviceEditor can now execute commands we define

Parameters:
c -

export

public void export(java.util.Map<StateModel,java.util.List<ComponentConnectionModel>> map)

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 DeviceDiagramModel getModel()

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