public final class NodeDecorator extends Object
decorating
the ILookup.lookup(Class)
method of INode
instances that are contained in an IGraph
which are managed by an
ILookupDecorator
.
This decorator can be used to conveniently decorate the lookup
of INode
s in an
IGraph
. It serves as a factory for predefined LookupDecorator
instances that are specifically useful
for the INode
type. Note that the list of possible decorations that are available using this class is not
exhaustive in any way. This is merely a way to provide access to those interfaces that are more commonly being decorated
by the developer.
GraphDecorator
,
LookupDecorator
Constructor and Description |
---|
NodeDecorator(ILookupDecorator decorator)
Initializes a new instance of the
NodeDecorator class. |
public NodeDecorator(ILookupDecorator decorator)
NodeDecorator
class.decorator
- The decorator to use, which can be null
.public final LookupDecorator<INode,IClipboardHelper> getClipboardHelperDecorator()
LookupDecorator
that decorates the IClipboardHelper
type for the type of items this instance has
been created for.
Custom IClipboardHelper
implementations can be used to customize the way the clipboard operations are performed
by GraphClipboard
. This is a convenient alternative to the direct usage of the ILookupDecorator
that is provided by the IGraph
's ILookup.lookup(Class)
.
IClipboardHelper
instances on items that implement the TModelItem
interface this instance uses as the generic type parameter.public final <TInterface> LookupDecorator<INode,TInterface> getDecoratorFor(Class<TInterface> interfaceType)
TInterface
- The type of the interface that should be decorated of the instances'
ILookup.lookup(Class)
.LookupDecorator
for the specified interface.public final <TInterface> LookupDecorator<INode,TInterface> getDecoratorFor(Class<TInterface> interfaceType, boolean decorateNulls)
TInterface
- The type of the interface that should be decorated of the instances'
ILookup.lookup(Class)
.decorateNulls
- if set to true
null
values will be decorated, otherwise not.LookupDecorator
for the specified interface.public final <TInterface> LookupDecorator<INode,TInterface> getDecoratorFor(Class<TInterface> interfaceType, boolean decorateNulls, boolean nullIsFallback)
TInterface
- The type of the interface that should be decorated of the instances'
ILookup.lookup(Class)
.interfaceType
- The type of the interface that should be decorated of the instances'
ILookup.lookup(Class)
.decorateNulls
- if set to true
null
values will be decorated, otherwise not.nullIsFallback
- if set to true
null
values will be treated as fallback values, otherwise they will be used as the final
result.LookupDecorator
for the specified interface.public final LookupDecorator<INode,IEditLabelHelper> getEditLabelHelperDecorator()
LookupDecorator
that decorates the IEditLabelHelper
type for the
INode
s this instance has been created for.
Custom IEditLabelHelper
implementations can be used to change or customize interactive label editing and label
creation. This interface is mainly used by the GraphEditorInputMode
which uses the
callbacks from the implementation to determine the label to add or edit, as well as to customize the TextEditorInputMode
appearance for the upcoming edit. This is a convenient alternative to the direct usage of the ILookupDecorator
that is provided by the IGraph
's ILookup.lookup(Class)
.
IEditLabelHelper
instances on INode
s.public final LookupDecorator<INode,IFocusIndicatorInstaller> getFocusIndicatorDecorator()
LookupDecorator
that decorates the IFocusIndicatorInstaller
type for the type of items this
instance has been created for.
Custom IFocusIndicatorInstaller
implementations can be used change the way the focus of an item is represented
in a GraphControl
. This interface is mainly used by the FocusIndicatorManager
in the GraphControl
. This is a convenient alternative to the direct usage of the ILookupDecorator
that is provided by the IGraph
's ILookup.lookup(Class)
.
IFocusIndicatorInstaller
instances on items that
implement the TModelItem
interface this instance uses as the generic type parameter.public final LookupDecorator<INode,IGroupBoundsCalculator> getGroupBoundsCalculatorDecorator()
LookupDecorator
that decorates the IGroupBoundsCalculator
type for the
INode
s this instance has been created for.
Custom IGroupBoundsCalculator
implementations can be used to change the way the bounds of group nodes
are being calculated if the geometry of child nodes is changed by the user. This is a convenient alternative to the
direct usage of the ILookupDecorator
that is provided by the IGraph
's
ILookup.lookup(Class)
.
IGroupBoundsCalculator
instances on INode
s.public final LookupDecorator<INode,IHandleProvider> getHandleProviderDecorator()
LookupDecorator
that decorates the IHandleProvider
type for the type of items this instance has
been created for.
Custom IHandleProvider
implementations provide interactive draggable handles for the user to change the geometry
or other aspects of items in the GraphControl
. This interface is mainly used by the HandleInputMode
in the GraphEditorInputMode
. This is a convenient alternative to the direct usage
of the ILookupDecorator
that is provided by the IGraph
's
ILookup.lookup(Class)
.
IHandleProvider
instances on items that implement the TModelItem
interface this instance uses as the generic type parameter.public final LookupDecorator<INode,IHighlightIndicatorInstaller> getHighlightDecorator()
LookupDecorator
that decorates the IHighlightIndicatorInstaller
type for the type of items this
instance has been created for.
Custom IHighlightIndicatorInstaller
implementations can be used change the way the highlighting of an item is
represented in a CanvasControl
. This interface is mainly used by the HighlightIndicatorManager
in the GraphControl
. This is a convenient alternative to the direct usage of the ILookupDecorator
that is provided by the IGraph
's ILookup.lookup(Class)
.
IHighlightIndicatorInstaller
instances on items that
implement the TModelItem
interface this instance uses as the generic type parameter.public final LookupDecorator<INode,INodeInsetsProvider> getInsetsProviderDecorator()
LookupDecorator
that decorates the INodeInsetsProvider
(tied to the INode
type parameter)
for the INode
s this instance has been created for.
Custom INodeInsetsProvider
implementations can be used to change the way the bounds of group nodes
are being calculated if the geometry of child nodes is changed by the user. This interface will be used if there is no
custom IGroupBoundsCalculator
associated with the nodes (see
GroupBoundsCalculatorDecorator
). This is a convenient alternative to
the direct usage of the ILookupDecorator
that is provided by the IGraph
's
ILookup.lookup(Class)
. Note that many INodeStyle
implementations provide an Insets
property whose value
will be reported by a INodeInsetsProvider
implementation that is provided by the corresponding
INodeStyleRenderer
. Using this property instead of decorating the lookup of
the INode
is thus often simpler.
INodeInsetsProvider
instances on INode
s.public final LookupDecorator<INode,IMarqueeTestable> getMarqueeTestableDecorator()
LookupDecorator
that decorates the IMarqueeTestable
type for the type of items this instance has
been created for.
Custom IMarqueeTestable
implementations can be used to change the way tests for marquee inclusions are performed
on the items in the editor. This interface is mainly used by the
GraphEditorInputMode
. This is a convenient alternative to the direct usage of
the ILookupDecorator
that is provided by the IGraph
's
ILookup.lookup(Class)
.
IMarqueeTestable
instances on items that implement the TModelItem
interface this instance uses as the generic type parameter.public final LookupDecorator<INode,IMementoSupport> getMementoSupportDecorator()
LookupDecorator
that decorates the IMementoSupport
type for the type of items this instance has
been created for.
Custom IMementoSupport
implementations can be used to make the UndoEngine
aware
of changes to data that is associated with the model items. This is a convenient alternative to the direct usage of the
ILookupDecorator
that is provided by the IGraph
's
ILookup.lookup(Class)
.
IMementoSupport
instances on items that implement the TModelItem
interface this instance uses as the generic type parameter.public final LookupDecorator<INode,INodeReshapeSnapResultProvider> getNodeReshapeSnapResultProviderDecorator()
LookupDecorator
that decorates the ISnapLineProvider
for the
INode
s this instance has been created for.
Custom INodeReshapeSnapResultProvider
implementations can be used to provide custom
SnapResult
s based on the INode
s this instance has been created for.
This could e.g. be a SnapResult
describing that the top left corner of the node
wants to snap to a grid point. This interface is mainly used by the node reshape
IHandle
s to collect SnapResult
s during a
resize gesture for the node. This is a convenient alternative to the direct usage of the ILookupDecorator
that
is provided by the IGraph
's ILookup.lookup(Class)
.
ISnapLineProvider
instances on INode
s.public final LookupDecorator<INode,INodeSnapResultProvider> getNodeSnapResultProviderDecorator()
LookupDecorator
that decorates the INodeSnapResultProvider
for the
INode
s this instance has been created for.
Custom INodeSnapResultProvider
implementations can be used to provide custom
SnapResult
s based on the INode
s this instance has been created for.
This could e.g. be a SnapResult
describing that the top left corner of the node
wants to snap to a grid point. This interface is mainly used by the node's IPositionHandler
to collect
SnapResult
s during a drag gesture for the node. This is a convenient
alternative to the direct usage of the ILookupDecorator
that is provided by the
IGraph
's ILookup.lookup(Class)
.
INodeSnapResultProvider
instances on INode
s.public final LookupDecorator<INode,IObstacleProvider> getObstacleProviderDecorator()
LookupDecorator
that decorates the IObstacleProvider
type for the type of items this instance has
been created for.
Custom IObstacleProvider
implementations provide information about obstacles that will be considered by GraphObstacleProvider
which itself serves as a provider for geometric obstacles to BridgeManager
that manages
the rendering of bridges in edge paths. This is a convenient alternative to the direct usage of the ILookupDecorator
that is provided by the IGraph
's ILookup.lookup(Class)
.
IObstacleProvider
instances on items that implement the TModelItem
interface this instance uses as the generic type parameter.GraphObstacleProvider
,
BridgeManager
public final LookupDecorator<INode,IPortCandidateProvider> getPortCandidateProviderDecorator()
LookupDecorator
that decorates the IPortCandidateProvider
for the
INode
s this instance has been created for.
Custom IPortCandidateProvider
implementations can be used to present the user with a set of
IPortCandidate
s that newly created edges can use as their source
and target
IPort
s. This interface
is mainly used by the CreateEdgeInputMode
mode of
GraphEditorInputMode
. Also the default implementation of IEdgeReconnectionPortCandidateProvider
will use this interface to determine the candidates that are available if the user interactively moves the ports using PortRelocationHandle
(see HandleDecorator
). This is a convenient
alternative to the direct usage of the ILookupDecorator
that is provided by the
IGraph
's ILookup.lookup(Class)
.
IPortCandidateProvider
instances on INode
s.public final LookupDecorator<INode,IPositionHandler> getPositionHandlerDecorator()
LookupDecorator
that decorates the IPositionHandler
type for the type of items this instance has
been created for.
Custom IPositionHandler
implementations can be used to restrict or enhance the way the user moves elements
interactively in the editor. This interface is mainly used by the MoveInputMode
.
This is a convenient alternative to the direct usage of the ILookupDecorator
that is provided by the
IGraph
's ILookup.lookup(Class)
.
IPositionHandler
instances on items that implement the TModelItem
interface this instance uses as the generic type parameter.public final LookupDecorator<INode,IReshapeHandleProvider> getReshapeHandleProviderDecorator()
LookupDecorator
that decorates the IReshapeHandleProvider
type for the
INode
s this instance has been created for.
Custom IReshapeHandleProvider
implementations can be used to change the number and type of
IHandle
s that can be used by the user to reshape the INode
s in
interactively in the editor. This interface is mainly used by the GraphEditorInputMode
which passes the IHandle
s to the
HandleInputMode
. This is a convenient alternative to the direct usage of the ILookupDecorator
that is provided by the IGraph
's ILookup.lookup(Class)
.
IReshapeHandleProvider
instances on INode
s.public final LookupDecorator<INode,ISelectionIndicatorInstaller> getSelectionDecorator()
LookupDecorator
that decorates the ISelectionIndicatorInstaller
type for the type of items this
instance has been created for.
Custom ISelectionIndicatorInstaller
implementations can be used change the way the selection of an item is
represented in a CanvasControl
. This interface is mainly used by the SelectionIndicatorManager
in the GraphControl
. This is a convenient alternative to the direct usage of the ILookupDecorator
that is provided by the IGraph
's ILookup.lookup(Class)
.
ISelectionIndicatorInstaller
instances on items that
implement the TModelItem
interface this instance uses as the generic type parameter.public final LookupDecorator<INode,IShapeGeometry> getShapeGeometryDecorator()
LookupDecorator
that decorates the IShapeGeometry
type for the type
INode
s this instance has been created for.
Custom IShapeGeometry
implementations can be used to change the way different code parts interpret the Layout
of an INode
. This interface is mainly used by the DefaultEdgePathCropper
,
and a custom IPortCandidateProvider
that can be obtained from
IPortCandidateProvider.fromShapeGeometry(com.yworks.yfiles.graph.IPortOwner, double[])
. Note that decorating
the IShapeGeometry
for an INode
will not change the result of a call to INodeStyleRenderer.getShapeGeometry(INode, com.yworks.yfiles.graph.styles.INodeStyle)
of the Style
. So standard hit tests will not be influenced by such a change. This is a
convenient alternative to the direct usage of the ILookupDecorator
that is provided by the
IGraph
's ILookup.lookup(Class)
.
IShapeGeometry
instances on INode
s.public final LookupDecorator<INode,INodeSizeConstraintProvider> getSizeConstraintProviderDecorator()
LookupDecorator
that decorates the INodeSizeConstraintProvider
type for the type
INode
s this instance has been created for.
Custom INodeSizeConstraintProvider
implementations can be used to add constraints to the size of a node. These
constraints are used by the default IReshapeHandleProvider
implementation for nodes to enforce size constraints
for interactive resize gestures. Also GraphEditorInputMode
uses this interface to
constrain the size of a node whenever its labels are being edited interactively. This is a convenient alternative to the
direct usage of the ILookupDecorator
that is provided by the IGraph
's
ILookup.lookup(Class)
.
INodeSizeConstraintProvider
instances on INode
s.public final LookupDecorator<INode,ISnapLineProvider> getSnapLineProviderDecorator()
LookupDecorator
that decorates the ISnapLineProvider
for the
INode
s this instance has been created for.
Custom ISnapLineProvider
implementations can be used to provide custom
OrthogonalSnapLine
s based on the INode
s this instance has been created
for. This could e.g. be a horizontal OrthogonalSnapLine
at the vertical center of
the node to which other nodes should snap with their top border. This interface is mainly used by the GraphSnapContext
to collect all available OrthogonalSnapLine
s. This is a convenient alternative to
the direct usage of the ILookupDecorator
that is provided by the IGraph
's
ILookup.lookup(Class)
.
ISnapLineProvider
instances on INode
s.