A foundational implementation of ILabelStyle that delegates its behavior to several style instances.
Implements
- I
- I
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 label.
- determining if a label is within a rectangular marquee selection area.
- determining if a label is within a lasso selection path.
The following aspects will be delegated to the first/main style, only:
This class can be subclassed like LabelStyleBase<TVisual> to allow for custom implementations of the various aspects of the delegation.
See Also
Developer's Guide
Members
Show:
Constructors
Creates a new instance of this style.
Creates a new instance of this style.
Parameters
- mainStyle: ILabelStyle
- The main style which will be rendered first and to which all requests will delegate to.
- additionalStyles: ILabelStyle
- 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
Defined in
LabelStyleBase.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
LabelStyleBase.cloneCreates the visual by delegating to all styles.
Creates the visual by delegating to all styles.
protected
Parameters
- context: IRenderContext
- The render context.
- label: ILabel
- The label to which this style instance is assigned.
Return Value
- Visual
- The visual as required by the createVisual interface.
See Also
API
- updateVisual
Overrides
LabelStyleBase.createVisualCalculates the bounds as the union of bounds from all styles.
Calculates the bounds as the union of bounds from all styles.
protected
Parameters
- context: ICanvasContext
- The canvas context.
- label: ILabel
- The label to which this style instance is assigned.
Return Value
- Rect
- The visual bounds of the visual representation.
Overrides
LabelStyleBase.getBoundsGets the size from the first style as the reference.
Gets the size from the first style as the reference.
protected
Parameters
- label: ILabel
- The label.
Return Value
- Size
- The preferred size for this label.
Overrides
LabelStyleBase.getPreferredSizeChecks 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.
- label: ILabel
- The label to which this style instance is assigned.
Return Value
- boolean
trueif the specified label is hit;falseotherwise.
Overrides
LabelStyleBase.isHitDetermines if the label is in the box based on any style.
Determines if the label is in the box based on any style.
protected
Parameters
- context: IInputModeContext
- The input mode context.
- rectangle: Rect
- The marquee selection box.
- label: ILabel
- The label to which this style instance is assigned.
Return Value
- boolean
trueif the specified label is visible and selected by the marquee rectangle;falseotherwise.
Overrides
LabelStyleBase.isInBoxDetermines if the label is in the path based on any style.
Determines if the label is in the path based on any style.
protected
Parameters
- context: IInputModeContext
- The input mode context.
- path: GeneralPath
- The lasso selection path.
- label: ILabel
- The label to which this style instance is assigned.
Return Value
- boolean
trueif the specified label is visible and selected by the lasso path;falseotherwise.
Overrides
LabelStyleBase.isInPathDetermines visibility based on the visibility of all styles.
Determines visibility based on the visibility of all styles.
protected
Parameters
- context: ICanvasContext
- The canvas context.
- rectangle: Rect
- The clipping rectangle.
- label: ILabel
- The label to which this style instance is assigned.
Return Value
- boolean
trueif the specified label is visible in the clipping rectangle;falseotherwise.
Overrides
LabelStyleBase.isVisiblePerforms a lookup using the first style as the reference.
Performs a lookup using the first style as the reference.
protected
Parameters
- label: ILabel
- The label to use for the context lookup.
- type: Constructor
- The type to query.
Return Value
- any
- An implementation of the
typeornull.
Overrides
LabelStyleBase.lookupUpdates the visual by delegating to all styles.
Updates the visual by delegating to all styles.
protected
Parameters
- context: IRenderContext
- The render context.
- oldVisual: Visual
- The visual that has been created in the call to createVisual.
- label: ILabel
- The label to which this style instance is assigned.
Return Value
- Visual
- The visual as required by the createVisual interface.
See Also
API
- createVisual