A foundational implementation of IPortStyle that delegates its behavior to several style instances.
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 port.
- determining if a port is within a rectangular marquee selection area.
- determining if a port is within a lasso selection path.
The following aspect will be delegated to the first/main style, only:
This class can be subclassed like PortStyleBase<TVisual> to allow for custom implementations of the various aspects of the delegation.
Type Details
- yFiles module
- view
Constructors
Creates a new instance of this style.
Parameters
A map of options to pass to the method.
- mainStyle - IPortStyle
- The main style which will be rendered first and to which all requests will delegate to.
- additionalStyles - IPortStyle
- 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.
Remarks
Implements
Gets a readonly list of the styles used by this instance.
Remarks
Methods
Returns a memberwise clone.
Creates the visual by delegating to all styles.
Remarks
Parameters
A map of options to pass to the method.
- context - IRenderContext
- The render context.
- port - IPort
- The port to which this style instance is assigned.
Returns
- ↪Visual?
- The visual as required by the createVisual interface.
See Also
Implements
Calculates the bounds as the union of bounds from all styles.
Parameters
A map of options to pass to the method.
- context - ICanvasContext
- The canvas context.
- port - IPort
- The port to which this style instance is assigned.
Returns
- ↪Rect
- The visual bounds of the visual representation.
Implements
Checks whether any style is hit at the given location.
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The input mode context.
- location - Point
- The point to test.
- port - IPort
- The port to which this style instance is assigned.
Returns
- ↪boolean
true
if the specified port is hit;false
otherwise.
Overrides
Determines if the port is in the box based on any style.
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The input mode context.
- rectangle - Rect
- The marquee selection box.
- port - IPort
- The port to which this style instance is assigned.
Returns
- ↪boolean
true
if the specified port is visible and selected by the marquee rectangle;false
otherwise.
Overrides
Determines if the port is in the path based on any style.
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The input mode context.
- path - GeneralPath
- The lasso selection path.
- port - IPort
- The port to which this style instance is assigned.
Returns
- ↪boolean
true
if the specified port is visible and selected by the lasso path;false
otherwise.
Overrides
Determines visibility based on the visibility of all styles.
Parameters
A map of options to pass to the method.
- context - ICanvasContext
- The canvas context.
- rectangle - Rect
- The clipping rectangle.
- port - IPort
- The port to which this style instance is assigned.
Returns
- ↪boolean
true
if the specified port is visible in the clipping rectangle;false
otherwise.
Overrides
Performs a lookup using the first style as the reference.
Parameters
A map of options to pass to the method.
- port - IPort
- The port to use for the context lookup.
- type - Constructor
- The type to query.
Returns
- ↪any?
- An implementation of the
type
ornull
.
Overrides
Updates the visual by delegating to all styles.
Remarks
Parameters
A map of options to pass to the method.
- context - IRenderContext
- The render context.
- oldVisual - Visual
- The visual that has been created in the call to createVisual.
- port - IPort
- The port to which this style instance is assigned.
Returns
- ↪Visual?
- The visual as required by the createVisual interface.