Package org.eclipse.gef.mvc.fx.parts
Class AbstractVisualPart<V extends javafx.scene.Node>
- java.lang.Object
-
- org.eclipse.gef.mvc.fx.parts.AbstractVisualPart<V>
-
- Type Parameters:
V
- The visual node used by thisAbstractVisualPart
.
- All Implemented Interfaces:
IActivatable
,IAdaptable
,IAdaptable.Bound<IViewer>
,IDisposable
,IVisualPart<V>
- Direct Known Subclasses:
AbstractContentPart
,AbstractFeedbackPart
,AbstractHandlePart
,LayeredRootPart
public abstract class AbstractVisualPart<V extends javafx.scene.Node> extends java.lang.Object implements IVisualPart<V>
TheAbstractVisualPart
is an abstract implementation of theIVisualPart
interface.
-
-
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 AbstractVisualPart()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
activate()
Activates thisIVisualPart
(if it is not already active) by setting (and propagating) the new active state first and delegating todoActivate()
afterwards.protected void
activateAdapters()
Activates the adapters registered at thisAbstractVisualPart
.protected void
activateChildren()
Activates the children of thisAbstractVisualPart
.javafx.beans.property.ReadOnlyBooleanProperty
activeProperty()
javafx.beans.property.ReadOnlyObjectProperty<IViewer>
adaptableProperty()
javafx.beans.property.ReadOnlyMapProperty<AdapterKey<?>,java.lang.Object>
adaptersProperty()
void
addChild(IVisualPart<? extends javafx.scene.Node> child)
Adds the given child to the list of this part's children.void
addChild(IVisualPart<? extends javafx.scene.Node> child, int index)
Adds the given child to the list of this part's children at the specified index.void
addChildren(java.util.List<? extends IVisualPart<? extends javafx.scene.Node>> children)
Adds the given children to the list of this part's children.void
addChildren(java.util.List<? extends IVisualPart<? extends javafx.scene.Node>> children, int index)
Adds the given children to the list of this part's children at the specified index.ReadOnlySetMultimapProperty<IVisualPart<? extends javafx.scene.Node>,java.lang.String>
anchoragesUnmodifiableProperty()
Returns a read-only set-multimap property containing this part's anchorages and their corresponding roles.ReadOnlyMultisetProperty<IVisualPart<? extends javafx.scene.Node>>
anchoredsUnmodifiableProperty()
Returns an unmodifiable read-only multiset property representing the anchoreds of thisIVisualPart
.void
attachAnchored(IVisualPart<? extends javafx.scene.Node> anchored)
Used by an anchoredIVisualPart
to establish an anchorage-anchored relationship with this anchorageIVisualPart
.void
attachToAnchorage(IVisualPart<? extends javafx.scene.Node> anchorage)
Attaches the givenIVisualPart
to the given anchorage under the "default" role.void
attachToAnchorage(IVisualPart<? extends javafx.scene.Node> anchorage, java.lang.String role)
Attaches the givenIVisualPart
to the given anchorage under the given role.javafx.beans.property.ReadOnlyListProperty<IVisualPart<? extends javafx.scene.Node>>
childrenUnmodifiableProperty()
Returns an unmodifiable read-only property containing the children of thisIVisualPart
.void
deactivate()
Deactivates thisIVisualPart
(if it is active) by delegating todoDeactivate()
first and setting (and propagating) the new active state afterwards.protected void
deactivateAdapters()
Deactivates the adapters registered at thisAbstractVisualPart
.protected void
deactivateChildren()
Deactivates the children of thisAbstractVisualPart
.void
detachAnchored(IVisualPart<? extends javafx.scene.Node> anchored)
Used by an anchoredIVisualPart
to unestablish an anchorage-anchored relationship with this anchorageIVisualPart
.void
detachFromAnchorage(IVisualPart<? extends javafx.scene.Node> anchorage)
Detaches thisIVisualPart
from the given anchorageIVisualPart
under the 'default' role.void
detachFromAnchorage(IVisualPart<? extends javafx.scene.Node> anchorage, java.lang.String role)
Detaches thisIVisualPart
from the given anchorageIVisualPart
under the given role.protected IViewer
determineViewer(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.void
dispose()
protected void
doActivate()
Activates thisAbstractVisualPart
, which activates its children and adapters.protected void
doAddChildVisual(IVisualPart<? extends javafx.scene.Node> child, int index)
Performs the addition of the child's visual to thisIVisualPart
's visual.protected void
doAttachToAnchorageVisual(IVisualPart<? extends javafx.scene.Node> anchorage, java.lang.String role)
Attaches this part's visual to the visual of the given anchorage.protected abstract V
doCreateVisual()
Creates this part's visual.protected void
doDeactivate()
Deactivates thisAbstractVisualPart
, which deactivates its children and adapters.protected void
doDetachFromAnchorageVisual(IVisualPart<? extends javafx.scene.Node> anchorage, java.lang.String role)
Detaches this part's visual from the visual of the given anchorage.protected abstract void
doRefreshVisual(V visual)
Refreshes this part's visualization based on this part's content.protected void
doRemoveChildVisual(IVisualPart<? extends javafx.scene.Node> child, int index)
Removes the child's visual from thisIVisualPart
's visual.IViewer
getAdaptable()
<T> T
getAdapter(TypeToken<T> key)
<T> T
getAdapter(java.lang.Class<T> classKey)
<T> T
getAdapter(AdapterKey<T> key)
<T> AdapterKey<T>
getAdapterKey(T adapter)
javafx.collections.ObservableMap<AdapterKey<?>,java.lang.Object>
getAdapters()
<T> java.util.Map<AdapterKey<? extends T>,T>
getAdapters(TypeToken<? super T> key)
<T> java.util.Map<AdapterKey<? extends T>,T>
getAdapters(java.lang.Class<? super T> classKey)
ObservableSetMultimap<IVisualPart<? extends javafx.scene.Node>,java.lang.String>
getAnchoragesUnmodifiable()
Returns an unmodifiableObservableSetMultimap
of this part's anchorages and their corresponding roles.ObservableMultiset<IVisualPart<? extends javafx.scene.Node>>
getAnchoredsUnmodifiable()
Returns an unmodifiableObservableMultiset
of this part's anchoreds.java.util.Map<AdapterKey<? extends IBehavior>,IBehavior>
getBehaviors()
Returns aMap
of this part's behaviors and their correspondingAdapterKey
s.javafx.collections.ObservableList<IVisualPart<? extends javafx.scene.Node>>
getChildrenUnmodifiable()
Returns an unmodifiableObservableList
of this part's children.java.util.Map<AdapterKey<? extends org.eclipse.gef.mvc.fx.handlers.IHandler>,org.eclipse.gef.mvc.fx.handlers.IHandler>
getHandlers()
Returns aMap
of this part's handlers and their correspondingAdapterKey
s.IVisualPart<? extends javafx.scene.Node>
getParent()
Returns the parent of this part.java.util.Map<AdapterKey<? extends IPolicy>,IPolicy>
getPolicies()
Returns aMap
of this part's policies and their correspondingAdapterKey
s.IRootPart<? extends javafx.scene.Node>
getRoot()
Returns theIRootPart
.V
getVisual()
Returns this part's visual.boolean
isActive()
boolean
isRefreshVisual()
Returnstrue
if this part is allowed to refresh its visualization based on its content.javafx.beans.property.ReadOnlyObjectProperty<IVisualPart<? extends javafx.scene.Node>>
parentProperty()
Returns a read-only property that refers to the parent of thisIVisualPart
.void
refreshVisual()
Refreshes thisIVisualPart
's visuals.javafx.beans.property.BooleanProperty
refreshVisualProperty()
A boolean property indicating whether thisIVisualPart
should refresh its visuals or not.protected void
register(IViewer viewer)
Called when a link to theIViewer
is obtained.protected void
registerAtVisualPartMap(IViewer viewer, V visual)
Registers this part for the given visual in the visual-part-map of the givenIViewer
.void
removeChild(IVisualPart<? extends javafx.scene.Node> child)
Removes the givenIVisualPart
from the list of this part's children.void
removeChildren(java.util.List<? extends IVisualPart<? extends javafx.scene.Node>> children)
Removes the givenIVisualPart
s from the list of this part's children.void
reorderChild(IVisualPart<? extends javafx.scene.Node> child, int index)
Swaps the givenIVisualPart
with the part at the given index position within this part's list of children.void
setAdaptable(IViewer viewer)
<T> void
setAdapter(TypeToken<T> adapterType, T adapter)
<T> void
setAdapter(TypeToken<T> adapterType, T adapter, java.lang.String role)
<T> void
setAdapter(T adapter)
<T> void
setAdapter(T adapter, java.lang.String role)
void
setParent(IVisualPart<? extends javafx.scene.Node> newParent)
Sets the parentIVisualPart
.void
setRefreshVisual(boolean isRefreshVisual)
Allows to temporarily turnIVisualPart.refreshVisual()
into a no-op operation.protected void
unregister(IViewer viewer)
Called when the link to theIViewer
is lost.protected void
unregisterFromVisualPartMap(IViewer viewer, V visual)
Removes the given visual from the visual-part-map of the given viewer.<T> void
unsetAdapter(T adapter)
-
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.mvc.fx.parts.IVisualPart
getViewer
-
-
-
-
Method Detail
-
activate
public final void activate()
Activates thisIVisualPart
(if it is not already active) by setting (and propagating) the new active state first and delegating todoActivate()
afterwards. During the call todoActivate()
,isActive()
will thus already returntrue
. If theIVisualPart
is already active, this operation will be a no-op.- Specified by:
activate
in interfaceIActivatable
- See Also:
deactivate()
,isActive()
-
activateAdapters
protected void activateAdapters()
Activates the adapters registered at thisAbstractVisualPart
.
-
activateChildren
protected void activateChildren()
Activates the children of thisAbstractVisualPart
.
-
activeProperty
public javafx.beans.property.ReadOnlyBooleanProperty activeProperty()
- Specified by:
activeProperty
in interfaceIActivatable
-
adaptableProperty
public javafx.beans.property.ReadOnlyObjectProperty<IViewer> adaptableProperty()
- Specified by:
adaptableProperty
in interfaceIAdaptable.Bound<V extends javafx.scene.Node>
-
adaptersProperty
public javafx.beans.property.ReadOnlyMapProperty<AdapterKey<?>,java.lang.Object> adaptersProperty()
- Specified by:
adaptersProperty
in interfaceIAdaptable
-
addChild
public void addChild(IVisualPart<? extends javafx.scene.Node> child)
Description copied from interface:IVisualPart
Adds the given child to the list of this part's children.- Specified by:
addChild
in interfaceIVisualPart<V extends javafx.scene.Node>
- Parameters:
child
- TheIVisualPart
which is added to the list of this part's children.
-
addChild
public void addChild(IVisualPart<? extends javafx.scene.Node> child, int index)
Description copied from interface:IVisualPart
Adds the given child to the list of this part's children at the specified index.- Specified by:
addChild
in interfaceIVisualPart<V extends javafx.scene.Node>
- Parameters:
child
- TheIVisualPart
which is added to the list of this part's children.index
- The index at which the givenIVisualPart
is inserted into this part's children list.
-
addChildren
public void addChildren(java.util.List<? extends IVisualPart<? extends javafx.scene.Node>> children)
Description copied from interface:IVisualPart
Adds the given children to the list of this part's children.- Specified by:
addChildren
in interfaceIVisualPart<V extends javafx.scene.Node>
- Parameters:
children
- TheIVisualPart
s which are added to the list of this part's children.
-
addChildren
public void addChildren(java.util.List<? extends IVisualPart<? extends javafx.scene.Node>> children, int index)
Description copied from interface:IVisualPart
Adds the given children to the list of this part's children at the specified index.- Specified by:
addChildren
in interfaceIVisualPart<V extends javafx.scene.Node>
- Parameters:
children
- TheIVisualPart
s which are added to the list of this part's children.index
- The index at which the givenIVisualPart
s are inserted into this part's children list.
-
anchoragesUnmodifiableProperty
public ReadOnlySetMultimapProperty<IVisualPart<? extends javafx.scene.Node>,java.lang.String> anchoragesUnmodifiableProperty()
Description copied from interface:IVisualPart
Returns a read-only set-multimap property containing this part's anchorages and their corresponding roles.- Specified by:
anchoragesUnmodifiableProperty
in interfaceIVisualPart<V extends javafx.scene.Node>
- Returns:
- A read-only set-multimap property named
IVisualPart.ANCHORAGES_PROPERTY
.
-
anchoredsUnmodifiableProperty
public ReadOnlyMultisetProperty<IVisualPart<? extends javafx.scene.Node>> anchoredsUnmodifiableProperty()
Description copied from interface:IVisualPart
Returns an unmodifiable read-only multiset property representing the anchoreds of thisIVisualPart
.- Specified by:
anchoredsUnmodifiableProperty
in interfaceIVisualPart<V extends javafx.scene.Node>
- Returns:
- An unmodifiable read-only multiset property named
IVisualPart.ANCHOREDS_PROPERTY
.
-
attachAnchored
public void attachAnchored(IVisualPart<? extends javafx.scene.Node> anchored)
Description copied from interface:IVisualPart
Used by an anchoredIVisualPart
to establish an anchorage-anchored relationship with this anchorageIVisualPart
.Clients should never call this operation directly but instead add the anchorage to its anchored via the
IVisualPart.attachToAnchorage(IVisualPart)
andIVisualPart.attachToAnchorage(IVisualPart, String)
operations, which will indirectly lead to a call here.- Specified by:
attachAnchored
in interfaceIVisualPart<V extends javafx.scene.Node>
- Parameters:
anchored
- AnIVisualPart
to attach to this anchorageIVisualPart
as anchored.
-
attachToAnchorage
public void attachToAnchorage(IVisualPart<? extends javafx.scene.Node> anchorage)
Description copied from interface:IVisualPart
Attaches the givenIVisualPart
to the given anchorage under the "default" role.- Specified by:
attachToAnchorage
in interfaceIVisualPart<V extends javafx.scene.Node>
- Parameters:
anchorage
- The anchorageIVisualPart
to attach this part to.
-
attachToAnchorage
public void attachToAnchorage(IVisualPart<? extends javafx.scene.Node> anchorage, java.lang.String role)
Description copied from interface:IVisualPart
Attaches the givenIVisualPart
to the given anchorage under the given role.- Specified by:
attachToAnchorage
in interfaceIVisualPart<V extends javafx.scene.Node>
- Parameters:
anchorage
- The anchorageIVisualPart
to attach this part to.role
- The role under which thisIVisualPart
is attached to the given anchorage.null
.
-
childrenUnmodifiableProperty
public javafx.beans.property.ReadOnlyListProperty<IVisualPart<? extends javafx.scene.Node>> childrenUnmodifiableProperty()
Description copied from interface:IVisualPart
Returns an unmodifiable read-only property containing the children of thisIVisualPart
.- Specified by:
childrenUnmodifiableProperty
in interfaceIVisualPart<V extends javafx.scene.Node>
- Returns:
- An unmodifiable read-only property named
IVisualPart.CHILDREN_PROPERTY
. - See Also:
IVisualPart.getChildrenUnmodifiable()
,IVisualPart.addChild(IVisualPart)
,IVisualPart.addChild(IVisualPart, int)
,IVisualPart.addChildren(List)
,IVisualPart.addChildren(List, int)
,IVisualPart.removeChild(IVisualPart)
,IVisualPart.removeChildren(List)
,IVisualPart.reorderChild(IVisualPart, int)
-
deactivate
public final void deactivate()
Deactivates thisIVisualPart
(if it is active) by delegating todoDeactivate()
first and setting (and propagating) the new active state afterwards. During the call todoDeactivate()
,isActive()
will thus still returntrue
. If theIVisualPart
is not active, this operation will be a no-op.- Specified by:
deactivate
in interfaceIActivatable
- See Also:
activate()
,isActive()
-
deactivateAdapters
protected void deactivateAdapters()
Deactivates the adapters registered at thisAbstractVisualPart
.
-
deactivateChildren
protected void deactivateChildren()
Deactivates the children of thisAbstractVisualPart
.
-
detachAnchored
public void detachAnchored(IVisualPart<? extends javafx.scene.Node> anchored)
Description copied from interface:IVisualPart
Used by an anchoredIVisualPart
to unestablish an anchorage-anchored relationship with this anchorageIVisualPart
.Clients should never call this operation directly but instead remove the anchorage from its anchored via the
IVisualPart.detachFromAnchorage(IVisualPart)
orIVisualPart.detachFromAnchorage(IVisualPart, String)
operations, which will indirectly lead to a call here.- Specified by:
detachAnchored
in interfaceIVisualPart<V extends javafx.scene.Node>
- Parameters:
anchored
- AnIVisualPart
(currently attached as anchored to this anchorageIVisualPart
) to detach from this anchorageIVisualPart
as anchored.
-
detachFromAnchorage
public void detachFromAnchorage(IVisualPart<? extends javafx.scene.Node> anchorage)
Description copied from interface:IVisualPart
Detaches thisIVisualPart
from the given anchorageIVisualPart
under the 'default' role.- Specified by:
detachFromAnchorage
in interfaceIVisualPart<V extends javafx.scene.Node>
- Parameters:
anchorage
- The anchorageIVisualPart
to detach this part from.
-
detachFromAnchorage
public void detachFromAnchorage(IVisualPart<? extends javafx.scene.Node> anchorage, java.lang.String role)
Description copied from interface:IVisualPart
Detaches thisIVisualPart
from the given anchorageIVisualPart
under the given role.- Specified by:
detachFromAnchorage
in interfaceIVisualPart<V extends javafx.scene.Node>
- Parameters:
anchorage
- The anchorageIVisualPart
to detach this part from.role
- The role under which theIVisualPart
can be found in this part's anchorages.
-
determineViewer
protected IViewer determineViewer(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.- 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.
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceIDisposable
-
doActivate
protected void doActivate()
Activates thisAbstractVisualPart
, which activates its children and adapters.
-
doAddChildVisual
protected void doAddChildVisual(IVisualPart<? extends javafx.scene.Node> child, int index)
Performs the addition of the child's visual to thisIVisualPart
's visual.- Parameters:
child
- TheIVisualPart
being addedindex
- The child's position- See Also:
addChild(IVisualPart, int)
-
doAttachToAnchorageVisual
protected void doAttachToAnchorageVisual(IVisualPart<? extends javafx.scene.Node> anchorage, java.lang.String role)
Attaches this part's visual to the visual of the given anchorage.- Parameters:
anchorage
- The anchorageIVisualPart
.role
- The anchorage role.
-
doCreateVisual
protected abstract V doCreateVisual()
Creates this part's visual.- Returns:
- This part's visual.
-
doDeactivate
protected void doDeactivate()
Deactivates thisAbstractVisualPart
, which deactivates its children and adapters.
-
doDetachFromAnchorageVisual
protected void doDetachFromAnchorageVisual(IVisualPart<? extends javafx.scene.Node> anchorage, java.lang.String role)
Detaches this part's visual from the visual of the given anchorage.- Parameters:
anchorage
- The anchorageIVisualPart
.role
- The anchorage role.
-
doRefreshVisual
protected abstract void doRefreshVisual(V visual)
Refreshes this part's visualization based on this part's content.- Parameters:
visual
- This part's visual.
-
doRemoveChildVisual
protected void doRemoveChildVisual(IVisualPart<? extends javafx.scene.Node> child, int index)
Removes the child's visual from thisIVisualPart
's visual.- Parameters:
child
- The childIVisualPart
.index
- The index of the child whose visual is to be removed.
-
getAdaptable
public IViewer getAdaptable()
- Specified by:
getAdaptable
in interfaceIAdaptable.Bound<V extends javafx.scene.Node>
-
getAdapter
public <T> T getAdapter(AdapterKey<T> key)
- Specified by:
getAdapter
in interfaceIAdaptable
-
getAdapter
public <T> T getAdapter(java.lang.Class<T> classKey)
- Specified by:
getAdapter
in interfaceIAdaptable
-
getAdapter
public <T> T getAdapter(TypeToken<T> key)
- Specified by:
getAdapter
in interfaceIAdaptable
-
getAdapterKey
public <T> AdapterKey<T> getAdapterKey(T adapter)
- Specified by:
getAdapterKey
in interfaceIAdaptable
-
getAdapters
public javafx.collections.ObservableMap<AdapterKey<?>,java.lang.Object> getAdapters()
- Specified by:
getAdapters
in interfaceIAdaptable
-
getAdapters
public <T> java.util.Map<AdapterKey<? extends T>,T> getAdapters(java.lang.Class<? super T> classKey)
- Specified by:
getAdapters
in interfaceIAdaptable
-
getAdapters
public <T> java.util.Map<AdapterKey<? extends T>,T> getAdapters(TypeToken<? super T> key)
- Specified by:
getAdapters
in interfaceIAdaptable
-
getAnchoragesUnmodifiable
public ObservableSetMultimap<IVisualPart<? extends javafx.scene.Node>,java.lang.String> getAnchoragesUnmodifiable()
Description copied from interface:IVisualPart
Returns an unmodifiableObservableSetMultimap
of this part's anchorages and their corresponding roles.- Specified by:
getAnchoragesUnmodifiable
in interfaceIVisualPart<V extends javafx.scene.Node>
- Returns:
- A
ObservableSetMultimap
of this part's anchorages and their corresponding roles.
-
getAnchoredsUnmodifiable
public ObservableMultiset<IVisualPart<? extends javafx.scene.Node>> getAnchoredsUnmodifiable()
Description copied from interface:IVisualPart
Returns an unmodifiableObservableMultiset
of this part's anchoreds.- Specified by:
getAnchoredsUnmodifiable
in interfaceIVisualPart<V extends javafx.scene.Node>
- Returns:
- An unmodifiable
ObservableMultiset
of this part's anchoreds.
-
getBehaviors
public java.util.Map<AdapterKey<? extends IBehavior>,IBehavior> getBehaviors()
Description copied from interface:IVisualPart
Returns aMap
of this part's behaviors and their correspondingAdapterKey
s.- Specified by:
getBehaviors
in interfaceIVisualPart<V extends javafx.scene.Node>
- Returns:
- A
Map
of this part's behaviors and their correspondingAdapterKey
s.
-
getChildrenUnmodifiable
public javafx.collections.ObservableList<IVisualPart<? extends javafx.scene.Node>> getChildrenUnmodifiable()
Description copied from interface:IVisualPart
Returns an unmodifiableObservableList
of this part's children.- Specified by:
getChildrenUnmodifiable
in interfaceIVisualPart<V extends javafx.scene.Node>
- Returns:
- A
ObservableList
of this part's children.
-
getHandlers
public java.util.Map<AdapterKey<? extends org.eclipse.gef.mvc.fx.handlers.IHandler>,org.eclipse.gef.mvc.fx.handlers.IHandler> getHandlers()
Description copied from interface:IVisualPart
Returns aMap
of this part's handlers and their correspondingAdapterKey
s.- Specified by:
getHandlers
in interfaceIVisualPart<V extends javafx.scene.Node>
- Returns:
- A
Map
of this part's handlers and their correspondingAdapterKey
s.
-
getParent
public IVisualPart<? extends javafx.scene.Node> getParent()
Description copied from interface:IVisualPart
Returns the parent of this part.- Specified by:
getParent
in interfaceIVisualPart<V extends javafx.scene.Node>
- Returns:
- The parent of this part.
-
getPolicies
public java.util.Map<AdapterKey<? extends IPolicy>,IPolicy> getPolicies()
Description copied from interface:IVisualPart
Returns aMap
of this part's policies and their correspondingAdapterKey
s.- Specified by:
getPolicies
in interfaceIVisualPart<V extends javafx.scene.Node>
- Returns:
- A
Map
of this part's policies and their correspondingAdapterKey
s.
-
getRoot
public IRootPart<? extends javafx.scene.Node> getRoot()
Description copied from interface:IVisualPart
Returns 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:
getRoot
in interfaceIVisualPart<V extends javafx.scene.Node>
- Returns:
null
or theIRootPart
-
getVisual
public V getVisual()
Description copied from interface:IVisualPart
Returns this part's visual.- Specified by:
getVisual
in interfaceIVisualPart<V extends javafx.scene.Node>
- Returns:
- This part's visual.
-
isActive
public boolean isActive()
- Specified by:
isActive
in interfaceIActivatable
- Returns:
true
if thisIVisualPart
is active.
-
isRefreshVisual
public boolean isRefreshVisual()
Description copied from interface:IVisualPart
Returnstrue
if this part is allowed to refresh its visualization based on its content. Otherwise returnsfalse
.- Specified by:
isRefreshVisual
in interfaceIVisualPart<V extends javafx.scene.Node>
- Returns:
true
if this part is allowed to refresh its visualization based on its content, otherwisefalse
.
-
parentProperty
public javafx.beans.property.ReadOnlyObjectProperty<IVisualPart<? extends javafx.scene.Node>> parentProperty()
Description copied from interface:IVisualPart
Returns a read-only property that refers to the parent of thisIVisualPart
.- Specified by:
parentProperty
in interfaceIVisualPart<V extends javafx.scene.Node>
- Returns:
- A read-only property named
IVisualPart.PARENT_PROPERTY
. - See Also:
IVisualPart.getParent()
,IVisualPart.setParent(IVisualPart)
-
refreshVisual
public final void refreshVisual()
Refreshes thisIVisualPart
's visuals. Delegates todoRefreshVisual(Node)
in caseisRefreshVisual()
is not set tofalse
.- Specified by:
refreshVisual
in interfaceIVisualPart<V extends javafx.scene.Node>
-
refreshVisualProperty
public javafx.beans.property.BooleanProperty refreshVisualProperty()
Description copied from interface:IVisualPart
A boolean property indicating whether thisIVisualPart
should refresh its visuals or not.- Specified by:
refreshVisualProperty
in interfaceIVisualPart<V extends javafx.scene.Node>
- Returns:
- A boolean property named
IVisualPart.REFRESH_VISUAL_PROPERTY
. - See Also:
IVisualPart.isRefreshVisual()
,IVisualPart.setRefreshVisual(boolean)
-
register
protected void register(IViewer viewer)
Called when a link to theIViewer
is obtained. Registers thisIVisualPart
for its "main" visual (i.e. the one returned bygetVisual()
) at theIViewer.getVisualPartMap()
of the givenIViewer
. To simplify matters, thisIVisualPart
only has to register itself for its "main" visual, i.e. if the "main" visual contains a number of children visuals, it does not need to register itself for those children visuals. Therefore, if the visualization changes dynamically, the registration at the visual-part-map does not need to be updated. Consequently, when looking up anIVisualPart
for a given visual in the visual-part-map, it is required to walk up the visual hierarchy until a registered visual is found.- Parameters:
viewer
- TheIViewer
to register at.
-
registerAtVisualPartMap
protected void registerAtVisualPartMap(IViewer viewer, V visual)
Registers this part for the given visual in the visual-part-map of the givenIViewer
.- Parameters:
viewer
- TheIViewer
of which the visual-part-map is extended.visual
- The visual for which this part is registered in the viewer's visual-part-map.
-
removeChild
public void removeChild(IVisualPart<? extends javafx.scene.Node> child)
Description copied from interface:IVisualPart
Removes the givenIVisualPart
from the list of this part's children.- Specified by:
removeChild
in interfaceIVisualPart<V extends javafx.scene.Node>
- Parameters:
child
- TheIVisualPart
which is removed from the list of this part's children.
-
removeChildren
public void removeChildren(java.util.List<? extends IVisualPart<? extends javafx.scene.Node>> children)
Description copied from interface:IVisualPart
Removes the givenIVisualPart
s from the list of this part's children.- Specified by:
removeChildren
in interfaceIVisualPart<V extends javafx.scene.Node>
- Parameters:
children
- TheIVisualPart
s which are removed from the list of this part's children.
-
reorderChild
public void reorderChild(IVisualPart<? extends javafx.scene.Node> child, int index)
Description copied from interface:IVisualPart
Swaps the givenIVisualPart
with the part at the given index position within this part's list of children.- Specified by:
reorderChild
in interfaceIVisualPart<V extends javafx.scene.Node>
- Parameters:
child
- TheIVisualPart
which is reordered.index
- The index to which the part is reordered.
-
setAdaptable
public void setAdaptable(IViewer viewer)
- Specified by:
setAdaptable
in interfaceIAdaptable.Bound<V extends javafx.scene.Node>
-
setAdapter
public <T> void setAdapter(T adapter)
- Specified by:
setAdapter
in interfaceIAdaptable
-
setAdapter
public <T> void setAdapter(T adapter, java.lang.String role)
- Specified by:
setAdapter
in interfaceIAdaptable
-
setAdapter
public <T> void setAdapter(TypeToken<T> adapterType, T adapter)
- Specified by:
setAdapter
in interfaceIAdaptable
-
setAdapter
@InjectAdapters public <T> void setAdapter(TypeToken<T> adapterType, T adapter, java.lang.String role)
- Specified by:
setAdapter
in interfaceIAdaptable
-
setParent
public void setParent(IVisualPart<? extends javafx.scene.Node> newParent)
Sets the parentIVisualPart
.- Specified by:
setParent
in interfaceIVisualPart<V extends javafx.scene.Node>
- Parameters:
newParent
- The new parentIVisualPart
ornull
.
-
setRefreshVisual
public void setRefreshVisual(boolean isRefreshVisual)
Description copied from interface:IVisualPart
Allows to temporarily turnIVisualPart.refreshVisual()
into a no-op operation. This may for instance be used to disable visual updates that are initiated by the model (in case ofIContentPart
s) while interacting with theIVisualPart
.- Specified by:
setRefreshVisual
in interfaceIVisualPart<V extends javafx.scene.Node>
- Parameters:
isRefreshVisual
- WhetherIVisualPart.refreshVisual()
should perform updates of the visual (true
) or behave like a no-op operation (false
).
-
unregister
protected void unregister(IViewer viewer)
Called when the link to theIViewer
is lost. Unregisters thisIVisualPart
for its "main" visual (i.e. the one returned bygetVisual()
) from theIViewer.getVisualPartMap()
of the givenIViewer
. To simplify matters, thisIVisualPart
only has to unregister itself for its "main" visual, i.e. if the "main" visual contains a number of children visuals, it does not need to unregister itself for those children visuals. Therefore, if the visualization changes dynamically, the registration at the visual-part-map does not need to be updated. Consequently, when looking up anIVisualPart
for a given visual in the visual-part-map, it is required to walk up the visual hierarchy until a registered visual is found.- Parameters:
viewer
- TheIViewer
to unregister from.
-
unregisterFromVisualPartMap
protected void unregisterFromVisualPartMap(IViewer viewer, V visual)
Removes the given visual from the visual-part-map of the given viewer.- Parameters:
viewer
- TheIViewer
of which the visual-part-map is changed.visual
- The visual which is removed from the visual-part-map.
-
unsetAdapter
public <T> void unsetAdapter(T adapter)
- Specified by:
unsetAdapter
in interfaceIAdaptable
-
-