A mutable implementation of the INode interface that can be used without an IGraph.
Remarks
Note that this class is not the one used as the default implementation of a Graph's INodes and casting them to SimpleNode will fail.
Instances of this class can be used without an accompanying graph instance. All the properties are mutable. An example of a possible use case would be the rendering of a node into a graphics context: Simply create a SimpleNode, associate a style with it and use the style's renderer instance to obtain a rendering for the node.
Type Details
- yFiles module
- view
Constructors
Creates a default node with default lookup, VOID_NODE_STYLE as style, an empty layout, and no labels nor ports.
Remarks
Parameters
A map of options to pass to the method.
- layout - IRectangle
- The layout of the node. This option sets the layout property on the created object.
- style - INodeStyle
- The style that is responsible for the visual representation of this node in a CanvasComponent. This option sets the style property on the created object.
- ports - IListEnumerable<IPort>
- labels - IListEnumerable<ILabel>
- tag - INode['tag']
Properties
Gets or sets the collection of labels that are owned by this instance.
Gets or sets the layout of the node.
Remarks
See Also
Implements
Gets or sets the collection of ports that are owned by this instance.
Gets or sets the style that is responsible for the visual representation of this node in a CanvasComponent.
Remarks
See Also
Implements
Gets or sets the tag object associated with this item instance.
Remarks
Implements
Methods
Gets a NodeDecorator to modify the ports ILookup.
Returns
- ↪NodeDecorator
- A NodeDecorator for this instance.
Returns an instance that implements the given type or null
.
Remarks
null
implementations for the types, nor does it have to return the same instance any time. Also, it depends on the type and context whether the instance returned stays up to date or needs to be re-obtained for further use.Type Parameters
- T
Parameters
A map of options to pass to the method.
- type - Constructor<T>
- the type for which an instance shall be returned
Returns
- ↪T?
- an instance that is assignable to the type or
null