public abstract class AcetateToolBase extends java.lang.Object implements AcetateTool, PendingMarkupProvider
About Acetate Tools
PureWeb's acetate functionality allows you to display an overlay over views for markup purposes;
this can enhance the collaboration experience by allowing each participant to see what the
other participants are doing. The API provides two tools by default,
cursor (CursorPositionTool
)
and polyline (PolylineTool
).
The cursor tool displays an arrow indicating where a user's mouse is pointing
(if the user is collaborating from a desktop device).
The polyline tool displays a user's free-form drawings over a view.
By default, acetate tools are not mutually exclusive: you can display cursors and polyline
drawings (or any other markups from custom tools) simultaneously in the same view,
although this is customizable by setting the
isMutuallyExclusive
property.
The AcetateToolset
class is responsible
for managing which tools are active in a view at any given time and for broadcasting to the
view the event raised in the acetate.
To clear markups once they are no longer needed, you would use the methods provided in
ClearMarkupTool
.
Modifier | Constructor and Description |
---|---|
protected |
AcetateToolBase()
Creates and initializes an instance of
AcetateToolBase . |
Modifier and Type | Method and Description |
---|---|
void |
activate(ViewProxy view)
Activates the acetate tool for the specified view.
|
void |
cancelMode()
Cancels any mode that the tool is in, and ends its current markup.
|
protected boolean |
canGenerateMarkup()
Returns a Boolean value that indicates whether this instance can generate markup.
|
void |
deactivate(ViewProxy v)
Deactivates the acetate tool for the specified view.
|
protected void |
finishMarkup(org.jdom.Element markup)
Finishes any markup, forcing the
CollaborationManager to be updated. |
protected CollaborationManager |
getCollaborationManager()
Returns the
CollaborationManager instance associated with the active view. |
protected ToolDrawObjectCache |
getDrawObjectCache()
Returns the draw object cache.
|
abstract java.lang.String |
getMarkupType()
Returns the markup type.
|
protected ViewProxy |
getView()
Returns the view that the tool is associated with, represented as an instance
of
ViewProxy . |
protected java.lang.String |
getViewName()
Returns the name of the view.
|
protected boolean |
isMarkupInstanceStarted()
Returns a Boolean value that indicates whether a markup instance is started.
|
boolean |
isMutuallyExclusive()
Returns a Boolean value that indicates whether this tool is mutually exclusive with others.
|
boolean |
isOneShot()
Returns a Boolean value that indicates whether this instance is a one-shot tool.
|
protected void |
onActivated()
Called when a view is connected and
CollaborationManager is initialized. |
protected void |
onDeactivated()
Called when a view is disconnected or
CollaborationManager is uninitialized. |
protected void |
onViewKeyboardEvent(PureWebKeyboardEventArgs e)
Called when the view queues a keyboard event and
CollaborationManager is initialized. |
protected void |
onViewMouseEvent(PureWebMouseEventArgs e)
Called when the view queues a mouse event and
CollaborationManager is initialized. |
protected void |
removeMarkup()
Removes markup for the current markup instance, if any.
|
protected void |
startMarkup(org.jdom.Element initialMarkup,
boolean forceNewInstance)
Starts new markup; the
CollaborationManager will be updated. |
protected void |
updateMarkup(org.jdom.Element markup)
Updates the markup.
|
void |
updatePendingMarkup()
Publishes any pending markup to the
CollaborationManager . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
draw
protected AcetateToolBase()
AcetateToolBase
.protected boolean isMarkupInstanceStarted()
true
if it is, or false
otherwise.protected void startMarkup(org.jdom.Element initialMarkup, boolean forceNewInstance)
CollaborationManager
will be updated.
May only be called on the UI thread.initialMarkup
- The initial markup.forceNewInstance
- Set to true
to force a new markup instance to
be created, or set to false
otherwise.protected void finishMarkup(org.jdom.Element markup)
CollaborationManager
to be updated.
May only be called on the UI thread.markup
- The markup to finish.protected void removeMarkup()
protected void updateMarkup(org.jdom.Element markup)
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 CollaborationManager
is eventually updated.
May only be called on the UI thread.
markup
- The markup to update.protected ToolDrawObjectCache getDrawObjectCache()
protected CollaborationManager getCollaborationManager()
CollaborationManager
instance associated with the active view.protected ViewProxy getView()
ViewProxy
.protected java.lang.String getViewName()
protected boolean canGenerateMarkup()
If this returns false
, no markup commands should be issued against
CollaborationManager
.
protected void onActivated()
CollaborationManager
is initialized.
Mouse and keyboard events are already connected to the view;
any additional event handlers should be disconnected here.protected void onDeactivated()
CollaborationManager
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.protected void onViewMouseEvent(PureWebMouseEventArgs e)
CollaborationManager
is initialized.
The mouse coordinates are in image coordinate space, not view coordinate space.e
- The PureWebMouseEventArgs
instance containing the event data.protected void onViewKeyboardEvent(PureWebKeyboardEventArgs e)
CollaborationManager
is initialized.e
- The PureWebMouseEventArgs
instance containing the event data.public abstract java.lang.String getMarkupType()
AcetateTool
getMarkupType
in interface AcetateTool
public void cancelMode()
AcetateTool
cancelMode
in interface AcetateTool
public void activate(ViewProxy view)
AcetateTool
activate
in interface AcetateTool
view
- The view, represented by a ViewProxy
instance.public void deactivate(ViewProxy v)
AcetateTool
deactivate
in interface AcetateTool
v
- The view, represented by a ViewProxy
instance.public boolean isMutuallyExclusive()
AcetateTool
true
if it is, or false
otherwise.isMutuallyExclusive
in interface AcetateTool
public boolean isOneShot()
AcetateTool
true
if it is, or false
otherwise.
A one-shot tool does not stay activated; it is immediately deactivated after activation.isOneShot
in interface AcetateTool
public void updatePendingMarkup()
PendingMarkupProvider
CollaborationManager
.updatePendingMarkup
in interface PendingMarkupProvider
© 2010 - 2018 Calgary Scientific Inc. All Rights Reserved.
This documentation shall not wholly or in part, in any form or by any means, electronic, mechanical, including photocopying, be reproduced or transmitted without the authorized, written consent of Calgary Scientific.