Runtime

## org.eclipse.gmf.runtime.diagram.ui.editparts
Class DiagramEditPart

    java.lang.Object
      org.eclipse.gef.editparts.AbstractEditPart
          org.eclipse.gef.editparts.AbstractGraphicalEditPart
              org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart
                  org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart

All Implemented Interfaces:
  EditPart, GraphicalEditPart, IAdaptable, IAdaptableSelection, org.eclipse.gmf.runtime.diagram.ui.internal.editparts.IEditableEditPart, IGraphicalEditPart, org.eclipse.gmf.runtime.diagram.ui.internal.editparts.ISurfaceEditPart, LayerConstants, NotificationListener, RequestConstants

public class DiagramEditPart
extends GraphicalEditPart
implements LayerConstants, org.eclipse.gmf.runtime.diagram.ui.internal.editparts.ISurfaceEditPart

Controller for the diagram

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`

Field Summary

Fields inherited from class org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart
`accessibleEP, elementGuid`

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.LayerConstants
`CONNECTION_LAYER, FEEDBACK_LAYER, GRID_LAYER, GUIDE_LAYER, HANDLE_LAYER, PRIMARY_LAYER, PRINTABLE_LAYERS, SCALABLE_LAYERS, SCALED_FEEDBACK_LAYER`

Fields inherited from interface org.eclipse.gef.EditPart
`SELECTED, SELECTED_NONE, SELECTED_PRIMARY`

Fields inherited from interface org.eclipse.gef.RequestConstants
`REQ_ADD, REQ_ALIGN, REQ_ALIGN_CHILDREN, REQ_CLONE, 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
`DiagramEditPart(View diagramView)` construcotr

Method Summary
`void` `activate()` Registers this editpart to recieve notation and semantic events.
`protected void` `addChildVisual(EditPart childEditPart, int index)` Adds a figure listener to each figure that is added to the diagram so, the the page breaks can be notified of changes.
`protected void` `createDefaultEditPolicies()` Should be overridden to install editpolicies programmatically.
`protected IFigure` `createFigure()`
`java.lang.Object` `getAdapter(java.lang.Class adapter)` Adds the ability to adapt to the edit part's view class.
`java.util.List` `getChildrenAffectingZoom()` gets a list of all children that could affect the zoom capability
`Rectangle` `getChildrenBounds()` Returns the bounds of the `PRINTABLE_LAYERS`
`protected IFigure` `getConnectionLayer()` getter for the connection layer
`java.util.List` `getConnections()` returns all connections owned by this diagram, the returned list is a list of `ConnectionEditPart`s
`Diagram` `getDiagramView()` Convenience method returning the editpart's parimary view.
`DragTracker` `getDragTracker(Request req)`
`IFigure` `getLayer(java.lang.Object layer)`
`java.util.List` `getPrimaryEditParts()` Gets the primary editparts on this surface, that is, the top-level shapes and connectors.
`Scrollable` `getScrollableControl()` Return the Scrollable Control of this edit part's Viewer
`Viewport` `getViewport()` getter for this Edit Part's figure `Viewport`
`boolean` `isActivatingDiagram()` checks if the Diagram is still in the process of activating it self
`boolean` `isSupportingViewActions()` Returns true if the surface edit part is to support the view actions.
`void` `refreshPageBreaks()` Refreshes the page breaks.
`void` `setIsSupportingViewActions(boolean supportsViewActions)` Setter for isSupportingViewActions
`protected void` `updatePageBreaksLocation()` Updates the Viewer's preference store page breaks location.

Methods inherited from class org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart

`addChild, addListenerFilter, addListenerFilter, addNotationalListeners, addSemanticListeners, basicGetModel, createConnection, createEditPolicies, deactivate, disableEditMode, enableEditMode, eraseSourceFeedback, eraseTargetFeedback, executeCommand, findEditPart, getAccessibleEditPart, getChildBySemanticHint, getChildBySemanticHintOnPrimaryView, getChildViewBySemanticHint, getCommand, getContentPaneFor, getDiagramEditDomain, getDiagramPreferencesHint, getEditDomain, getEditingDomain, getMapMode, getModel, getModelChildren, getNotationView, getPreferredValue, getPrimaryChildEditPart, getPrimaryView, getResourceManager, getRoot, getStructuralFeatureValue, getTopGraphicEditPart, handleMajorSemanticChange, handleNotificationEvent, hasNotationView, isCanonical, isEditModeEnabled, isSelectable, notifyChanged, performDirectEditRequest, performRequest, reactivateSemanticModel, refresh, refreshBackgroundColor, refreshChild, refreshFont, refreshFontColor, refreshForegroundColor, refreshSourceConnection, refreshTargetConnection, refreshVisibility, refreshVisuals, registerModel, removeListenerFilter, removeNotationalListeners, removeNotify, removeSemanticListeners, resolveSemanticElement, setBackgroundColor, setFont, setFontColor, setForegroundColor, setModel, setStructuralFeatureValue, setVisibility, showSourceFeedback, showTargetFeedback, transactionAboutToCommit, unregisterModel`

Methods inherited from class org.eclipse.gef.editparts.AbstractGraphicalEditPart

`addNodeListener, addNotify, addSourceConnection, addTargetConnection, createOrFindConnection, fireRemovingSourceConnection, fireRemovingTargetConnection, fireSourceConnectionAdded, fireTargetConnectionAdded, getContentPane, getFigure, getModelSourceConnections, getModelTargetConnections, getSourceConnections, getTargetConnections, primAddSourceConnection, primAddTargetConnection, primRemoveSourceConnection, primRemoveTargetConnection, refreshSourceConnections, refreshTargetConnections, registerVisuals, removeChildVisual, removeNodeListener, removeSourceConnection, removeTargetConnection, reorderChild, reorderSourceConnection, reorderTargetConnection, setFigure, setLayoutConstraint, unregisterVisuals`

Methods inherited from class org.eclipse.gef.editparts.AbstractEditPart

`activateEditPolicies, addEditPartListener, createChild, deactivateEditPolicies, debug, debugFeedback, fireActivated, fireChildAdded, fireDeactivated, fireRemovingChild, fireSelectionChanged, getChildren, getEditPolicy, getEditPolicyIterator, getEventListeners, getFlag, getParent, getSelected, getTargetEditPart, getViewer, hasFocus, installEditPolicy, isActive, refreshChildren, register, registerAccessibility, removeChild, removeEditPartListener, removeEditPolicy, setFlag, setFocus, setParent, setSelected, toString, understandsRequest, unregister, unregisterAccessibility`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface org.eclipse.gef.GraphicalEditPart
`addNodeListener, getContentPane, getFigure, getSourceConnections, getTargetConnections, removeNodeListener, setLayoutConstraint`

Methods inherited from interface org.eclipse.gef.EditPart
`addEditPartListener, addNotify, getChildren, getEditPolicy, getParent, getSelected, getTargetEditPart, getViewer, hasFocus, installEditPolicy, isActive, removeEditPartListener, removeEditPolicy, setFocus, setParent, setSelected, understandsRequest`

Constructor Detail

### DiagramEditPart

    public DiagramEditPart(View diagramView)

  construcotr

Parameters:
  `diagramView` - the view controlled by this edit part

Method Detail

### createDefaultEditPolicies

    protected void createDefaultEditPolicies()

  Description copied from class: `GraphicalEditPart`
  Should be overridden to install editpolicies programmatically.

  Overrides:
    `createDefaultEditPolicies` in class `GraphicalEditPart`
  See Also:
    `AbstractEditPart.createEditPolicies()`

### createFigure

    protected IFigure createFigure()

  Overrides:
    `createFigure` in class `GraphicalEditPart`

### getDiagramView

    public Diagram getDiagramView()

  Description copied from class: `GraphicalEditPart`
  Convenience method returning the editpart's parimary view.

  Overrides:
    `getDiagramView` in class `GraphicalEditPart`
  Returns:
    the diagram

### getDragTracker

    public DragTracker getDragTracker(Request req)

  Specified by:
    `getDragTracker` in interface `EditPart`
  Overrides:
    `getDragTracker` in class `GraphicalEditPart`
  See Also:
    `EditPart.getDragTracker(org.eclipse.gef.Request)`

### getLayer

    public IFigure getLayer(java.lang.Object layer)

### getScrollableControl

    public Scrollable getScrollableControl()

  Return the Scrollable Control of this edit part's Viewer

  Returns:
    `Scrollable`

### getViewport

    public Viewport getViewport()

  getter for this Edit Part's figure `Viewport`

  Returns:
    the view port

### getConnectionLayer

    protected IFigure getConnectionLayer()

  getter for the connection layer

  Returns:
    the connection layer

### getConnections

    public java.util.List getConnections()

  returns all connections owned by this diagram, the returned list is a list of `ConnectionEditPart`s

  Returns:
    list of `ConnectionEditPart`s

### getPrimaryEditParts

    public java.util.List getPrimaryEditParts()

  Description copied from interface: `org.eclipse.gmf.runtime.diagram.ui.internal.editparts.ISurfaceEditPart`
  Gets the primary editparts on this surface, that is, the top-level shapes and connectors.

  Specified by:
    `getPrimaryEditParts` in interface `org.eclipse.gmf.runtime.diagram.ui.internal.editparts.ISurfaceEditPart`
  Returns:
    List of primary edit parts. If there are none then it returns a Collections.EMPTY_LIST, which is immutable

### addChildVisual

    protected void addChildVisual(EditPart childEditPart,
                                  int index)

  Adds a figure listener to each figure that is added to the diagram so, the the page breaks can be notified of changes.

  See Also:
    `AbstractEditPart.addChildVisual(EditPart, int)`

### updatePageBreaksLocation

    protected void updatePageBreaksLocation()

  Updates the Viewer's preference store page breaks location.

### getChildrenBounds

    public Rectangle getChildrenBounds()

  Returns the bounds of the `PRINTABLE_LAYERS`

  Returns:
    rectangle bounds of the diagram's children

### getAdapter

    public java.lang.Object getAdapter(java.lang.Class adapter)

  Description copied from class: `GraphicalEditPart`
  Adds the ability to adapt to the edit part's view class.

  Specified by:
    `getAdapter` in interface `IAdaptable`
  Overrides:
    `getAdapter` in class `GraphicalEditPart`

### getChildrenAffectingZoom

    public java.util.List getChildrenAffectingZoom()

  gets a list of all children that could affect the zoom capability

  Returns:
    list of `View`s

### refreshPageBreaks

    public void refreshPageBreaks()

  Refreshes the page breaks.

### isSupportingViewActions

    public boolean isSupportingViewActions()

  Description copied from interface: `org.eclipse.gmf.runtime.diagram.ui.internal.editparts.ISurfaceEditPart`
  Returns true if the surface edit part is to support the view actions. False otherwise.

  Specified by:
    `isSupportingViewActions` in interface `org.eclipse.gmf.runtime.diagram.ui.internal.editparts.ISurfaceEditPart`
  Returns:
    boolean isSupportingViewActions

### setIsSupportingViewActions

    public void setIsSupportingViewActions(boolean supportsViewActions)

  Description copied from interface: `org.eclipse.gmf.runtime.diagram.ui.internal.editparts.ISurfaceEditPart`
  Setter for isSupportingViewActions

  Specified by:
    `setIsSupportingViewActions` in interface `org.eclipse.gmf.runtime.diagram.ui.internal.editparts.ISurfaceEditPart`

### isActivatingDiagram

    public boolean isActivatingDiagram()

  checks if the Diagram is still in the process of activating it self

  Returns:
    true if activating; false if the activation process is finished

### activate

    public void activate()

  Description copied from class: `GraphicalEditPart`
  Registers this editpart to recieve notation and semantic events.

  Specified by:
    `activate` in interface `EditPart`
  Overrides:
    `activate` in class `GraphicalEditPart`

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.