public class ScalableRootEditPart extends SimpleRootEditPart implements LayerConstants, LayerManager
Layers
.
The layers are added to LayeredPane
or
ScalableLayeredPane
. All layers are positioned by
StackLayout
s, which means that the diagrams
preferred size is the union of the preferred size of each layer, and all
layers will be positioned to fill the entire diagram.
IMPORTANTScalableRootEditPart uses a Viewport
as its
primary figure. It must be used with a
ScrollingGraphicalViewer
. The viewport gets
installed into that viewer's FigureCanvas
, which
provides native scrollbars for scrolling the viewport.
The layer structure (top-to-bottom) for this root is:
Root Layered Pane | |||
├ | Guide Layer | ||
├ | Feedback Layer | ||
├ | Handle Layer | ||
└ | Scalable Layers | (ScalableLayeredPane ) |
|
├ | Scaled Feedback Layer | ||
├ | Printable Layers | ||
├ Connection Layer | |||
└ Primary Layer | |||
└ | Grid Layer |
AbstractGraphicalEditPart.AccessibleGraphicalEditPart, AbstractGraphicalEditPart.DefaultAccessibleAnchorProvider
AbstractEditPart.EditPolicyIterator
LayerManager.Helper
figure, sourceConnections, targetConnections
children, FLAG_ACTIVE, FLAG_FOCUS, MAX_FLAG
CONNECTION_LAYER, FEEDBACK_LAYER, GRID_LAYER, GUIDE_LAYER, HANDLE_LAYER, PRIMARY_LAYER, PRINTABLE_LAYERS, SCALABLE_LAYERS, SCALED_FEEDBACK_LAYER
ID
SELECTED, SELECTED_NONE, SELECTED_PRIMARY
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 and Description |
---|
ScalableRootEditPart()
Constructor for ScalableFreeformRootEditPart
|
Modifier and Type | Method and Description |
---|---|
protected IFigure |
createFigure()
The default root figure is a figure with a stack layout.
|
protected GridLayer |
createGridLayer()
Creates a
grid . |
protected void |
createLayers(LayeredPane layeredPane)
Creates the top-most set of layers on the given layered pane
|
protected LayeredPane |
createPrintableLayers()
Creates a layered pane and the layers that should be printed.
|
protected ScalableLayeredPane |
createScaledLayers()
Creates a scalable layered pane and the layers that should be scaled.
|
protected Viewport |
createViewport()
Constructs the viewport that will be used to contain all of the layers.
|
protected ZoomManager |
createZoomManager(ScalableFigure scalableFigure,
Viewport viewport)
Responsible of creating a
ZoomManager to be used by this
ScalableRootEditPart . |
java.lang.Object |
getAdapter(java.lang.Class key)
Extends
AbstractEditPart.getAdapter(Class) to handle additional
adapter types. |
IFigure |
getContentPane()
The contents' Figure will be added to the PRIMARY_LAYER.
|
DragTracker |
getDragTracker(Request req)
Should not be called, but returns a MarqeeDragTracker for good measure.
|
IFigure |
getLayer(java.lang.Object key)
Returns the layer indicated by the key.
|
java.lang.Object |
getModel()
The root editpart does not have a real model.
|
protected LayeredPane |
getPrintableLayers()
Returns the LayeredPane that should be used during printing.
|
protected LayeredPane |
getScaledLayers()
Returns the scalable layers of this EditPart
|
ZoomManager |
getZoomManager()
Returns the zoomManager.
|
protected void |
refreshGridLayer()
Updates the
grid based on properties set on the
graphical viewer :
SnapToGrid.PROPERTY_GRID_VISIBLE ,
SnapToGrid.PROPERTY_GRID_SPACING , and
SnapToGrid.PROPERTY_GRID_ORIGIN . |
protected void |
register()
Registers itself in the viewer's various registries.
|
protected void |
unregister()
Undoes any registration performed by
AbstractEditPart.register() . |
createEditPolicies, getCommand, getContents, getRoot, getViewer, refreshChildren, setContents, setViewer
activate, addChildVisual, addNodeListener, addNotify, addSourceConnection, addTargetConnection, createConnection, createOrFindConnection, deactivate, fireRemovingSourceConnection, fireRemovingTargetConnection, fireSourceConnectionAdded, fireTargetConnectionAdded, getFigure, getModelSourceConnections, getModelTargetConnections, getSourceConnections, getTargetConnections, isSelectable, primAddSourceConnection, primAddTargetConnection, primRemoveSourceConnection, primRemoveTargetConnection, refresh, refreshSourceConnections, refreshTargetConnections, registerVisuals, removeChildVisual, removeNodeListener, removeNotify, removeSourceConnection, removeTargetConnection, reorderChild, reorderSourceConnection, reorderTargetConnection, setFigure, setLayoutConstraint, unregisterVisuals
activateEditPolicies, addChild, addEditPartListener, createChild, deactivateEditPolicies, debug, debugFeedback, eraseSourceFeedback, eraseTargetFeedback, fireActivated, fireChildAdded, fireDeactivated, fireRemovingChild, fireSelectionChanged, getAccessibleEditPart, getChildren, getEditPolicy, getEditPolicyIterator, getEventListeners, getFlag, getModelChildren, getParent, getSelected, getTargetEditPart, hasFocus, installEditPolicy, isActive, performRequest, refreshVisuals, registerAccessibility, registerModel, removeChild, removeEditPartListener, removeEditPolicy, setFlag, setFocus, setModel, setParent, setSelected, showSourceFeedback, showTargetFeedback, toString, understandsRequest, unregisterAccessibility, unregisterModel
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
activate, addEditPartListener, addNotify, deactivate, eraseSourceFeedback, eraseTargetFeedback, getChildren, getEditPolicy, getParent, getSelected, getTargetEditPart, hasFocus, installEditPolicy, isActive, isSelectable, performRequest, refresh, removeEditPartListener, removeEditPolicy, removeNotify, setFocus, setModel, setParent, setSelected, showSourceFeedback, showTargetFeedback, understandsRequest
public ScalableRootEditPart()
protected ZoomManager createZoomManager(ScalableFigure scalableFigure, Viewport viewport)
ZoomManager
to be used by this
ScalableRootEditPart
.ZoomManager
bound to the given
ScalableFigure
and Viewport
.protected IFigure createFigure()
SimpleRootEditPart
createFigure
in class SimpleRootEditPart
AbstractGraphicalEditPart.createFigure()
protected GridLayer createGridLayer()
grid
. Sub-classes can override this method to
customize the appearance of the grid. The grid layer should be the first
layer (i.e., beneath the primary layer) if it is not to cover up parts on
the primary layer. In that case, the primary layer should be transparent
so that the grid is visible.protected void createLayers(LayeredPane layeredPane)
layeredPane
- the parent for the created layersprotected LayeredPane createPrintableLayers()
PrintGraphicalViewerOperation
protected ScalableLayeredPane createScaledLayers()
ScalableLayeredPane
containing the scalable
layersprotected Viewport createViewport()
public java.lang.Object getAdapter(java.lang.Class key)
AbstractGraphicalEditPart
AbstractEditPart.getAdapter(Class)
to handle additional
adapter types. Currently, these types include
AccessibleHandleProvider
and AccessibleAnchorProvider
.
Subclasses should extend this method to support additional
adapter types, or to replace the default provided adapaters.getAdapter
in interface IAdaptable
getAdapter
in class AbstractGraphicalEditPart
IAdaptable.getAdapter(java.lang.Class)
public IFigure getContentPane()
getContentPane
in interface GraphicalEditPart
getContentPane
in class AbstractGraphicalEditPart
GraphicalEditPart.getContentPane()
public DragTracker getDragTracker(Request req)
getDragTracker
in interface EditPart
getDragTracker
in class AbstractGraphicalEditPart
req
- a Request
indicating the context of the dragnull
or a DragTrackerEditPart.getDragTracker(org.eclipse.gef.Request)
public IFigure getLayer(java.lang.Object key)
getLayer
in interface LayerManager
getLayer
in class AbstractGraphicalEditPart
key
- ID of the Layernull
if it doesn't existLayerManager.getLayer(Object)
public java.lang.Object getModel()
getModel
in interface EditPart
getModel
in class AbstractEditPart
null
or the primary model objectEditPart.getModel()
protected LayeredPane getPrintableLayers()
LayerConstants.PRINTABLE_LAYERS
.protected LayeredPane getScaledLayers()
public ZoomManager getZoomManager()
protected void refreshGridLayer()
grid
based on properties set on the
graphical viewer
:
SnapToGrid.PROPERTY_GRID_VISIBLE
,
SnapToGrid.PROPERTY_GRID_SPACING
, and
SnapToGrid.PROPERTY_GRID_ORIGIN
.
This method is invoked initially when the GridLayer is created, and when any of the above-mentioned properties are changed on the viewer.
protected void register()
AbstractEditPart
register
in class AbstractEditPart
AbstractEditPart.register()
protected void unregister()
AbstractEditPart
AbstractEditPart.register()
. The provided
base classes will correctly unregister their visuals.unregister
in class AbstractEditPart
AbstractEditPart.unregister()
Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.