public class LayeredRootPart extends AbstractVisualPart<Group> implements IRootPart<Group>
LayeredRootPart
is an IRootPart
that manages a number of
layers for the visualization, namely, the content layer, feedback layer, and
handle layer. The visuals of the different IVisualPart
s are inserted
into these layers depending on their type, i.e. IContentPart
visuals
are inserted into the content layer, IFeedbackPart
visuals are
inserted into the feedback layer, and IHandlePart
visuals 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.
active, adaptable, adapters, anchoragesUnmodifiable, anchoredsUnmodifiable, childrenUnmodifiable, parent, refreshVisual
anchoragesUnmodifiable, anchoredsUnmodifiable, childrenUnmodifiable, parent, refreshVisual
adapters
adaptable
active
IAdaptable.Bound<A extends IAdaptable>
IAdaptable.Bound.Impl<T extends IAdaptable>
ANCHORAGES_PROPERTY, ANCHOREDS_PROPERTY, CHILDREN_PROPERTY, PARENT_PROPERTY, REFRESH_VISUAL_PROPERTY
ADAPTERS_PROPERTY
ACTIVE_PROPERTY
Constructor and Description |
---|
LayeredRootPart()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
activateChildren()
Activates the children of this
AbstractVisualPart . |
protected Group |
createContentLayer()
Creates the content layer visual.
|
protected Group |
createFeedbackLayer()
Creates the feedback layer visual.
|
protected Group |
createHandleLayer()
Creates the handle layer visual.
|
protected Group |
createLayer(boolean mouseTransparent)
|
protected void |
deactivateChildren()
Deactivates the children of this
AbstractVisualPart . |
protected IViewer |
determineViewer(IVisualPart<? extends Node> parent,
com.google.common.collect.Multiset<IVisualPart<? extends Node>> anchoreds)
Determines the viewer reference via the given parent or any of the given
anchoreds.
|
protected void |
doAddChildVisual(IVisualPart<? extends Node> child,
int index)
Performs the addition of the child's visual to this
IVisualPart 's visual. |
protected void |
doAttachToAnchorageVisual(IVisualPart<? extends Node> anchorage,
String role)
Attaches this part's visual to the visual of the given anchorage.
|
protected Group |
doCreateVisual()
Creates this part's visual.
|
protected void |
doDetachFromAnchorageVisual(IVisualPart<? extends Node> anchorage,
String role)
Detaches this part's visual from the visual of the given anchorage.
|
protected void |
doRefreshVisual(Group visual)
Refreshes this part's visualization based on this part's content.
|
protected void |
doRemoveChildVisual(IVisualPart<? extends Node> child,
int index)
Removes the child's visual from this
IVisualPart 's visual. |
Group |
getContentLayer()
Returns the content layer visual.
|
List<IContentPart<? extends Node>> |
getContentPartChildren()
Returns all children of type
IContentPart contained by this
IRootPart . |
Group |
getFeedbackLayer()
Returns the feedback layer visual.
|
List<IFeedbackPart<? extends Node>> |
getFeedbackPartChildren()
Returns all children of type
IFeedbackPart contained by this
IRootPart . |
Group |
getHandleLayer()
Returns the handle layer visual.
|
List<IHandlePart<? extends Node>> |
getHandlePartChildren()
Returns all children of type
IHandlePart contained by this
IRootPart . |
IRootPart<? extends Node> |
getRoot()
Returns the
IRootPart . |
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
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
adaptersProperty, getAdapter, getAdapter, getAdapter, getAdapterKey, getAdapters, getAdapters, getAdapters, setAdapter, setAdapter, setAdapter, setAdapter, unsetAdapter
adaptableProperty, getAdaptable, setAdaptable
activate, activeProperty, deactivate, isActive
dispose
protected void activateChildren()
AbstractVisualPart
AbstractVisualPart
.activateChildren
in class AbstractVisualPart<Group>
protected Group createContentLayer()
protected Group createFeedbackLayer()
protected Group createHandleLayer()
protected Group createLayer(boolean mouseTransparent)
Group
and sets its Node.pickOnBoundsProperty()
to false
. Does also set its
Node.mouseTransparentProperty()
to the given value.mouseTransparent
- The value for the layer's
Node.mouseTransparentProperty()
.protected void deactivateChildren()
AbstractVisualPart
AbstractVisualPart
.deactivateChildren
in class AbstractVisualPart<Group>
protected IViewer determineViewer(IVisualPart<? extends Node> parent, com.google.common.collect.Multiset<IVisualPart<? extends Node>> anchoreds)
AbstractVisualPart
determineViewer
in class AbstractVisualPart<Group>
parent
- The parent to obtain the viewer from.anchoreds
- The anchoreds to alternatively obtain the viewer from.protected void doAddChildVisual(IVisualPart<? extends Node> child, int index)
AbstractVisualPart
IVisualPart
's visual.doAddChildVisual
in class AbstractVisualPart<Group>
child
- The IVisualPart
being addedindex
- The child's positionAbstractVisualPart.addChild(IVisualPart, int)
protected void doAttachToAnchorageVisual(IVisualPart<? extends Node> anchorage, String role)
AbstractVisualPart
doAttachToAnchorageVisual
in class AbstractVisualPart<Group>
anchorage
- The anchorage IVisualPart
.role
- The anchorage role.protected Group doCreateVisual()
AbstractVisualPart
doCreateVisual
in class AbstractVisualPart<Group>
protected void doDetachFromAnchorageVisual(IVisualPart<? extends Node> anchorage, String role)
AbstractVisualPart
doDetachFromAnchorageVisual
in class AbstractVisualPart<Group>
anchorage
- The anchorage IVisualPart
.role
- The anchorage role.protected void doRefreshVisual(Group visual)
AbstractVisualPart
doRefreshVisual
in class AbstractVisualPart<Group>
visual
- This part's visual.protected void doRemoveChildVisual(IVisualPart<? extends Node> child, int index)
AbstractVisualPart
IVisualPart
's visual.doRemoveChildVisual
in class AbstractVisualPart<Group>
child
- The child IVisualPart
.index
- The index of the child whose visual is to be removed.public Group getContentLayer()
createContentLayer()
public List<IContentPart<? extends Node>> getContentPartChildren()
IRootPart
IContentPart
contained by this
IRootPart
.getContentPartChildren
in interface IRootPart<Group>
IContentPart
children.public Group getFeedbackLayer()
createFeedbackLayer()
public List<IFeedbackPart<? extends Node>> getFeedbackPartChildren()
IRootPart
IFeedbackPart
contained by this
IRootPart
.getFeedbackPartChildren
in interface IRootPart<Group>
IFeedbackPart
children.public Group getHandleLayer()
createHandleLayer()
public List<IHandlePart<? extends Node>> getHandlePartChildren()
IRootPart
IHandlePart
contained by this
IRootPart
.getHandlePartChildren
in interface IRootPart<Group>
IHandlePart
children.public IRootPart<? extends Node> getRoot()
IVisualPart
IRootPart
. This method should only be called
internally or by helpers such as edit policies. The root can be used to
get the viewer.getRoot
in interface IVisualPart<Group>
getRoot
in class AbstractVisualPart<Group>
null
or the IRootPart
Copyright (c) 2014, 2016 itemis AG and others. All rights reserved.