Class: StyleToolbar

OSDPaperjsAnnotation.StyleTool.StyleToolbar(tool)

Represents the toolbar for the StyleTool class. Provides user interface elements for modifying annotation styles. Inherits functionality from the AnnotationUIToolbarBase class.

Constructor

new StyleToolbar(tool)

Create a new instance of the StyleToolbar class.
Parameters:
Name Type Description
tool StyleTool The associated StyleTool instance.
Source:

Extends

  • AnnotationUIToolbarBase

Methods

fromAverage(type)

Handle color selection based on area average.
Parameters:
Name Type Description
type string The type of style ('fill' or 'stroke').
Source:

isEnabledForMode(mode) → {boolean}

Check if the toolbar is enabled for the given mode.
Parameters:
Name Type Description
mode string The current annotation mode.
Source:
Returns:
- True if the toolbar is enabled for the mode, otherwise false.
Type
boolean

setFillButtonColor(coloropt)

Set the color and text of the Fill button.
Parameters:
Name Type Attributes Description
color paper.Color <optional>
The color to set for the Fill button. Defaults to white.
Source:

setFillButtonOpacity(val)

Set the opacity of the Fill button.
Parameters:
Name Type Description
val number The opacity value to set for the Fill button.
Source:

setStrokeButtonColor(coloropt)

Set the color and text of the Stroke button.
Parameters:
Name Type Attributes Description
color paper.Color <optional>
The color to set for the Stroke button. Defaults to black.
Source:

setStrokeButtonOpacity(val)

Set the opacity of the Stroke button.
Parameters:
Name Type Description
val number The opacity value to set for the Stroke button.
Source:

uiHTML() → {string}

Generate the HTML structure of the UI elements.
Source:
Returns:
- The HTML structure of the UI.
Type
string

updateDisplay()

Update the displayed style settings in the toolbar.
Source:

updateTargetDescription()

Update the displayed description of the target items.
Source: