pureweb.client.collaboration. AcetateToolset

The AcetateToolset class models a set of tools used for acetate markup.

An acetate toolset aggregates a collection of acetate tools with a collection of views that will use those tools. The toolset is designed to only dispatch view actions to a single active view. For more information on acetate functionality, see the AcetateToolDelegate interface.

Method Summary

activateTool
Activates the specified tool.
deactivateTool
Deactivates the specified tool.
draw
Triggers the toolset to draw a given tool to a given view.
getActivatedTools
Returns an array of the tools currently activated in the toolset.
getActiveView
Returns the active view for the toolset, or null if there is none.
getDeactivatedTools
Returns an array of the tools currently deactivated tools in the toolset.
getDefaultTool
Returns the default tool for the toolset.
getPendingMarkupDelay
Returns the interval at which acetate markup updates should be checked (in milliseconds).
getTools
Returns an array of all of the registered tools in the toolset.
lookupTool
Looks up the tool associated with the specified markup type.
registerTool
Registers the tool with the toolset.
registerToolDelegate
Registers the tool delegate with the toolset, and returns this tool.
setActiveView
Sets the active view for the toolset.
setDefaultTool
Set the default tool.
setPendingMarkupDelay
Sets the interval at which acetate markup updates should be checked.
unregisterTool
Unregisters the specified tool from the toolset.

Constructor

new AcetateToolset()

Initializes a new instance of AcetateToolset.

Extends

  • pureweb.events.EventTarget

Members

<static> EventType → string

Types of events for which client applications can listen on AcetateToolset.
Properties:
Name Type Default Description
TOOL_REGISTERED string The event that gets dispatched when a tool is registered with this toolset.
TOOL_UNREGISTERED string The event that gets dispatched when a tool is unregistered with this toolset.
TOOL_ACTIVATING string The event that gets dispatched before a tool in this toolset is activated.
TOOL_ACTIVATED string The event that gets dispatched after a tool in this toolset is activated.
TOOL_DEACTIVATED string The event that gets dispatched after a tool in this toolset is deactivated.
ACTIVE_VIEW_CHANGED string The event that gets dispatched before a new view becomes the active view for this toolset, but after the previous active view has been deactivated.
DEFAULT_TOOL_CHANGED string The event that gets dispatched after the default tool in this toolset is changed.

Method Detail

activateTool(tool)

Activates the specified tool.
Parameters:
Name Type Description
tool pureweb.client.collaboration.AcetateTool The tool to activate.

deactivateTool(tool)

Deactivates the specified tool.
Parameters:
Name Type Description
tool pureweb.client.collaboration.AcetateTool The tool to deactivate.

draw(layer, sessionId, markupType, instanceId, markup, defaultColor)

Triggers the toolset to draw a given tool to a given view.
Parameters:
Name Type Description
layer pureweb.client.collaboration.CollaborationLayer The collaboration layer for a view.
sessionId string The unique identifier of the session providing acetate markup.
markupType string The acetate markup type (tool).
instanceId string The unique identifier of the acetate markup instance.
markup Element The acetate markup itself.
defaultColor pureweb.PureWebColor The default color for this session.

getActivatedTools() → {Array}

Returns an array of the tools currently activated in the toolset.

getActiveView() → {pureweb.client.View|null}

Returns the active view for the toolset, or null if there is none.

getDeactivatedTools() → {Array}

Returns an array of the tools currently deactivated tools in the toolset.

getDefaultTool() → {pureweb.client.collaboration.AcetateTool}

Returns the default tool for the toolset.

getPendingMarkupDelay() → {number}

Returns the interval at which acetate markup updates should be checked (in milliseconds). Default value is 100 ms.

getTools() → {Array}

Returns an array of all of the registered tools in the toolset.

lookupTool(markupType) → {pureweb.client.collaboration.AcetateTool|null}

Looks up the tool associated with the specified markup type. Will return a registered tool with that markup type, or null if none can be found.
Parameters:
Name Type Description
markupType string Type of the markup.

registerTool(tool)

Registers the tool with the toolset. Registered tools must also be activated before the draw method is called.
Parameters:
Name Type Description
tool pureweb.client.collaboration.AcetateTool The tool to register.

registerToolDelegate(toolDelegate) → {pureweb.client.collaboration.AcetateTool}

Registers the tool delegate with the toolset, and returns this tool. Registered tools must also be activated before the draw method is called.
Parameters:
Name Type Description
toolDelegate pureweb.client.collaboration.AcetateToolDelegate The tool to register.

setActiveView(view)

Sets the active view for the toolset. When the active view changes, all activated tools are deactived for the old view, reactivated for the new view, and then the active view changed event is fired.
Parameters:
Name Type Description
view pureweb.client.View The view to set as the active view.

setDefaultTool(tool)

Set the default tool. If set, this tool becomes activated automatically when all tools become deactivated. A one-shot tool cannot be the default tool.
Parameters:
Name Type Description
tool pureweb.client.collaboration.AcetateTool The tool to set as the default.

setPendingMarkupDelay(newMarkupDelayInterval)

Sets the interval at which acetate markup updates should be checked.
Parameters:
Name Type Description
newMarkupDelayInterval number The new markup interval (in milliseconds),

unregisterTool(tool)

Unregisters the specified tool from the toolset.
Parameters:
Name Type Description
tool pureweb.client.collaboration.AcetateTool The tool to unregister.