GEF v2.0

org.eclipse.gef.ui.parts
Class GraphicalRootEditPart

java.lang.Object
  |
  +--org.eclipse.gef.editparts.AbstractEditPart
        |
        +--org.eclipse.gef.editparts.AbstractGraphicalEditPart
              |
              +--org.eclipse.gef.ui.parts.GraphicalRootEditPart
All Implemented Interfaces:
EditPart, GraphicalEditPart, IAdaptable, LayerConstants, LayerManager, RequestConstants, RootEditPart
Direct Known Subclasses:
GraphicalRootEditPartWithOverview, PaletteRootEditPart

public class GraphicalRootEditPart
extends AbstractGraphicalEditPart
implements RootEditPart, LayerConstants, LayerManager

Provides support for representation of any other graphical EditPart. It contains Layers which are used to represent specific type of visual information. The Layers are (1) Primary - Used to hold the main EditPart's Figures. (2) Connection - Used to hold the connections between EditParts. (3) Handle - Takes care of holding handles for EditParts. (4) Feedback - Shows feedback information for the EditParts.


Inner classes inherited from class org.eclipse.gef.editparts.AbstractGraphicalEditPart
AbstractGraphicalEditPart.AccessibleGraphicalEditPart, AbstractGraphicalEditPart.DefaultAccessibleAnchorProvider
 
Inner classes inherited from class org.eclipse.gef.editparts.AbstractEditPart
AbstractEditPart.EditPolicyIterator
 
Inner classes inherited from class org.eclipse.gef.editparts.LayerManager
LayerManager.Helper
 
Field Summary
protected  EditPart contents
           
protected  EditPartViewer viewer
           
 
Fields inherited from class org.eclipse.gef.editparts.AbstractGraphicalEditPart
figure, handles, sourceConnections, targetConnections
 
Fields inherited from class org.eclipse.gef.editparts.AbstractEditPart
children, eventListeners, FLAG_ACTIVE, FLAG_FOCUS, FLAG_INITIALIZED, MAX_FLAG
 
Fields inherited from interface org.eclipse.gef.EditPart
SELECTED, SELECTED_NONE, SELECTED_PRIMARY
 
Fields inherited from interface org.eclipse.gef.LayerConstants
CONNECTION_LAYER, FEEDBACK_LAYER, HANDLE_LAYER, PRIMARY_LAYER
 
Fields inherited from interface org.eclipse.gef.editparts.LayerManager
ID
 
Fields inherited from interface org.eclipse.gef.RequestConstants
REQ_ADD, REQ_ALIGN, REQ_ALIGN_CHILD, REQ_ALIGN_CHILDREN, REQ_ANCESTOR_DELETED, REQ_CONNECTION_END, REQ_CONNECTION_START, REQ_CREATE, REQ_CREATE_BENDPOINT, REQ_DELETE, REQ_DELETE_BENDPOINT, REQ_DELETE_DEPENDANT, REQ_DIRECT_EDIT, REQ_MOVE, REQ_MOVE_BENDPOINT, REQ_MOVE_CHILD, REQ_MOVE_CHILDREN, REQ_ORPHAN, REQ_ORPHAN_CHILDREN, REQ_RECONNECT_END, REQ_RECONNECT_SOURCE, REQ_RECONNECT_START, REQ_RECONNECT_TARGET, REQ_RESIZE, REQ_RESIZE_CHILD, REQ_RESIZE_CHILDREN, REQ_SELECTION, REQ_SELECTION_HOVER, REQ_SOURCE_DELETED, REQ_TARGET_DELETED
 
Constructor Summary
GraphicalRootEditPart()
           
 
Method Summary
protected  void createEditPolicies()
          Creates the initial EditPolicies and reserves slots for dynamic ones.
protected  IFigure createFigure()
          Returns the figure to be used as this part's visuals.
 Command getCommand(Request req)
          Doesnt provide any command support, returns an un-executable command
 IFigure getContentPane()
          Returns the figure to which childrens' figures will be added.
 EditPart getContents()
           
 DragTracker getDragTracker(Request req)
          Return a drag tracker suitable for dragging this.
 IFigure getLayer(Object key)
          Returns the layer for the given key
 Object getModel()
          Returns the model of this EditPart.
 RootEditPart getRoot()
          Return this, as this is the root EditPart.
 EditPartViewer getViewer()
          Return the EditorView for this.
 void refresh()
          Called to force a refresh of all properties displayed by this EditPart.
protected  void refreshChildren()
           Refreshes the set of Children.
 void setContents(EditPart editpart)
          Sets the contents.
 void setViewer(EditPartViewer newViewer)
          Sets the viewer.
 
Methods inherited from class org.eclipse.gef.editparts.AbstractGraphicalEditPart
activate, addChildVisual, addSourceConnection, addTargetConnection, deactivate, dispose, fireRemovingSourceConnection, fireRemovingTargetConnection, fireSourceConnectionAdded, fireTargetConnectionAdded, getAdapter, getFigure, getModelSourceConnections, getModelTargetConnections, getParentingFigure, getSourceConnections, getTargetConnections, primAddSourceConnection, primAddTargetConnection, primRemoveSourceConnection, primRemoveTargetConnection, refreshSourceConnections, refreshTargetConnections, registerVisuals, removeChildVisual, removeSourceConnection, removeTargetConnection, reorderChild, reorderSourceConnection, reorderTargetConnection, setFigure, setLayoutConstraint, shouldInitialize, unregister
 
Methods inherited from class org.eclipse.gef.editparts.AbstractEditPart
activateEditPolicies, addChild, addEditPartListener, createChild, createConnection, createOrFindConnection, deactivateEditPolicies, debug, debugFeedback, doInitialize, eraseSourceFeedback, eraseTargetFeedback, fireActivated, fireChildAdded, fireDeactivated, fireRemovingChild, fireSelectionChanged, getAccessibleEditPart, getChildren, getEditPolicy, getEditPolicyIterator, getEventListeners, getFlag, getKeyHandler, getModelChildren, getParent, getSelected, getTargetEditPart, hasFocus, initialize, installEditPolicy, isActive, isSelectable, performRequest, refreshVisuals, register, registerAccessibility, registerModel, removeChild, removeEditPartListener, removeEditPolicy, setFlag, setFocus, setModel, setParent, setSelected, showSourceFeedback, showTargetFeedback, toString, understandsRequest, unregisterAccessibility, unregisterModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.gef.EditPart
activate, addEditPartListener, deactivate, dispose, eraseSourceFeedback, eraseTargetFeedback, getChildren, getEditPolicy, getKeyHandler, getParent, getSelected, getTargetEditPart, hasFocus, installEditPolicy, performRequest, removeEditPartListener, removeEditPolicy, setFocus, setModel, setParent, setSelected, showSourceFeedback, showTargetFeedback, understandsRequest
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

contents

protected EditPart contents

viewer

protected EditPartViewer viewer
Constructor Detail

GraphicalRootEditPart

public GraphicalRootEditPart()
Method Detail

createEditPolicies

protected void createEditPolicies()
Description copied from class: AbstractEditPart
Creates the initial EditPolicies and reserves slots for dynamic ones. Should be overridden to install the inital edit policies based on the model's initial state. null can be used to reserve a "slot", should there be some desire to guarantee the ordering of EditPolcies.
Overrides:
createEditPolicies in class AbstractEditPart
Following copied from class: org.eclipse.gef.editparts.AbstractEditPart
See Also:
AbstractEditPart.doInitialize(), AbstractEditPart.installEditPolicy(Object, EditPolicy)

createFigure

protected IFigure createFigure()
Description copied from class: AbstractGraphicalEditPart
Returns the figure to be used as this part's visuals.
Overrides:
createFigure in class AbstractGraphicalEditPart

getCommand

public Command getCommand(Request req)
Doesnt provide any command support, returns an un-executable command
Specified by:
getCommand in interface EditPart
Overrides:
getCommand in class AbstractEditPart
Following copied from class: org.eclipse.gef.editparts.AbstractEditPart
Parameters:
Request - A request describing the command to be created.
See Also:
EditPolicy.getCommand(Request)

getContents

public EditPart getContents()
Specified by:
getContents in interface RootEditPart

getDragTracker

public DragTracker getDragTracker(Request req)
Return a drag tracker suitable for dragging this.
Specified by:
getDragTracker in interface EditPart
Overrides:
getDragTracker in class AbstractGraphicalEditPart
Following copied from class: org.eclipse.gef.editparts.AbstractGraphicalEditPart
Parameters:
Request - A Request describing the type of drag.

getLayer

public IFigure getLayer(Object key)
Returns the layer for the given key
Specified by:
getLayer in interface LayerManager
Overrides:
getLayer in class AbstractGraphicalEditPart
Following copied from class: org.eclipse.gef.editparts.AbstractGraphicalEditPart
Parameters:
layer - Name of the Layer to be returned
Returns:
The layer with the given name.

getContentPane

public IFigure getContentPane()
Returns the figure to which childrens' figures will be added. An example would be a ScrollPane. Figures of child editpart are not added to the ScrollPane, but to its ViewPort's View.
Overrides:
getContentPane in class AbstractGraphicalEditPart

getModel

public Object getModel()
Returns the model of this EditPart.
Specified by:
getModel in interface EditPart
Overrides:
getModel in class AbstractEditPart

getRoot

public RootEditPart getRoot()
Return this, as this is the root EditPart.
Specified by:
getRoot in interface EditPart
Overrides:
getRoot in class AbstractEditPart
Returns:
Root EditPart

getViewer

public EditPartViewer getViewer()
Return the EditorView for this.
Specified by:
getViewer in interface RootEditPart
Overrides:
getViewer in class AbstractEditPart
Parameters:
EditorView - The viewer for the Root.

refresh

public void refresh()
Description copied from interface: EditPart
Called to force a refresh of all properties displayed by this EditPart.
Specified by:
refresh in interface EditPart
Overrides:
refresh in class AbstractGraphicalEditPart

refreshChildren

protected void refreshChildren()
Description copied from class: AbstractEditPart
Refreshes the set of Children. This method should not be overridden. AbstractEditPart.createChild(Object) and AbstractEditPart.getModelChildren() should be overridden together.
Overrides:
refreshChildren in class AbstractEditPart

setContents

public void setContents(EditPart editpart)
Sets the contents. The root contains a single child, called it's contents.
Specified by:
setContents in interface RootEditPart

setViewer

public void setViewer(EditPartViewer newViewer)
Sets the viewer.
Specified by:
setViewer in interface RootEditPart
Parameters:
viewer - EditPartViewer.

GEF v2.0