Package com.myscript.iink
Class ToolController
java.lang.Object
com.myscript.iink.ToolController
- All Implemented Interfaces:
AutoCloseable
The ToolController manages pointer tools configuration.
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
close()
protected void
finalize()
final @Nullable PointerTool
getToolForType
(@NotNull PointerType type) Returns the tool associated with a pointer type.final @Nullable String
getToolStyle
(@NotNull PointerTool tool) Returns the CSS style properties associated with a pointer tool.final @Nullable String
getToolStyleClasses
(@NotNull PointerTool tool) Returns the style classes associated with a pointer tool.final boolean
isClosed()
Tells whether theclose()
method has been called.final void
setToolForType
(@NotNull PointerType type, @NotNull PointerTool tool) Sets the tool associated with a pointer type.final void
setToolStyle
(@NotNull PointerTool tool, @NotNull String style) Sets the CSS style properties associated with a pointer tool.final void
setToolStyleClasses
(@NotNull PointerTool tool, @NotNull String styleClasses) Sets the style classes associated with a pointer tool.@NotNull String
toString()
Returns a String representation of the object, with the current mapping of pointer tools and types.
-
Method Details
-
finalize
-
close
public final void close()- Specified by:
close
in interfaceAutoCloseable
-
isClosed
public final boolean isClosed()Tells whether theclose()
method has been called. Once an object is closed any method will throwIllegalStateException
.- Returns:
true
if this object is closed.
-
getToolForType
Returns the tool associated with a pointer type.- Parameters:
type
- the pointer type.- Returns:
- the pointer tool associated with this type.
- Throws:
IllegalStateException
- when this tool controller is closed.IllegalArgumentException
- whentype
is unknown.
-
setToolForType
public final void setToolForType(@NotNull @NotNull PointerType type, @NotNull @NotNull PointerTool tool) Sets the tool associated with a pointer type.- Parameters:
type
- the pointer type.tool
- the pointer tool.- Throws:
IllegalStateException
- when this tool controller is closed.IllegalStateException
- when a pointer event sequence is in progress with this pointer type.IllegalArgumentException
- whentype
is unknown.IllegalArgumentException
- whentool
is unknown.
-
getToolStyle
Returns the CSS style properties associated with a pointer tool.- Parameters:
tool
- the pointer tool.- Returns:
- the CSS style properties associated with this pointer tool.
- Throws:
IllegalStateException
- when this tool controller is closed.IllegalArgumentException
- whentool
is unknown.
-
setToolStyle
Sets the CSS style properties associated with a pointer tool.- Parameters:
tool
- the pointer tool.style
- the tool CSS style properties.- Throws:
IllegalStateException
- when this tool controller is closed.IllegalStateException
- when a pointer event sequence is in progress with this pointer type.IllegalArgumentException
- whentool
is unknown.
-
getToolStyleClasses
Returns the style classes associated with a pointer tool.- Parameters:
tool
- the pointer tool.- Returns:
- the style classes associated with this pointer tool.
- Throws:
IllegalStateException
- when this tool controller is closed.IllegalArgumentException
- whentool
is unknown.
-
setToolStyleClasses
public final void setToolStyleClasses(@NotNull @NotNull PointerTool tool, @NotNull @NotNull String styleClasses) Sets the style classes associated with a pointer tool. Note: style properties provided via `setToolStyle()` may override the styling associated with the style classes provided here.- Parameters:
tool
- the pointer tool.styleClasses
- the style class names, separated by spaces.- Throws:
IllegalStateException
- when this tool controller is closed.IllegalArgumentException
- whentool
is unknown.
-
toString
Returns a String representation of the object, with the current mapping of pointer tools and types.
-