documentationfor yFiles for HTML 2.6

LookupDecorator<TDecoratedType,TInterface>

Simplifies using an ILookupDecorator.

Inheritance Hierarchy
LookupDecorator

Remarks

This class provides methods that help in performing common tasks related to decorating the lookup method for a certain TDecoratedType:

  • Set a single implementation
  • Set a factory that creates item-specific implementations
  • Wrap the default implementation
  • Hide the default implementation

Each of these methods adds a new IContextLookupChainLink to the lookup chain which adds the wanted behavior. The link can be removed again by either calling the removeLookup method on the decorator or by calling the remove method on the parent decorator, e.g. the NodeDecorator.

Typically, one does not create instances of this class but uses the item specific implementations provided by GraphDecorator: nodeDecorator, edgeDecorator, labelDecorator, portDecorator, and bendDecorator.

Examples

Getting the decorator for a node's size constraint provider
const decorator =
  graph.decorator.nodeDecorator.sizeConstraintProviderDecorator
Setting a single implementation
graph.decorator.nodeDecorator.sizeConstraintProviderDecorator.setImplementation(
  new ConstantSizeConstraintProvider()
)
Setting a factory that creates item-specific implementations
graph.decorator.nodeDecorator.selectionDecorator.setFactory(
  (node) => new RedSelectionInstaller(node)
)
Wrapping the default implementation
graph.decorator.nodeDecorator.positionHandlerDecorator.setImplementationWrapper(
  (node, original) => new ConstrainedPositionHandlerWrapper(original, node)
)graph.decorator.nodeDecorator.positionHandlerDecorator.setImplementationWrapper(
  (node, original) => new ConstrainedPositionHandlerWrapper(original!, node!)
)
Hiding the default implementation
graph.decorator.nodeDecorator.positionHandlerDecorator.hideImplementation()

Type Parameters

TDecoratedType
The type of the instances whose behavior should be modified.
TInterface
The interface or type that clients will use during the call. Note that this is normally an interface and not the implementation of the interface since client code will use the interface for the query.

Type Details

yfiles module
view-component
yfiles-umd modules
All view modules
Legacy UMD name
yfiles.graph.LookupDecorator

See Also

Constructors

Properties

Methods