V
- The visual node used by this IVisualPart
.public interface IVisualPart<V extends javafx.scene.Node> extends IAdaptable, IAdaptable.Bound<IViewer>, IActivatable, IDisposable
IVisualPart
plays the controller role in the model-view-controller
architecture. While it does not have to be bound to a model (actually only
IContentPart
s are bound to model elements, IFeedbackPart
s and
IHandlePart
s do not refer to model elements), an IVisualPart
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 an IRootPart
.
Furthermore a [n:m]
anchorage-anchored relationship (
getAnchoragesUnmodifiable()
, getAnchoredsUnmodifiable()
)
may be established between IVisualPart
s located at arbitrary places
within the hierarchy.
An IVisualPart
is adaptable (IAdaptable
). Usually,
IPolicy
s and IBehavior
s are adapted to it (but arbitrary
adapters may indeed be registered as needed). IPolicy
s are usually
required in case the IVisualPart
is directly involved in user
interaction (e.g. the user clicks on its controlled visual). They may be
accessed type-safe by IGesture
s or other IPolicy
s (
IPolicy
s may delegate to other IPolicy
s)). IBehavior
s
are used to react to changes of the attached model (in case of an
IContentPart
s), the viewer models, or others sources (e.g. adapters
of the IViewer
or IDomain
), thereby reacting to changes of
the interactive state.
IVisualPart
s are IActivatable
activatable, and an
activation/deactivation of an IVisualPart
will result in the
activation/deactivation of all registered adapters (i.e. IPolicy
s and
IBehavior
s).
An IVisualPart
is responsible for registering itself for its
visualization at the IViewer.getVisualPartMap()
when it obtains a
link to the IViewer
. Equally, an IVisualPart
is responsible
for unregistering itself for its visualization from the
IViewer.getVisualPartMap()
when it loses a link to the
IViewer
.
AbstractVisualPart
should be subclassed.Type | Property and Description |
---|---|
ReadOnlySetMultimapProperty<IVisualPart<? extends javafx.scene.Node>,java.lang.String> |
anchoragesUnmodifiable
Returns a read-only set-multimap property containing this part's
anchorages and their corresponding roles.
|
ReadOnlyMultisetProperty<IVisualPart<? extends javafx.scene.Node>> |
anchoredsUnmodifiable
Returns an unmodifiable read-only multiset property representing the
anchoreds of this
IVisualPart . |
javafx.beans.property.ReadOnlyListProperty<IVisualPart<? extends javafx.scene.Node>> |
childrenUnmodifiable
Returns an unmodifiable read-only property containing the children of
this
IVisualPart . |
javafx.beans.property.ReadOnlyObjectProperty<IVisualPart<? extends javafx.scene.Node>> |
parent
Returns a read-only property that refers to the parent of this
IVisualPart . |
javafx.beans.property.BooleanProperty |
refreshVisual
A boolean property indicating whether this
IVisualPart should
refresh its visuals or not. |
adapters
adaptable
active
IAdaptable.Bound<A extends IAdaptable>
IAdaptable.Bound.Impl<T extends IAdaptable>
Modifier and Type | Field and 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.
|
ADAPTERS_PROPERTY
ACTIVE_PROPERTY
Modifier and Type | Method and 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 this
IVisualPart . |
void |
attachAnchored(IVisualPart<? extends javafx.scene.Node> anchored)
Used by an anchored
IVisualPart to establish an
anchorage-anchored relationship with this anchorage IVisualPart . |
void |
attachToAnchorage(IVisualPart<? extends javafx.scene.Node> anchorage)
Attaches the given
IVisualPart to the given anchorage under the
"default" role. |
void |
attachToAnchorage(IVisualPart<? extends javafx.scene.Node> anchorage,
java.lang.String role)
Attaches the given
IVisualPart 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
this
IVisualPart . |
void |
detachAnchored(IVisualPart<? extends javafx.scene.Node> anchored)
Used by an anchored
IVisualPart to unestablish an
anchorage-anchored relationship with this anchorage IVisualPart . |
void |
detachFromAnchorage(IVisualPart<? extends javafx.scene.Node> anchorage)
Detaches this
IVisualPart from the given anchorage
IVisualPart under the 'default' role. |
void |
detachFromAnchorage(IVisualPart<? extends javafx.scene.Node> anchorage,
java.lang.String role)
Detaches this
IVisualPart from the given anchorage
IVisualPart under the given role. |
ObservableSetMultimap<IVisualPart<? extends javafx.scene.Node>,java.lang.String> |
getAnchoragesUnmodifiable()
Returns an unmodifiable
ObservableSetMultimap of this part's
anchorages and their corresponding roles. |
ObservableMultiset<IVisualPart<? extends javafx.scene.Node>> |
getAnchoredsUnmodifiable()
Returns an unmodifiable
ObservableMultiset of this part's
anchoreds. |
java.util.Map<AdapterKey<? extends IBehavior>,IBehavior> |
getBehaviors()
Returns a
Map of this part's behaviors and their corresponding
AdapterKey s. |
javafx.collections.ObservableList<IVisualPart<? extends javafx.scene.Node>> |
getChildrenUnmodifiable()
Returns an unmodifiable
ObservableList 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 a
Map of this part's handlers and their corresponding
AdapterKey s. |
IVisualPart<? extends javafx.scene.Node> |
getParent()
Returns the parent of this part.
|
java.util.Map<AdapterKey<? extends IPolicy>,IPolicy> |
getPolicies()
Returns a
Map of this part's policies and their corresponding
AdapterKey s. |
IRootPart<? extends javafx.scene.Node> |
getRoot()
Returns the
IRootPart . |
default IViewer |
getViewer()
Returns the
IViewer this IVisualPart is bound to. |
V |
getVisual()
Returns this part's visual.
|
boolean |
isRefreshVisual()
Returns
true 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 this
IVisualPart . |
void |
refreshVisual()
Refreshes this part's visualization based on this part's content.
|
javafx.beans.property.BooleanProperty |
refreshVisualProperty()
A boolean property indicating whether this
IVisualPart should
refresh its visuals or not. |
void |
removeChild(IVisualPart<? extends javafx.scene.Node> child)
Removes the given
IVisualPart from the list of this part's
children. |
void |
removeChildren(java.util.List<? extends IVisualPart<? extends javafx.scene.Node>> children)
Removes the given
IVisualPart s from the list of this part's
children. |
void |
reorderChild(IVisualPart<? extends javafx.scene.Node> child,
int index)
Swaps the given
IVisualPart 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 parent
IVisualPart to establish/unestablish a
parent-child relationship with this child IVisualPart . |
void |
setRefreshVisual(boolean refreshVisual)
Allows to temporarily turn
refreshVisual() into a no-op
operation. |
adaptersProperty, getAdapter, getAdapter, getAdapter, getAdapterKey, getAdapters, getAdapters, getAdapters, setAdapter, setAdapter, setAdapter, setAdapter, unsetAdapter
adaptableProperty, getAdaptable, setAdaptable
activate, activeProperty, deactivate, isActive
dispose
ReadOnlySetMultimapProperty<IVisualPart<? extends javafx.scene.Node>,java.lang.String> anchoragesUnmodifiableProperty
getAnchoragesUnmodifiable()
ReadOnlyMultisetProperty<IVisualPart<? extends javafx.scene.Node>> anchoredsUnmodifiableProperty
IVisualPart
.getAnchoredsUnmodifiable()
javafx.beans.property.ReadOnlyListProperty<IVisualPart<? extends javafx.scene.Node>> childrenUnmodifiableProperty
IVisualPart
.getChildrenUnmodifiable()
javafx.beans.property.ReadOnlyObjectProperty<IVisualPart<? extends javafx.scene.Node>> parentProperty
IVisualPart
.getParent()
,
setParent(IVisualPart)
javafx.beans.property.BooleanProperty refreshVisualProperty
IVisualPart
should
refresh its visuals or not.isRefreshVisual()
,
setRefreshVisual(boolean)
static final java.lang.String PARENT_PROPERTY
static final java.lang.String CHILDREN_PROPERTY
static final java.lang.String ANCHORAGES_PROPERTY
static final java.lang.String ANCHOREDS_PROPERTY
static final java.lang.String REFRESH_VISUAL_PROPERTY
void addChild(IVisualPart<? extends javafx.scene.Node> child)
child
- The IVisualPart
which is added to the list of this
part's children.void addChild(IVisualPart<? extends javafx.scene.Node> child, int index)
child
- The IVisualPart
which is added to the list of this
part's children.index
- The index at which the given IVisualPart
is inserted
into this part's children list.void addChildren(java.util.List<? extends IVisualPart<? extends javafx.scene.Node>> children)
children
- The IVisualPart
s which are added to the list of this
part's children.void addChildren(java.util.List<? extends IVisualPart<? extends javafx.scene.Node>> children, int index)
children
- The IVisualPart
s which are added to the list of this
part's children.index
- The index at which the given IVisualPart
s are inserted
into this part's children list.ReadOnlySetMultimapProperty<IVisualPart<? extends javafx.scene.Node>,java.lang.String> anchoragesUnmodifiableProperty()
getAnchoragesUnmodifiable()
ReadOnlyMultisetProperty<IVisualPart<? extends javafx.scene.Node>> anchoredsUnmodifiableProperty()
IVisualPart
.getAnchoredsUnmodifiable()
void attachAnchored(IVisualPart<? extends javafx.scene.Node> anchored)
IVisualPart
to establish an
anchorage-anchored relationship with this anchorage IVisualPart
.
Clients should never call this operation directly but instead add the
anchorage to its anchored via the attachToAnchorage(IVisualPart)
and attachToAnchorage(IVisualPart, String)
operations, which
will indirectly lead to a call here.
anchored
- An IVisualPart
to attach to this anchorage
IVisualPart
as anchored.attachToAnchorage(IVisualPart)
,
attachToAnchorage(IVisualPart, String)
instead to
establish an anchored-anchorage relationship.void attachToAnchorage(IVisualPart<? extends javafx.scene.Node> anchorage)
IVisualPart
to the given anchorage under the
"default" role.anchorage
- The anchorage IVisualPart
to attach this part to.void attachToAnchorage(IVisualPart<? extends javafx.scene.Node> anchorage, java.lang.String role)
IVisualPart
to the given anchorage under the
given role.anchorage
- The anchorage IVisualPart
to attach this part to.role
- The role under which this IVisualPart
is attached to
the given anchorage. null
.javafx.beans.property.ReadOnlyListProperty<IVisualPart<? extends javafx.scene.Node>> childrenUnmodifiableProperty()
IVisualPart
.getChildrenUnmodifiable()
void detachAnchored(IVisualPart<? extends javafx.scene.Node> anchored)
IVisualPart
to unestablish an
anchorage-anchored relationship with this anchorage IVisualPart
.
Clients should never call this operation directly but instead remove the
anchorage from its anchored via the
detachFromAnchorage(IVisualPart)
or
detachFromAnchorage(IVisualPart, String)
operations, which will
indirectly lead to a call here.
anchored
- An IVisualPart
(currently attached as anchored to this
anchorage IVisualPart
) to detach from this anchorage
IVisualPart
as anchored.detachFromAnchorage(IVisualPart)
or
detachFromAnchorage(IVisualPart, String)
instead to
unestablish an anchored-anchorage relationship.void detachFromAnchorage(IVisualPart<? extends javafx.scene.Node> anchorage)
IVisualPart
from the given anchorage
IVisualPart
under the 'default' role.anchorage
- The anchorage IVisualPart
to detach this part from.void detachFromAnchorage(IVisualPart<? extends javafx.scene.Node> anchorage, java.lang.String role)
IVisualPart
from the given anchorage
IVisualPart
under the given role.anchorage
- The anchorage IVisualPart
to detach this part from.role
- The role under which the IVisualPart
can be found in
this part's anchorages.ObservableSetMultimap<IVisualPart<? extends javafx.scene.Node>,java.lang.String> getAnchoragesUnmodifiable()
ObservableSetMultimap
of this part's
anchorages and their corresponding roles.ObservableSetMultimap
of this part's anchorages and
their corresponding roles.ObservableMultiset<IVisualPart<? extends javafx.scene.Node>> getAnchoredsUnmodifiable()
ObservableMultiset
of this part's
anchoreds.ObservableMultiset
of this part's
anchoreds.java.util.Map<AdapterKey<? extends IBehavior>,IBehavior> getBehaviors()
Map
of this part's behaviors and their corresponding
AdapterKey
s.Map
of this part's behaviors and their corresponding
AdapterKey
s.javafx.collections.ObservableList<IVisualPart<? extends javafx.scene.Node>> getChildrenUnmodifiable()
ObservableList
of this part's children.ObservableList
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()
Map
of this part's handlers and their corresponding
AdapterKey
s.Map
of this part's handlers and their corresponding
AdapterKey
s.IVisualPart<? extends javafx.scene.Node> getParent()
java.util.Map<AdapterKey<? extends IPolicy>,IPolicy> getPolicies()
Map
of this part's policies and their corresponding
AdapterKey
s.Map
of this part's policies and their corresponding
AdapterKey
s.IRootPart<? extends javafx.scene.Node> getRoot()
IRootPart
. This method should only be called
internally or by helpers such as edit policies. The root can be used to
get the viewer.null
or the IRootPart
default IViewer getViewer()
IViewer
this IVisualPart
is bound to.IViewer
this IVisualPart
is attached to.V getVisual()
boolean isRefreshVisual()
true
if this part is allowed to refresh its
visualization based on its content. Otherwise returns false
.true
if this part is allowed to refresh its
visualization based on its content, otherwise false
.javafx.beans.property.ReadOnlyObjectProperty<IVisualPart<? extends javafx.scene.Node>> parentProperty()
IVisualPart
.getParent()
,
setParent(IVisualPart)
void refreshVisual()
javafx.beans.property.BooleanProperty refreshVisualProperty()
IVisualPart
should
refresh its visuals or not.isRefreshVisual()
,
setRefreshVisual(boolean)
void removeChild(IVisualPart<? extends javafx.scene.Node> child)
IVisualPart
from the list of this part's
children.child
- The IVisualPart
which is removed from the list of this
part's children.void removeChildren(java.util.List<? extends IVisualPart<? extends javafx.scene.Node>> children)
IVisualPart
s from the list of this part's
children.children
- The IVisualPart
s which are removed from the list of
this part's children.void reorderChild(IVisualPart<? extends javafx.scene.Node> child, int index)
IVisualPart
with the part at the given index
position within this part's list of children.child
- The IVisualPart
which is reordered.index
- The index to which the part is reordered.void setParent(IVisualPart<? extends javafx.scene.Node> parent)
IVisualPart
to establish/unestablish a
parent-child relationship with this child IVisualPart
.
Clients should never call this operation directly but instead add the
children to its parent via the addChild(IVisualPart)
,
addChild(IVisualPart, int)
, addChildren(List)
, or
addChildren(List, int)
or remove it via the
removeChild(IVisualPart)
or removeChildren(List)
operations, which will indirectly lead to a call here.
parent
- The new parent IVisualPart
or null
.addChild(IVisualPart)
,
addChild(IVisualPart, int)
,
addChildren(List)
, addChildren(List, int)
,
removeChild(IVisualPart)
, or
removeChildren(List)
to establish/unestablish a
parent-child relationship instead.void setRefreshVisual(boolean refreshVisual)
refreshVisual()
into a no-op
operation. This may for instance be used to disable visual updates that
are initiated by the model (in case of IContentPart
s) while
interacting with the IVisualPart
.refreshVisual
- Whether refreshVisual()
should perform updates of the
visual (true
) or behave like a no-op operation (
false
).Copyright (c) 2014, 2016 itemis AG and others. All rights reserved.