public final class PortDecorator extends Object
decorating the ILookup.lookup(Class)
method of IPort instances that are contained in an IGraph which are managed by an
ILookupDecorator.
This decorator can be used to conveniently decorate the lookup of IPorts in an
IGraph. It serves as a factory for predefined LookupDecorator instances that are specifically useful
for the IPort 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 |
|---|
PortDecorator(ILookupDecorator decorator)
Initializes a new instance of the
PortDecorator class. |
| Modifier and Type | Method and Description |
|---|---|
LookupDecorator<IPort,IClipboardHelper> |
getClipboardHelperDecorator()
Gets a
LookupDecorator that decorates the IClipboardHelper type for the type of items this instance has
been created for. |
<TInterface> |
getDecoratorFor(Class<TInterface> interfaceType)
|
<TInterface> |
getDecoratorFor(Class<TInterface> interfaceType,
boolean decorateNulls)
|
<TInterface> |
getDecoratorFor(Class<TInterface> interfaceType,
boolean decorateNulls,
boolean nullIsFallback)
|
LookupDecorator<IPort,IEdgePathCropper> |
getEdgePathCropperDecorator()
Gets a
LookupDecorator that decorates the IEdgePathCropper type for the
IPorts of the graph this instance has been created for. |
LookupDecorator<IPort,IFocusIndicatorInstaller> |
getFocusIndicatorDecorator()
Gets a
LookupDecorator that decorates the IFocusIndicatorInstaller type for the type of items this
instance has been created for. |
LookupDecorator<IPort,IHandle> |
getHandleDecorator()
Gets a
LookupDecorator that decorates the IHandle type for the
IPorts of the graph this instance has been created for. |
LookupDecorator<IPort,IHandleProvider> |
getHandleProviderDecorator()
Gets a
LookupDecorator that decorates the IHandleProvider type for the type of items this instance has
been created for. |
LookupDecorator<IPort,IHighlightIndicatorInstaller> |
getHighlightDecorator()
Gets a
LookupDecorator that decorates the IHighlightIndicatorInstaller type for the type of items this
instance has been created for. |
LookupDecorator<IPort,IMarqueeTestable> |
getMarqueeTestableDecorator()
Gets a
LookupDecorator that decorates the IMarqueeTestable type for the type of items this instance has
been created for. |
LookupDecorator<IPort,IMementoSupport> |
getMementoSupportDecorator()
Gets a
LookupDecorator that decorates the IMementoSupport type for the type of items this instance has
been created for. |
LookupDecorator<IPort,IObstacleProvider> |
getObstacleProviderDecorator()
Gets a
LookupDecorator that decorates the IObstacleProvider type for the type of items this instance has
been created for. |
LookupDecorator<IPort,IPortSnapResultProvider> |
getPortSnapResultProviderDecorator()
Gets a
LookupDecorator that decorates the IPortSnapResultProvider for the
IPorts this instance has been created for. |
LookupDecorator<IPort,IPositionHandler> |
getPositionHandlerDecorator()
Gets a
LookupDecorator that decorates the IPositionHandler type for the type of items this instance has
been created for. |
LookupDecorator<IPort,ISelectionIndicatorInstaller> |
getSelectionDecorator()
Gets a
LookupDecorator that decorates the ISelectionIndicatorInstaller type for the type of items this
instance has been created for. |
LookupDecorator<IPort,ISnapLineProvider> |
getSnapLineProviderDecorator()
Gets a
LookupDecorator that decorates the ISnapLineProvider for the
IPorts this instance has been created for. |
public PortDecorator(ILookupDecorator decorator)
PortDecorator class.decorator - The decorator to use, which can be null.public final LookupDecorator<IPort,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<IPort,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<IPort,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<IPort,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<IPort,IEdgePathCropper> getEdgePathCropperDecorator()
LookupDecorator that decorates the IEdgePathCropper type for the
IPorts of the graph this instance has been created for.
Custom IEdgePathCropper implementations can be used to change the way the path of PathBasedEdgeStyleRenderer
implementations calculate the GeneralPath of the visual representation of an IEdge
in a GraphControl. This interface is mainly used by the PathBasedEdgeStyleRenderer
to find the intersection of an edge with the bounds of the adjacent node to properly crop the edge path. This is a
convenient alternative to the direct usage of the ILookupDecorator that is provided by the
IGraph's ILookup.lookup(Class).
IEdgePathCropper instances on IPorts.public final LookupDecorator<IPort,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<IPort,IHandle> getHandleDecorator()
LookupDecorator that decorates the IHandle type for the
IPorts of the graph this instance has been created for.
Custom IHandle implementations can be used to change the way the user can drag a port interactively to change
its position in a GraphControl. This interface is mainly used by the HandleInputMode
in GraphEditorInputMode which obtains the IHandle from the IPort by
querying the IHandleProvider from it, which in turn will query the IHandle from itself. Alternatively,
selected nodes can put the IHandle of their ports into their IHandleProvider implementation. This is a
convenient alternative to the direct usage of the ILookupDecorator that is provided by the
IGraph's ILookup.lookup(Class).
public final LookupDecorator<IPort,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<IPort,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<IPort,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<IPort,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<IPort,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,
BridgeManagerpublic final LookupDecorator<IPort,IPortSnapResultProvider> getPortSnapResultProviderDecorator()
LookupDecorator that decorates the IPortSnapResultProvider for the
IPorts this instance has been created for.
Custom IPortSnapResultProvider implementations can be used to provide custom
SnapResults based on the IPorts this instance has been created for.
This could e.g. be a SnapResult describing that the port wants to snap to a grid
point. This interface is mainly used by the PortLocationModelParameterHandle to
collect SnapResults during a drag gesture for the port. This is a convenient
alternative to the direct usage of the ILookupDecorator that is provided by the
IGraph's ILookup.lookup(Class).
IPortSnapResultProvider instances on IPorts.public final LookupDecorator<IPort,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<IPort,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<IPort,ISnapLineProvider> getSnapLineProviderDecorator()
LookupDecorator that decorates the ISnapLineProvider for the
IPorts this instance has been created for.
Custom ISnapLineProvider implementations can be used to provide custom
OrthogonalSnapLines based on the IPorts this instance has been created
for. This could e.g. be a OrthogonalSnapLine with a horizontal or vertical offset
to the port's location. This interface is mainly used by the GraphSnapContext to
collect all available OrthogonalSnapLines. 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 IPorts.