Eclipse GEF
2.1

org.eclipse.gef.editparts
Class GraphicalRootEditPart

java.lang.Object
  |
  +--org.eclipse.gef.editparts.AbstractEditPart
        |
        +--org.eclipse.gef.editparts.AbstractGraphicalEditPart
              |
              +--org.eclipse.gef.editparts.GraphicalRootEditPart
All Implemented Interfaces:
EditPart, GraphicalEditPart, IAdaptable, LayerConstants, LayerManager, RequestConstants, RootEditPart

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.


Nested Class Summary
 
Nested classes inherited from class org.eclipse.gef.editparts.AbstractGraphicalEditPart
AbstractGraphicalEditPart.AccessibleGraphicalEditPart, AbstractGraphicalEditPart.DefaultAccessibleAnchorProvider
 
Nested classes inherited from class org.eclipse.gef.editparts.AbstractEditPart
AbstractEditPart.EditPolicyIterator
 
Nested 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, sourceConnections, targetConnections
 
Fields inherited from class org.eclipse.gef.editparts.AbstractEditPart
children, FLAG_ACTIVE, FLAG_FOCUS, 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, PRINTABLE_LAYERS
 
Fields inherited from interface org.eclipse.gef.editparts.LayerManager
ID
 
Fields inherited from interface org.eclipse.gef.RequestConstants
REQ_ADD, REQ_ALIGN, REQ_ALIGN_CHILDREN, REQ_CONNECTION_END, REQ_CONNECTION_START, REQ_CREATE, REQ_CREATE_BENDPOINT, REQ_DELETE, REQ_DELETE_DEPENDANT, REQ_DIRECT_EDIT, REQ_MOVE, REQ_MOVE_BENDPOINT, REQ_MOVE_CHILDREN, REQ_OPEN, REQ_ORPHAN, REQ_ORPHAN_CHILDREN, REQ_RECONNECT_SOURCE, REQ_RECONNECT_TARGET, REQ_RESIZE, REQ_RESIZE_CHILDREN, REQ_SELECTION, REQ_SELECTION_HOVER
 
Constructor Summary
GraphicalRootEditPart()
           
 
Method Summary
protected  void createEditPolicies()
          Creates the initial EditPolicies and/or reserves slots for dynamic ones.
protected  org.eclipse.draw2d.IFigure createFigure()
          Creates the Figure to be used as this part's visuals.
 Command getCommand(Request req)
          Doesnt provide any command support, returns an un-executable command
 org.eclipse.draw2d.IFigure getContentPane()
          Returns the figure to which childrens' figures will be added.
 EditPart getContents()
          Returns the contents EditPart.
 DragTracker getDragTracker(Request req)
          Return a drag tracker suitable for dragging this.
 org.eclipse.draw2d.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 this EditPart.
protected  void refreshChildren()
          Updates the set of children EditParts so that it is in sync with the model 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, addNodeListener, addSourceConnection, addTargetConnection, createConnection, createOrFindConnection, deactivate, fireRemovingSourceConnection, fireRemovingTargetConnection, fireSourceConnectionAdded, fireTargetConnectionAdded, getAdapter, getFigure, getModelSourceConnections, getModelTargetConnections, getSourceConnections, getTargetConnections, primAddSourceConnection, primAddTargetConnection, primRemoveSourceConnection, primRemoveTargetConnection, refreshSourceConnections, refreshTargetConnections, registerVisuals, removeChildVisual, removeNodeListener, removeNotify, removeSourceConnection, removeTargetConnection, reorderChild, reorderSourceConnection, reorderTargetConnection, setFigure, setLayoutConstraint, unregisterVisuals
 
Methods inherited from class org.eclipse.gef.editparts.AbstractEditPart
activateEditPolicies, addChild, addEditPartListener, addNotify, createChild, deactivateEditPolicies, debug, debugFeedback, eraseSourceFeedback, eraseTargetFeedback, fireActivated, fireChildAdded, fireDeactivated, fireRemovingChild, fireSelectionChanged, getAccessibleEditPart, getChildren, getEditPolicy, getEditPolicyIterator, getEventListeners, getFlag, getModelChildren, getParent, getSelected, getTargetEditPart, hasFocus, installEditPolicy, isActive, isSelectable, performRequest, refreshVisuals, register, registerAccessibility, registerModel, removeChild, removeEditPartListener, removeEditPolicy, setFlag, setFocus, setModel, setParent, setSelected, showSourceFeedback, showTargetFeedback, toString, understandsRequest, unregister, 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, addNotify, deactivate, eraseSourceFeedback, eraseTargetFeedback, getChildren, getEditPolicy, getParent, getSelected, getTargetEditPart, hasFocus, installEditPolicy, isActive, isSelectable, performRequest, removeEditPartListener, removeEditPolicy, removeNotify, 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/or reserves slots for dynamic ones. Should be implemented to install the inital EditPolicies 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.

Specified by:
createEditPolicies in class AbstractEditPart
See Also:
#doInitialize(), EditPart.installEditPolicy(Object, EditPolicy)

createFigure

protected org.eclipse.draw2d.IFigure createFigure()
Description copied from class: AbstractGraphicalEditPart
Creates the Figure to be used as this part's visuals. This is called from AbstractGraphicalEditPart.getFigure() if the figure has not been created.

Specified by:
createFigure in class AbstractGraphicalEditPart
Returns:
a Figure

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
Parameters:
req - describes the Command being requested
Returns:
null or a Command

getContents

public EditPart getContents()
Description copied from interface: RootEditPart
Returns the contents EditPart. A RootEditPart only has a single child, called its contents.

Specified by:
getContents in interface RootEditPart
Returns:
the contents.

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
Parameters:
req - a Request indicating the context of the drag
Returns:
null or a DragTracker

getLayer

public org.eclipse.draw2d.IFigure getLayer(Object key)
Returns the layer for the given key

Specified by:
getLayer in interface LayerManager
Overrides:
getLayer in class AbstractGraphicalEditPart
Parameters:
key - a key identifying the layer * @return the specified layer

getContentPane

public org.eclipse.draw2d.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.

Specified by:
getContentPane in interface GraphicalEditPart
Overrides:
getContentPane in class AbstractGraphicalEditPart
Returns:
the content pane Figure

getModel

public Object getModel()
Returns the model of this EditPart.

Specified by:
getModel in interface EditPart
Overrides:
getModel in class AbstractEditPart
Returns:
the primary model object

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
Returns:
The EditPartViewer

refresh

public void refresh()
Description copied from interface: EditPart
Called to force a refresh of this EditPart. All visuals properties will be updated, as well as structural features like children.

Specified by:
refresh in interface EditPart
Overrides:
refresh in class AbstractGraphicalEditPart
See Also:
EditPart.refresh()

refreshChildren

protected void refreshChildren()
Description copied from class: AbstractEditPart
Updates the set of children EditParts so that it is in sync with the model children. This method is called from AbstractEditPart.refresh(), and may also be called in response to notification from the model.

The update is performed by comparing the exising EditParts with the set of model children returned from AbstractEditPart.getModelChildren(). EditParts whose model no longer exists are removed. New models have their EditParts created. Subclasses should override getModelChildren().

This method should not be overridden.

Overrides:
refreshChildren in class AbstractEditPart
See Also:
AbstractEditPart.getModelChildren()

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
Parameters:
editpart - the contents

setViewer

public void setViewer(EditPartViewer newViewer)
Sets the viewer.

Specified by:
setViewer in interface RootEditPart
Parameters:
newViewer - the EditPartViewer

Eclipse GEF
2.1

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.