A foundational implementation of INodeStyle that delegates its behavior to several style instances.
Implements
Inheritance Hierarchy
Remarks
This class can be used to combine multiple SVG-based style instances into one.
The following aspects will be delegated to all instances:
- creating and updating the visuals.
- testing for visibility.
- hit testing.
- calculating the total bounds of the node.
- determining if a node is within a rectangular marquee selection area.
- determining if a node is within a lasso selection path.
The following aspects will be delegated to the first/main style, only:
- looking up the context.
- calculating the intersection points for edges.
- checking whether a point is inside a node.
- calculating the outline of a node.
This class can be subclassed like NodeStyleBase<TVisual> to allow for custom implementations of the various aspects of the delegation.
See Also
Developer's Guide
Members
Show:
Constructors
Parameters
- mainStyle: INodeStyle
- The main style which will be rendered first and to which all requests will delegate to.
- …additionalStyles: INodeStyle
- Additional styles which will be rendered on top and which will also be included in the hit-, visibility-, and bounds tests.
Properties
Gets the renderer implementation for this instance.
Gets the renderer implementation for this instance.
The private implementation will delegate all API calls back to this instance.
readonlyfinal
See Also
Developer's Guide
Defined in
NodeStyleBase.rendererGets a readonly list of the styles used by this instance.
Gets a readonly list of the styles used by this instance.
The first item is the main instance, and the others are the additional instances rendered on top in order. The list always has at least one member.
readonlyfinal
Methods
Returns a memberwise clone.
Returns a memberwise clone.
This will also clone the style instances.
Return Value
- Object
- A clone of this instance.
Overrides
NodeStyleBase.cloneprotected
Parameters
- context: IRenderContext
- The render context.
- node: INode
- The node to which this style instance is assigned.
Return Value
- Visual | null
- The visual as required by the IVisualCreator.createVisual interface.
See Also
Developer's Guide
API
- updateVisual
Overrides
NodeStyleBase.createVisualprotected
Parameters
- context: ICanvasContext
- The canvas context.
- node: INode
- The node to which this style instance is assigned.
Return Value
- Rect
- The visual bounds of the visual representation.
See Also
Developer's Guide
Overrides
NodeStyleBase.getBoundsCalculates the intersection point based on the first style.
Calculates the intersection point based on the first style.
protected
Parameters
Return Value
- Point | null
- The intersection point if one has been found or
null, otherwise.
See Also
Developer's Guide
API
- isInside
Overrides
NodeStyleBase.getIntersectionCalculates the outline based on the first style.
Calculates the outline based on the first style.
protected
Parameters
- node: INode
- The node to which this style instance is assigned.
Return Value
- GeneralPath | null
- The outline of the visual representation or
null.
See Also
Developer's Guide
Overrides
NodeStyleBase.getOutlineChecks whether any style is hit at the given location.
Checks whether any style is hit at the given location.
protected
Parameters
- context: IInputModeContext
- The input mode context.
- location: Point
- The point to test.
- node: INode
- The node to which this style instance is assigned.
Return Value
- boolean
trueif the specified node is hit;falseotherwise.
See Also
Developer's Guide
Overrides
NodeStyleBase.isHitDetermines if the node is in the box based on any style.
Determines if the node is in the box based on any style.
protected
Parameters
- context: IInputModeContext
- The input mode context.
- rectangle: Rect
- The marquee selection box.
- node: INode
- The node to which this style instance is assigned.
Return Value
- boolean
trueif the specified node is visible and selected by the marquee rectangle;falseotherwise.
See Also
Developer's Guide
Overrides
NodeStyleBase.isInBoxDetermines if the node is in the path based on any style.
Determines if the node is in the path based on any style.
protected
Parameters
- context: IInputModeContext
- The input mode context.
- path: GeneralPath
- The lasso selection path.
- node: INode
- The node to which this style instance is assigned.
Return Value
- boolean
trueif the specified node is visible and selected by the lasso path;falseotherwise.
See Also
Developer's Guide
Overrides
NodeStyleBase.isInPathDetermines if the location is inside the node based on the first style.
Determines if the location is inside the node based on the first style.
protected
Parameters
Return Value
- boolean
- Whether the point is considered to lie inside the shape.
See Also
Developer's Guide
Overrides
NodeStyleBase.isInsideprotected
Parameters
Return Value
- boolean
trueif the specified node is visible in the clipping rectangle;falseotherwise.
See Also
Developer's Guide
Overrides
NodeStyleBase.isVisiblePerforms a lookup using the first style as the reference.
Performs a lookup using the first style as the reference.
protected
Parameters
- node: INode
- The node to use for the context lookup.
- type: Constructor
- The type to query.
Return Value
- any | null
- An implementation of the
typeornull.
Overrides
NodeStyleBase.lookupprotected
Parameters
- context: IRenderContext
- The render context.
- oldVisual: Visual
- The visual that has been created in the call to createVisual.
- node: INode
- The node to which this style instance is assigned.
Return Value
- Visual | null
- The visual as required by the IVisualCreator.createVisual interface.
See Also
API
- createVisual
Updates a visual representation for node previously created by createVisual<TVisual>.
Updates a visual representation for
node previously created by createVisual<TVisual>.This method is called in response to a IVisualCreator.updateVisual call to the instance that has been queried from the renderer<TVisual>. This implementation simply delegates to createVisual<TVisual> so subclasses should override to improve rendering performance.
protected
Parameters
- context: IRenderContext
- The render context.
- oldVisual: Visual
- The visual that has been created in the call to createVisual<TVisual>.
- node: INode
- The node to which this style instance is assigned.
Return Value
- Visual | null
- The visual as required by the IVisualCreator.createVisual interface.
See Also
Developer's Guide
API
- createVisual