Package org.eclipse.gef.mvc.fx.parts
Class LayeredRootPart
- java.lang.Object
-
- org.eclipse.gef.mvc.fx.parts.AbstractVisualPart<javafx.scene.Group>
-
- org.eclipse.gef.mvc.fx.parts.LayeredRootPart
-
- All Implemented Interfaces:
IActivatable,IAdaptable,IAdaptable.Bound<IViewer>,IDisposable,IRootPart<javafx.scene.Group>,IVisualPart<javafx.scene.Group>
public class LayeredRootPart extends AbstractVisualPart<javafx.scene.Group> implements IRootPart<javafx.scene.Group>
TheLayeredRootPartis anIRootPartthat manages a number of layers for the visualization, namely, the content layer, feedback layer, and handle layer. The visuals of the differentIVisualParts are inserted into these layers depending on their type, i.e.IContentPartvisuals are inserted into the content layer,IFeedbackPartvisuals are inserted into the feedback layer, andIHandlePartvisuals are inserted into the handle layer.The layers are stacked on top of each other with the content layer at the bottom and the handle layer at the top. The feedback layer in the middle is mouse transparent, i.e. you cannot interact with the visuals in this layer.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.gef.common.adapt.IAdaptable
IAdaptable.Bound<A extends IAdaptable>
-
Nested classes/interfaces inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound
IAdaptable.Bound.Impl<T extends IAdaptable>
-
-
Field Summary
-
Fields inherited from interface org.eclipse.gef.common.activate.IActivatable
ACTIVE_PROPERTY
-
Fields inherited from interface org.eclipse.gef.common.adapt.IAdaptable
ADAPTERS_PROPERTY
-
Fields inherited from interface org.eclipse.gef.mvc.fx.parts.IVisualPart
ANCHORAGES_PROPERTY, ANCHOREDS_PROPERTY, CHILDREN_PROPERTY, PARENT_PROPERTY, REFRESH_VISUAL_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description LayeredRootPart()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidactivateChildren()Activates the children of thisAbstractVisualPart.protected javafx.scene.GroupcreateContentLayer()Creates the content layer visual.protected javafx.scene.GroupcreateFeedbackLayer()Creates the feedback layer visual.protected javafx.scene.GroupcreateHandleLayer()Creates the handle layer visual.protected javafx.scene.GroupcreateLayer(boolean mouseTransparent)Creates aGroupand sets itsNode.pickOnBoundsProperty()tofalse.protected voiddeactivateChildren()Deactivates the children of thisAbstractVisualPart.protected IViewerdetermineViewer(IVisualPart<? extends javafx.scene.Node> parent, Multiset<IVisualPart<? extends javafx.scene.Node>> anchoreds)Determines the viewer reference via the given parent or any of the given anchoreds.protected voiddoAddChildVisual(IVisualPart<? extends javafx.scene.Node> child, int index)Performs the addition of the child's visual to thisIVisualPart's visual.protected voiddoAttachToAnchorageVisual(IVisualPart<? extends javafx.scene.Node> anchorage, java.lang.String role)Attaches this part's visual to the visual of the given anchorage.protected javafx.scene.GroupdoCreateVisual()Creates this part's visual.protected voiddoDetachFromAnchorageVisual(IVisualPart<? extends javafx.scene.Node> anchorage, java.lang.String role)Detaches this part's visual from the visual of the given anchorage.protected voiddoRefreshVisual(javafx.scene.Group visual)Refreshes this part's visualization based on this part's content.protected voiddoRemoveChildVisual(IVisualPart<? extends javafx.scene.Node> child, int index)Removes the child's visual from thisIVisualPart's visual.javafx.scene.GroupgetContentLayer()Returns the content layer visual.java.util.List<IContentPart<? extends javafx.scene.Node>>getContentPartChildren()Returns all children of typeIContentPartcontained by thisIRootPart.javafx.scene.GroupgetFeedbackLayer()Returns the feedback layer visual.java.util.List<IFeedbackPart<? extends javafx.scene.Node>>getFeedbackPartChildren()Returns all children of typeIFeedbackPartcontained by thisIRootPart.javafx.scene.GroupgetHandleLayer()Returns the handle layer visual.java.util.List<IHandlePart<? extends javafx.scene.Node>>getHandlePartChildren()Returns all children of typeIHandlePartcontained by thisIRootPart.IRootPart<? extends javafx.scene.Node>getRoot()Returns theIRootPart.-
Methods inherited from class org.eclipse.gef.mvc.fx.parts.AbstractVisualPart
activate, activateAdapters, activeProperty, adaptableProperty, adaptersProperty, addChild, addChild, addChildren, addChildren, anchoragesUnmodifiableProperty, anchoredsUnmodifiableProperty, attachAnchored, attachToAnchorage, attachToAnchorage, childrenUnmodifiableProperty, deactivate, deactivateAdapters, detachAnchored, detachFromAnchorage, detachFromAnchorage, dispose, doActivate, doDeactivate, getAdaptable, getAdapter, getAdapter, getAdapter, getAdapterKey, getAdapters, getAdapters, getAdapters, getAnchoragesUnmodifiable, getAnchoredsUnmodifiable, getBehaviors, getChildrenUnmodifiable, getHandlers, getParent, getPolicies, getVisual, isActive, isRefreshVisual, parentProperty, refreshVisual, refreshVisualProperty, register, registerAtVisualPartMap, removeChild, removeChildren, reorderChild, setAdaptable, setAdapter, setAdapter, setAdapter, setAdapter, setParent, setRefreshVisual, unregister, unregisterFromVisualPartMap, unsetAdapter
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.gef.common.activate.IActivatable
activate, activeProperty, deactivate, isActive
-
Methods inherited from interface org.eclipse.gef.common.adapt.IAdaptable
adaptersProperty, getAdapter, getAdapter, getAdapter, getAdapterKey, getAdapters, getAdapters, getAdapters, setAdapter, setAdapter, setAdapter, setAdapter, unsetAdapter
-
Methods inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound
adaptableProperty, getAdaptable, setAdaptable
-
Methods inherited from interface org.eclipse.gef.common.dispose.IDisposable
dispose
-
Methods inherited from interface org.eclipse.gef.mvc.fx.parts.IVisualPart
addChild, addChild, addChildren, addChildren, anchoragesUnmodifiableProperty, anchoredsUnmodifiableProperty, attachAnchored, attachToAnchorage, attachToAnchorage, childrenUnmodifiableProperty, detachAnchored, detachFromAnchorage, detachFromAnchorage, getAnchoragesUnmodifiable, getAnchoredsUnmodifiable, getBehaviors, getChildrenUnmodifiable, getHandlers, getParent, getPolicies, getViewer, getVisual, isRefreshVisual, parentProperty, refreshVisual, refreshVisualProperty, removeChild, removeChildren, reorderChild, setParent, setRefreshVisual
-
-
-
-
Method Detail
-
activateChildren
protected void activateChildren()
Description copied from class:AbstractVisualPartActivates the children of thisAbstractVisualPart.- Overrides:
activateChildrenin classAbstractVisualPart<javafx.scene.Group>
-
createContentLayer
protected javafx.scene.Group createContentLayer()
Creates the content layer visual.- Returns:
- The content layer visual.
-
createFeedbackLayer
protected javafx.scene.Group createFeedbackLayer()
Creates the feedback layer visual.- Returns:
- The feedback layer visual.
-
createHandleLayer
protected javafx.scene.Group createHandleLayer()
Creates the handle layer visual.- Returns:
- The handle layer visual.
-
createLayer
protected javafx.scene.Group createLayer(boolean mouseTransparent)
Creates aGroupand sets itsNode.pickOnBoundsProperty()tofalse. Does also set itsNode.mouseTransparentProperty()to the given value.- Parameters:
mouseTransparent- The value for the layer'sNode.mouseTransparentProperty().- Returns:
- The created layer.
-
deactivateChildren
protected void deactivateChildren()
Description copied from class:AbstractVisualPartDeactivates the children of thisAbstractVisualPart.- Overrides:
deactivateChildrenin classAbstractVisualPart<javafx.scene.Group>
-
determineViewer
protected IViewer determineViewer(IVisualPart<? extends javafx.scene.Node> parent, Multiset<IVisualPart<? extends javafx.scene.Node>> anchoreds)
Description copied from class:AbstractVisualPartDetermines the viewer reference via the given parent or any of the given anchoreds.- Overrides:
determineViewerin classAbstractVisualPart<javafx.scene.Group>- Parameters:
parent- The parent to obtain the viewer from.anchoreds- The anchoreds to alternatively obtain the viewer from.- Returns:
- The viewer, if it could be determined via the parent or any of the anchoreds.
-
doAddChildVisual
protected void doAddChildVisual(IVisualPart<? extends javafx.scene.Node> child, int index)
Description copied from class:AbstractVisualPartPerforms the addition of the child's visual to thisIVisualPart's visual.- Overrides:
doAddChildVisualin classAbstractVisualPart<javafx.scene.Group>- Parameters:
child- TheIVisualPartbeing addedindex- The child's position- See Also:
AbstractVisualPart.addChild(IVisualPart, int)
-
doAttachToAnchorageVisual
protected void doAttachToAnchorageVisual(IVisualPart<? extends javafx.scene.Node> anchorage, java.lang.String role)
Description copied from class:AbstractVisualPartAttaches this part's visual to the visual of the given anchorage.- Overrides:
doAttachToAnchorageVisualin classAbstractVisualPart<javafx.scene.Group>- Parameters:
anchorage- The anchorageIVisualPart.role- The anchorage role.
-
doCreateVisual
protected javafx.scene.Group doCreateVisual()
Description copied from class:AbstractVisualPartCreates this part's visual.- Specified by:
doCreateVisualin classAbstractVisualPart<javafx.scene.Group>- Returns:
- This part's visual.
-
doDetachFromAnchorageVisual
protected void doDetachFromAnchorageVisual(IVisualPart<? extends javafx.scene.Node> anchorage, java.lang.String role)
Description copied from class:AbstractVisualPartDetaches this part's visual from the visual of the given anchorage.- Overrides:
doDetachFromAnchorageVisualin classAbstractVisualPart<javafx.scene.Group>- Parameters:
anchorage- The anchorageIVisualPart.role- The anchorage role.
-
doRefreshVisual
protected void doRefreshVisual(javafx.scene.Group visual)
Description copied from class:AbstractVisualPartRefreshes this part's visualization based on this part's content.- Specified by:
doRefreshVisualin classAbstractVisualPart<javafx.scene.Group>- Parameters:
visual- This part's visual.
-
doRemoveChildVisual
protected void doRemoveChildVisual(IVisualPart<? extends javafx.scene.Node> child, int index)
Description copied from class:AbstractVisualPartRemoves the child's visual from thisIVisualPart's visual.- Overrides:
doRemoveChildVisualin classAbstractVisualPart<javafx.scene.Group>- Parameters:
child- The childIVisualPart.index- The index of the child whose visual is to be removed.
-
getContentLayer
public javafx.scene.Group getContentLayer()
Returns the content layer visual. The content layer visual is created in case it was not created before.- Returns:
- The content layer visual.
- See Also:
createContentLayer()
-
getContentPartChildren
public java.util.List<IContentPart<? extends javafx.scene.Node>> getContentPartChildren()
Description copied from interface:IRootPartReturns all children of typeIContentPartcontained by thisIRootPart.- Specified by:
getContentPartChildrenin interfaceIRootPart<javafx.scene.Group>- Returns:
- A list containing all
IContentPartchildren.
-
getFeedbackLayer
public javafx.scene.Group getFeedbackLayer()
Returns the feedback layer visual. The feedback layer visual is created in case it was not created before.- Returns:
- The feedback layer visual.
- See Also:
createFeedbackLayer()
-
getFeedbackPartChildren
public java.util.List<IFeedbackPart<? extends javafx.scene.Node>> getFeedbackPartChildren()
Description copied from interface:IRootPartReturns all children of typeIFeedbackPartcontained by thisIRootPart.- Specified by:
getFeedbackPartChildrenin interfaceIRootPart<javafx.scene.Group>- Returns:
- A list containing all
IFeedbackPartchildren.
-
getHandleLayer
public javafx.scene.Group getHandleLayer()
Returns the handle layer visual. The handle layer visual is created in case it was not created before.- Returns:
- The handle layer visual.
- See Also:
createHandleLayer()
-
getHandlePartChildren
public java.util.List<IHandlePart<? extends javafx.scene.Node>> getHandlePartChildren()
Description copied from interface:IRootPartReturns all children of typeIHandlePartcontained by thisIRootPart.- Specified by:
getHandlePartChildrenin interfaceIRootPart<javafx.scene.Group>- Returns:
- A list containing all
IHandlePartchildren.
-
getRoot
public IRootPart<? extends javafx.scene.Node> getRoot()
Description copied from interface:IVisualPartReturns theIRootPart. This method should only be called internally or by helpers such as edit policies. The root can be used to get the viewer.- Specified by:
getRootin interfaceIVisualPart<javafx.scene.Group>- Overrides:
getRootin classAbstractVisualPart<javafx.scene.Group>- Returns:
nullor theIRootPart
-
-