Interface IVisualPart<V extends javafx.scene.Node>
-
- Type Parameters:
V
- The visual node used by thisIVisualPart
.
- All Superinterfaces:
IActivatable
,IAdaptable
,IAdaptable.Bound<IViewer>
,IDisposable
- All Known Subinterfaces:
IBendableContentPart<V>
,IContentPart<V>
,IFeedbackPart<V>
,IHandlePart<V>
,IResizableContentPart<V>
,IRootPart<V>
,ITransformableContentPart<V>
- All Known Implementing Classes:
AbstractContentPart
,AbstractFeedbackPart
,AbstractHandlePart
,AbstractSegmentHandlePart
,AbstractVisualPart
,CircleSegmentHandlePart
,FocusFeedbackPart
,HoverFeedbackPart
,LayeredRootPart
,RectangleSegmentHandlePart
,SelectionFeedbackPart
,SelectionLinkFeedbackPart
,SnappingFeedbackPart
,SquareSegmentHandlePart
public interface IVisualPart<V extends javafx.scene.Node> extends IAdaptable, IAdaptable.Bound<IViewer>, IActivatable, IDisposable
AnIVisualPart
plays the controller role in the model-view-controller architecture. While it does not have to be bound to a model (actually onlyIContentPart
s are bound to model elements,IFeedbackPart
s andIHandlePart
s do not refer to model elements), anIVisualPart
always controls a visual.Within an
IViewer
,IVisualPart
are organized in a hierarchy via a[1:n]
parent-children relationship (getParent()
,getChildrenUnmodifiable()
), which roots in anIRootPart
. Furthermore a[n:m]
anchorage-anchored relationship (getAnchoragesUnmodifiable()
,getAnchoredsUnmodifiable()
) may be established betweenIVisualPart
s located at arbitrary places within the hierarchy.An
IVisualPart
is adaptable (IAdaptable
). Usually,IPolicy
s andIBehavior
s are adapted to it (but arbitrary adapters may indeed be registered as needed).IPolicy
s are usually required in case theIVisualPart
is directly involved in user interaction (e.g. the user clicks on its controlled visual). They may be accessed type-safe byIGesture
s or otherIPolicy
s (IPolicy
s may delegate to otherIPolicy
s)).IBehavior
s are used to react to changes of the attached model (in case of anIContentPart
s), the viewer models, or others sources (e.g. adapters of theIViewer
orIDomain
), thereby reacting to changes of the interactive state.IVisualPart
s areIActivatable
activatable, and an activation/deactivation of anIVisualPart
will result in the activation/deactivation of all registered adapters (i.e.IPolicy
s andIBehavior
s).An
IVisualPart
is responsible for registering itself for its visualization at theIViewer.getVisualPartMap()
when it obtains a link to theIViewer
. Equally, anIVisualPart
is responsible for unregistering itself for its visualization from theIViewer.getVisualPartMap()
when it loses a link to theIViewer
.- Noimplement:
- This interface is not intended to be implemented by clients.
Instead,
AbstractVisualPart
should be subclassed.
-
-
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 Modifier and Type Field Description static java.lang.String
ANCHORAGES_PROPERTY
Name of the property storing this part's anchorages.static java.lang.String
ANCHOREDS_PROPERTY
Name of the property storing this part's anchoreds.static java.lang.String
CHILDREN_PROPERTY
Name of the property storing this part's children.static java.lang.String
PARENT_PROPERTY
Name of the property storing this part's parent.static java.lang.String
REFRESH_VISUAL_PROPERTY
Name of the property storing the refresh visual boolean property.-
Fields inherited from interface org.eclipse.gef.common.activate.IActivatable
ACTIVE_PROPERTY
-
Fields inherited from interface org.eclipse.gef.common.adapt.IAdaptable
ADAPTERS_PROPERTY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description 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
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.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
.default IViewer
getViewer()
Returns theIViewer
thisIVisualPart
is bound to.V
getVisual()
Returns this part's visual.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 this part's visualization based on this part's content.javafx.beans.property.BooleanProperty
refreshVisualProperty()
A boolean property indicating whether thisIVisualPart
should refresh its visuals or not.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
setParent(IVisualPart<? extends javafx.scene.Node> parent)
Used by a parentIVisualPart
to establish/unestablish a parent-child relationship with this childIVisualPart
.void
setRefreshVisual(boolean refreshVisual)
Allows to temporarily turnrefreshVisual()
into a no-op operation.-
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
-
-
-
-
Field Detail
-
PARENT_PROPERTY
static final java.lang.String PARENT_PROPERTY
Name of the property storing this part's parent.- See Also:
- Constant Field Values
-
CHILDREN_PROPERTY
static final java.lang.String CHILDREN_PROPERTY
Name of the property storing this part's children.- See Also:
- Constant Field Values
-
ANCHORAGES_PROPERTY
static final java.lang.String ANCHORAGES_PROPERTY
Name of the property storing this part's anchorages.- See Also:
- Constant Field Values
-
ANCHOREDS_PROPERTY
static final java.lang.String ANCHOREDS_PROPERTY
Name of the property storing this part's anchoreds.- See Also:
- Constant Field Values
-
REFRESH_VISUAL_PROPERTY
static final java.lang.String REFRESH_VISUAL_PROPERTY
Name of the property storing the refresh visual boolean property.- See Also:
- Constant Field Values
-
-
Method Detail
-
addChild
void addChild(IVisualPart<? extends javafx.scene.Node> child)
Adds the given child to the list of this part's children.- Parameters:
child
- TheIVisualPart
which is added to the list of this part's children.
-
addChild
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.- 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
void addChildren(java.util.List<? extends IVisualPart<? extends javafx.scene.Node>> children)
Adds the given children to the list of this part's children.- Parameters:
children
- TheIVisualPart
s which are added to the list of this part's children.
-
addChildren
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.- 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
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.- Returns:
- A read-only set-multimap property named
ANCHORAGES_PROPERTY
.
-
anchoredsUnmodifiableProperty
ReadOnlyMultisetProperty<IVisualPart<? extends javafx.scene.Node>> anchoredsUnmodifiableProperty()
Returns an unmodifiable read-only multiset property representing the anchoreds of thisIVisualPart
.- Returns:
- An unmodifiable read-only multiset property named
ANCHOREDS_PROPERTY
.
-
attachAnchored
void attachAnchored(IVisualPart<? extends javafx.scene.Node> anchored)
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
attachToAnchorage(IVisualPart)
andattachToAnchorage(IVisualPart, String)
operations, which will indirectly lead to a call here.- Parameters:
anchored
- AnIVisualPart
to attach to this anchorageIVisualPart
as anchored.- Noreference:
- Clients should call
attachToAnchorage(IVisualPart)
,attachToAnchorage(IVisualPart, String)
instead to establish an anchored-anchorage relationship.
-
attachToAnchorage
void attachToAnchorage(IVisualPart<? extends javafx.scene.Node> anchorage)
Attaches the givenIVisualPart
to the given anchorage under the "default" role.- Parameters:
anchorage
- The anchorageIVisualPart
to attach this part to.
-
attachToAnchorage
void attachToAnchorage(IVisualPart<? extends javafx.scene.Node> anchorage, java.lang.String role)
Attaches the givenIVisualPart
to the given anchorage under the given role.- Parameters:
anchorage
- The anchorageIVisualPart
to attach this part to.role
- The role under which thisIVisualPart
is attached to the given anchorage.null
.
-
childrenUnmodifiableProperty
javafx.beans.property.ReadOnlyListProperty<IVisualPart<? extends javafx.scene.Node>> childrenUnmodifiableProperty()
Returns an unmodifiable read-only property containing the children of thisIVisualPart
.- Returns:
- An unmodifiable read-only property named
CHILDREN_PROPERTY
. - See Also:
getChildrenUnmodifiable()
,addChild(IVisualPart)
,addChild(IVisualPart, int)
,addChildren(List)
,addChildren(List, int)
,removeChild(IVisualPart)
,removeChildren(List)
,reorderChild(IVisualPart, int)
-
detachAnchored
void detachAnchored(IVisualPart<? extends javafx.scene.Node> anchored)
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
detachFromAnchorage(IVisualPart)
ordetachFromAnchorage(IVisualPart, String)
operations, which will indirectly lead to a call here.- Parameters:
anchored
- AnIVisualPart
(currently attached as anchored to this anchorageIVisualPart
) to detach from this anchorageIVisualPart
as anchored.- Noreference:
- Clients should call
detachFromAnchorage(IVisualPart)
ordetachFromAnchorage(IVisualPart, String)
instead to unestablish an anchored-anchorage relationship.
-
detachFromAnchorage
void detachFromAnchorage(IVisualPart<? extends javafx.scene.Node> anchorage)
Detaches thisIVisualPart
from the given anchorageIVisualPart
under the 'default' role.- Parameters:
anchorage
- The anchorageIVisualPart
to detach this part from.
-
detachFromAnchorage
void detachFromAnchorage(IVisualPart<? extends javafx.scene.Node> anchorage, java.lang.String role)
Detaches thisIVisualPart
from the given anchorageIVisualPart
under the given role.- Parameters:
anchorage
- The anchorageIVisualPart
to detach this part from.role
- The role under which theIVisualPart
can be found in this part's anchorages.
-
getAnchoragesUnmodifiable
ObservableSetMultimap<IVisualPart<? extends javafx.scene.Node>,java.lang.String> getAnchoragesUnmodifiable()
Returns an unmodifiableObservableSetMultimap
of this part's anchorages and their corresponding roles.- Returns:
- A
ObservableSetMultimap
of this part's anchorages and their corresponding roles.
-
getAnchoredsUnmodifiable
ObservableMultiset<IVisualPart<? extends javafx.scene.Node>> getAnchoredsUnmodifiable()
Returns an unmodifiableObservableMultiset
of this part's anchoreds.- Returns:
- An unmodifiable
ObservableMultiset
of this part's anchoreds.
-
getBehaviors
java.util.Map<AdapterKey<? extends IBehavior>,IBehavior> getBehaviors()
Returns aMap
of this part's behaviors and their correspondingAdapterKey
s.- Returns:
- A
Map
of this part's behaviors and their correspondingAdapterKey
s.
-
getChildrenUnmodifiable
javafx.collections.ObservableList<IVisualPart<? extends javafx.scene.Node>> getChildrenUnmodifiable()
Returns an unmodifiableObservableList
of this part's children.- Returns:
- A
ObservableList
of this part's children.
-
getHandlers
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.- Returns:
- A
Map
of this part's handlers and their correspondingAdapterKey
s.
-
getParent
IVisualPart<? extends javafx.scene.Node> getParent()
Returns the parent of this part.- Returns:
- The parent of this part.
-
getPolicies
java.util.Map<AdapterKey<? extends IPolicy>,IPolicy> getPolicies()
Returns aMap
of this part's policies and their correspondingAdapterKey
s.- Returns:
- A
Map
of this part's policies and their correspondingAdapterKey
s.
-
getRoot
IRootPart<? extends javafx.scene.Node> getRoot()
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.- Returns:
null
or theIRootPart
-
getViewer
default IViewer getViewer()
Returns theIViewer
thisIVisualPart
is bound to.- Returns:
- The
IViewer
thisIVisualPart
is attached to.
-
getVisual
V getVisual()
Returns this part's visual.- Returns:
- This part's visual.
-
isRefreshVisual
boolean isRefreshVisual()
Returnstrue
if this part is allowed to refresh its visualization based on its content. Otherwise returnsfalse
.- Returns:
true
if this part is allowed to refresh its visualization based on its content, otherwisefalse
.
-
parentProperty
javafx.beans.property.ReadOnlyObjectProperty<IVisualPart<? extends javafx.scene.Node>> parentProperty()
Returns a read-only property that refers to the parent of thisIVisualPart
.- Returns:
- A read-only property named
PARENT_PROPERTY
. - See Also:
getParent()
,setParent(IVisualPart)
-
refreshVisual
void refreshVisual()
Refreshes this part's visualization based on this part's content.
-
refreshVisualProperty
javafx.beans.property.BooleanProperty refreshVisualProperty()
A boolean property indicating whether thisIVisualPart
should refresh its visuals or not.- Returns:
- A boolean property named
REFRESH_VISUAL_PROPERTY
. - See Also:
isRefreshVisual()
,setRefreshVisual(boolean)
-
removeChild
void removeChild(IVisualPart<? extends javafx.scene.Node> child)
Removes the givenIVisualPart
from the list of this part's children.- Parameters:
child
- TheIVisualPart
which is removed from the list of this part's children.
-
removeChildren
void removeChildren(java.util.List<? extends IVisualPart<? extends javafx.scene.Node>> children)
Removes the givenIVisualPart
s from the list of this part's children.- Parameters:
children
- TheIVisualPart
s which are removed from the list of this part's children.
-
reorderChild
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.- Parameters:
child
- TheIVisualPart
which is reordered.index
- The index to which the part is reordered.
-
setParent
void setParent(IVisualPart<? extends javafx.scene.Node> parent)
Used by a parentIVisualPart
to establish/unestablish a parent-child relationship with this childIVisualPart
.Clients should never call this operation directly but instead add the children to its parent via the
addChild(IVisualPart)
,addChild(IVisualPart, int)
,addChildren(List)
, oraddChildren(List, int)
or remove it via theremoveChild(IVisualPart)
orremoveChildren(List)
operations, which will indirectly lead to a call here.- Parameters:
parent
- The new parentIVisualPart
ornull
.- Noreference:
- Clients should use
addChild(IVisualPart)
,addChild(IVisualPart, int)
,addChildren(List)
,addChildren(List, int)
,removeChild(IVisualPart)
, orremoveChildren(List)
to establish/unestablish a parent-child relationship instead.
-
setRefreshVisual
void setRefreshVisual(boolean refreshVisual)
Allows to temporarily turnrefreshVisual()
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
.- Parameters:
refreshVisual
- WhetherrefreshVisual()
should perform updates of the visual (true
) or behave like a no-op operation (false
).
-
-