Package com.myscript.iink
Class ToolController
- java.lang.Object
-
- com.myscript.iink.ToolController
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class ToolController extends java.lang.Object implements java.lang.AutoCloseableThe ToolController manages pointer tools configuration.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()protected voidfinalize()@Nullable PointerToolgetToolForType(@NotNull PointerType type)Returns the tool associated with a pointer type.@Nullable java.lang.StringgetToolStyle(@NotNull PointerTool tool)Returns the CSS style properties associated with a pointer tool.@Nullable java.lang.StringgetToolStyleClasses(@NotNull PointerTool tool)Returns the style classes associated with a pointer tool.booleanisClosed()Tells whether theclose()method has been called.voidsetToolForType(@NotNull PointerType type, @NotNull PointerTool tool)Sets the tool associated with a pointer type.voidsetToolStyle(@NotNull PointerTool tool, @NotNull java.lang.String style)Sets the CSS style properties associated with a pointer tool.voidsetToolStyleClasses(@NotNull PointerTool tool, @NotNull java.lang.String styleClasses)Sets the style classes associated with a pointer tool.
-
-
-
Method Detail
-
finalize
protected void finalize() throws java.lang.Throwable- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable
-
close
public final void close()
- Specified by:
closein interfacejava.lang.AutoCloseable
-
isClosed
public final boolean isClosed()
Tells whether theclose()method has been called. Once an object is closed any method will throwIllegalStateException.- Returns:
trueif this object is closed.
-
getToolForType
@Nullable public final @Nullable PointerTool getToolForType(@NotNull @NotNull PointerType type)
Returns the tool associated with a pointer type.- Parameters:
type- the pointer type.- Returns:
- the pointer tool associated with this type.
- Throws:
java.lang.IllegalStateException- when this tool controller is closed.java.lang.IllegalArgumentException- whentypeis 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:
java.lang.IllegalStateException- when this tool controller is closed.java.lang.IllegalStateException- when a pointer event sequence is in progress with this pointer type.java.lang.IllegalArgumentException- whentypeis unknown.java.lang.IllegalArgumentException- whentoolis unknown.
-
getToolStyle
@Nullable public final @Nullable java.lang.String getToolStyle(@NotNull @NotNull PointerTool tool)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:
java.lang.IllegalStateException- when this tool controller is closed.java.lang.IllegalArgumentException- whentoolis unknown.
-
setToolStyle
public final void setToolStyle(@NotNull @NotNull PointerTool tool, @NotNull @NotNull java.lang.String style)Sets the CSS style properties associated with a pointer tool.- Parameters:
tool- the pointer tool.style- the tool CSS style properties.- Throws:
java.lang.IllegalStateException- when this tool controller is closed.java.lang.IllegalStateException- when a pointer event sequence is in progress with this pointer type.java.lang.IllegalArgumentException- whentoolis unknown.
-
getToolStyleClasses
@Nullable public final @Nullable java.lang.String getToolStyleClasses(@NotNull @NotNull PointerTool tool)Returns the style classes associated with a pointer tool.- Parameters:
tool- the pointer tool.- Returns:
- the style classes associated with this pointer tool.
- Throws:
java.lang.IllegalStateException- when this tool controller is closed.java.lang.IllegalArgumentException- whentoolis unknown.
-
setToolStyleClasses
public final void setToolStyleClasses(@NotNull @NotNull PointerTool tool, @NotNull @NotNull java.lang.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:
java.lang.IllegalStateException- when this tool controller is closed.java.lang.IllegalArgumentException- whentoolis unknown.
-
-