pureweb.client.collaboration. AcetateTool

The AcetateTool class manages an acetate tool delegate that does the actual work of creating and rendering markup. For more information on the acetate functionality, see the the AcetateToolDelegate interface.

Method Summary

activate
Activates the acetate tool for the specified view.
cancelMode
Cancels any mode that the tool is in, and ends its current markup.
canGenerateMarkup
Returns a Boolean value that indicates whether this instance can generate markup.
deactivate
Deactivates the acetate tool for the specified view.
draw
Draws any data specified in markup.
finishMarkup
Finishes any markup in the specified markup instance, forcing the CollaborationManager to be updated.
getCollaborationManager
Returns the CollaborationManager instance associated with the active view.
getMarkupType
Returns the markup type.
getView
Returns the view that this tool is associated with, or null if the tool is not activated.
getViewName
Returns the name of the view that this tool is associated with, or null if there is no view associated with the tool.
isMarkupInstanceStarted
Returns a Boolean value that indicates whether a markup instance has been started.
isMutuallyExclusive
Returns a Boolean value that indicates whether this tool is mutually exclusive with others.
isOneShot
Returns a Boolean value that indicates whether this instance is a one-shot tool.
onActivated
Called when a view is connected and the CollaborationManager instance is initialized.
onDeactivated
Called when a view is disconnected or the CollaborationManager instance is uninitialized.
onViewKeyboardEvent
Called when the view queues a keyboard event and the CollaborationManager is initialized.
onViewMouseEvent
Called when the view queues a mouse event and the CollaborationManager instance is initialized.
removeMarkup
Removes markup for the current markup instance, if any.
startMarkup
Starts new markup; the CollaborationManager instance will be updated.
updateMarkup
Updates the markup.
updatePendingMarkup
Updates any pending markup to the CollaborationManager instance.

Constructor

new AcetateTool(delegate)

Initializes a new instance of AcetateTool.
Parameters:
Name Type Description
delegate pureweb.client.collaboration.AcetateToolDelegate An AcetateToolDelegate instance that this tool uses to draw.

Method Detail

activate(view)

Activates the acetate tool for the specified view. The tool should connect to any view events and other information sources.
Parameters:
Name Type Description
view pureweb.client.View The view for which to activate the tool.

cancelMode()

Cancels any mode that the tool is in, and ends its current markup.

canGenerateMarkup() → {boolean}

Returns a Boolean value that indicates whether this instance can generate markup. If this returns false, no markup commands should be issued against the CollaborationManager.

deactivate(view)

Deactivates the acetate tool for the specified view. The tool should disconnect from any view events and other information sources.
Parameters:
Name Type Description
view pureweb.client.View The view for which to deactivate the tool.

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

Draws any data specified in markup. The surface Canvas will not retain any children between draw invocations. To avoid creating new draw objects on each call, you may consider using a ToolDrawObjectCache, which can store drawing objects based on session ID, view name, and an arbitrary object name.

The drawing operation is carried out independently of any view that the tool is currently activated for, so the tool should not base drawing on the current activation context.

This method is optional and will be ignored if not implemented.
Parameters:
Name Type Description
layer pureweb.client.collaboration.CollaborationLayer The layer.
sessionId string The session's unique identifier.
instanceId string The instance's unique identifier.
markup Element The markup.
defaultColor pureweb.PureWebColor The default color.

finishMarkup(markup)

Finishes any markup in the specified markup instance, forcing the CollaborationManager to be updated.
Parameters:
Name Type Description
markup Element The instance for which to finish markup.

getCollaborationManager() → {pureweb.client.CollaborationManager}

Returns the CollaborationManager instance associated with the active view.

getMarkupType() → {string}

Returns the markup type. This must be unique for each type of tool, and identifies the schema of the draw data consumed and generated by this tool.

getView() → {pureweb.client.View}

Returns the view that this tool is associated with, or null if the tool is not activated.

getViewName() → {string}

Returns the name of the view that this tool is associated with, or null if there is no view associated with the tool.

isMarkupInstanceStarted() → {boolean}

Returns a Boolean value that indicates whether a markup instance has been started. Will return true if it has, or false otherwise.

isMutuallyExclusive() → {boolean}

Returns a Boolean value that indicates whether this tool is mutually exclusive with others. Will return true if it is, and false otherwise.

isOneShot() → {boolean}

Returns a Boolean value that indicates whether this instance is a one-shot tool. Will return true if it is, and false otherwise. A one-shot tool does not stay activated; it is immediately deactivated after activation.

onActivated()

Called when a view is connected and the CollaborationManager instance is initialized. Mouse and Keyboard events are already connected to the view; any additional event handlers should be disconnected here.

onDeactivated()

Called when a view is disconnected or the CollaborationManager instance is uninitialized. Mouse and Keyboard events are already disconnected from the view; any additional event handlers should be disconnected here. No markup should be generated in this method, since the view may be disconnected, or the CollaborationManager not initialized.

onViewKeyboardEvent(event)

Called when the view queues a keyboard event and the CollaborationManager is initialized.
Parameters:
Name Type Description
event The keyboard event object containing the event data.

onViewMouseEvent(event)

Called when the view queues a mouse event and the CollaborationManager instance is initialized. The mouse coordinates are in image coordinate space, not view coordinate space.
Parameters:
Name Type Description
event The mouse event object containing the event data.

removeMarkup()

Removes markup for the current markup instance, if any.

startMarkup(initialMarkup, forceNewInstance)

Starts new markup; the CollaborationManager instance will be updated.
Parameters:
Name Type Description
initialMarkup Element The initial markup.
forceNewInstance boolean Set to true to force a new markup instance to be created, otherwise set to false.

updateMarkup(markup)

Updates the markup. The CollaborationManager may not be updated immediately. A reference to the markup is stored, not a copy, so any changes to the referenced value will be captured when the CollaborationManager is eventually updated.
Parameters:
Name Type Description
markup Element The markup instance to update.

updatePendingMarkup()

Updates any pending markup to the CollaborationManager instance.