Packagecom.adobe.rtc.pods.sharedWhiteBoardClasses
Classpublic class SharedWBModel
InheritanceSharedWBModel Inheritance WBModel Inheritance flash.events.EventDispatcher
ImplementsISessionSubscriber

SharedWhiteBoardModel is a model component which drives the SharedWhiteBoard pod. Its job is to keep the shared state of the whiteboard synchronized across multiple users using an internal CollectionNode. It exposes methods for manipulating that shared model as well as events indicating when that model changes. In general, user with the publisher role and higher can both add new messages and with viewer role or higher can view all messages.

See also

com.adobe.rtc.pods.SharedWhiteBoard
com.adobe.rtc.sharedModel.CollectionNode


Public Properties
 PropertyDefined by
  connectSession : IConnectSession
The IConnectSession with which this component is associated.
SharedWBModel
  isSynchronized : Boolean
[read-only] Dispatches when the collectionNode is synchronized.
SharedWBModel
  sessionDependent : Boolean = false
Determines if the model is session dependant
SharedWBModel
  sharedCursorPane : SharedCursorPane
SharedCursorPane for the whiteboard
SharedWBModel
  sharedID : String
The sharedID is the ID of the class
SharedWBModel
Public Methods
 MethodDefined by
  
Constructor
SharedWBModel
  
API for adding an existing shape with a shape ID to the canvas.
SharedWBModel
  
canUserDraw(p_userID:String):Boolean
returns if an user can create/add a shape
SharedWBModel
  
changeShapeProperties(p_shapeID:String, p_properties:*):void
API for changing shapeID and property Data
SharedWBModel
  
close():void
Disposes all listeners to the network and framework classes.
SharedWBModel
  
API for creating a new shape.
SharedWBModel
  
getIsAdded(p_shapeID:String):Boolean
returns if the shape is already added to the canvas...
SharedWBModel
  
Gets the NodeConfiguration on a specific node in the WhiteBoardmodel.
SharedWBModel
  
Returns the shape with the given shape ID if it exists
SharedWBModel
  
getShapeIDs():Array
Returns array of all shape IDs of shapes currently in the whiteboard
SharedWBModel
  
getUserRole(p_userID:String):int
User Role of an user who can access/publish on the shared white board model
SharedWBModel
  
modifyShapeDescriptor(p_shapeID:String, p_newShapeDescriptor:WBShapeDescriptor):void
API for changing properties and attributes of the Shape.
SharedWBModel
  
moveSizeRotateShape(p_shapeID:String, p_x:Number, p_y:Number, p_w:Number, p_h:Number, p_rotation:int, p_allowLocalChange:Boolean = false):void
API for changing shape layout like x,y position width, height, rotation.
SharedWBModel
 Inherited
Remove all shapes
WBModel
  
removeShape(p_shapeID:String):void
API for removing a shape with a given shape ID
SharedWBModel
  
setNodeConfiguration(p_nodeName:String, p_nodeConfiguration:NodeConfiguration):void
Sets the NodeConfiguration on a already defined node in WhiteBoardmodel.
SharedWBModel
  
setUserRole(p_userID:String, p_role:Number, p_nodeName:String = null):void
When called by an owner, setUserRole() sets the role of the specified user on a specific node or the collection Node itself.
SharedWBModel
  
subscribe():void
Tells the component to begin synchronizing with the service.
SharedWBModel
Events
 EventSummaryDefined by
    SharedWBModel
   Dispatched when the shape is added SharedWBModel
 Inherited Dispatched when the shape is added to the canvas of the whiteboard WBModel
   Dispatched when the shape is first created SharedWBModel
 Inherited Dispatched when the shape is first created WBModel
   Dispatched when the layout of shape i.e.SharedWBModel
 Inherited Dispatched when the layout of shape i.e.WBModel
   Dispatched when the propertyData of a shape changes SharedWBModel
 Inherited Dispatched when the propertyData of a shape changes WBModel
   Dispatched when a shape for e.g.SharedWBModel
 Inherited Dispatched when a shape for e.g.WBModel
   Dispatched when the SharedWhiteBoardModel has fully connected and synchronized with the service or when it loses that connection.SharedWBModel
 Inherited Dispatched when the SharedWhiteBoardModel has fully connected and synchronized with the service or when it loses that connection.WBModel
Property detail
connectSessionproperty
connectSession:IConnectSession  [read-write]

The IConnectSession with which this component is associated. Note that this may only be set once before subscribe is called; re-sessioning of components is not supported. Defaults to the first IConnectSession created in the application.

Implementation
    public function get connectSession():IConnectSession
    public function set connectSession(value:IConnectSession):void
isSynchronizedproperty 
isSynchronized:Boolean  [read-only]

Dispatches when the collectionNode is synchronized.

This property can be used as the source for data binding.

Implementation
    public function get isSynchronized():Boolean
sessionDependentproperty 
public var sessionDependent:Boolean = false

Determines if the model is session dependant

sharedCursorPaneproperty 
sharedCursorPane:SharedCursorPane  [read-write]

SharedCursorPane for the whiteboard

Implementation
    public function get sharedCursorPane():SharedCursorPane
    public function set sharedCursorPane(value:SharedCursorPane):void

See also

sharedIDproperty 
sharedID:String  [read-write]

The sharedID is the ID of the class

Implementation
    public function get sharedID():String
    public function set sharedID(value:String):void
Constructor detail
SharedWBModel()constructor
public function SharedWBModel()

Constructor

Method detail
addShape()method
public override function addShape(p_shape:WBShapeDescriptor):void

API for adding an existing shape with a shape ID to the canvas. Input is the shapeDescriptor

Parameters
p_shape:WBShapeDescriptor
canUserDraw()method 
public function canUserDraw(p_userID:String):Boolean

returns if an user can create/add a shape

Parameters
p_userID:String

Returns
Boolean
changeShapeProperties()method 
public override function changeShapeProperties(p_shapeID:String, p_properties:*):void

API for changing shapeID and property Data

Parameters
p_shapeID:String
 
p_properties:*
close()method 
public function close():void

Disposes all listeners to the network and framework classes. Recommended for proper garbage collection of the component.

createShape()method 
public override function createShape(p_shape:WBShapeDescriptor):void

API for creating a new shape. Input is a shapedescriptor object. The shape ID is assigned from the server

Parameters
p_shape:WBShapeDescriptor
getIsAdded()method 
public override function getIsAdded(p_shapeID:String):Boolean

returns if the shape is already added to the canvas...

Parameters
p_shapeID:String

Returns
Boolean
getNodeConfiguration()method 
public function getNodeConfiguration(p_nodeName:String):NodeConfiguration

Gets the NodeConfiguration on a specific node in the WhiteBoardmodel. If the node is not defined, it will return null

Parameters
p_nodeName:String — The name of the node.

Returns
NodeConfiguration
getShapeDescriptor()method 
public override function getShapeDescriptor(p_shapeID:String):WBShapeDescriptor

Returns the shape with the given shape ID if it exists

Parameters
p_shapeID:String

Returns
WBShapeDescriptor
getShapeIDs()method 
public override function getShapeIDs():Array

Returns array of all shape IDs of shapes currently in the whiteboard

Returns
Array
getUserRole()method 
public function getUserRole(p_userID:String):int

User Role of an user who can access/publish on the shared white board model

Parameters
p_userID:String — UserID of the user whose role we get to have

Returns
int
modifyShapeDescriptor()method 
public override function modifyShapeDescriptor(p_shapeID:String, p_newShapeDescriptor:WBShapeDescriptor):void

API for changing properties and attributes of the Shape. Ensure that all the properties of the shape are set for expected behaviour

Parameters
p_shapeID:String
 
p_newShapeDescriptor:WBShapeDescriptor
moveSizeRotateShape()method 
public override function moveSizeRotateShape(p_shapeID:String, p_x:Number, p_y:Number, p_w:Number, p_h:Number, p_rotation:int, p_allowLocalChange:Boolean = false):void

API for changing shape layout like x,y position width, height, rotation.

Parameters
p_shapeID:String
 
p_x:Number
 
p_y:Number
 
p_w:Number
 
p_h:Number
 
p_rotation:int
 
p_allowLocalChange:Boolean (default = false)
removeShape()method 
public override function removeShape(p_shapeID:String):void

API for removing a shape with a given shape ID

Parameters
p_shapeID:String
setNodeConfiguration()method 
public function setNodeConfiguration(p_nodeName:String, p_nodeConfiguration:NodeConfiguration):void

Sets the NodeConfiguration on a already defined node in WhiteBoardmodel. If the node is not defined, it will not do anything.

Parameters
p_nodeName:String — The node Configuration on a node in the NodeConfiguration.
 
p_nodeConfiguration:NodeConfiguration — The name of the node.
setUserRole()method 
public function setUserRole(p_userID:String, p_role:Number, p_nodeName:String = null):void

When called by an owner, setUserRole() sets the role of the specified user on a specific node or the collection Node itself. The following rules apply:

Parameters
p_userID:String — The userID of the user to set the role for.
 
p_role:Number — The new role for that user.
 
p_nodeName:String (default = null) — The nodename, if nothing is specified , it sets on the complete collectionNode
subscribe()method 
public function subscribe():void

Tells the component to begin synchronizing with the service. For "headless" components such as this one, this method must be called explicitly.

Event detail
myRoleChangeevent 
Event object type: com.adobe.events.WBModelEvent

shapeAddevent  
Event object type: com.adobe.events.WBModelEvent

Dispatched when the shape is added

shapeCreateevent  
Event object type: com.adobe.events.WBModelEvent

Dispatched when the shape is first created

shapePositionSizeRotationChangeevent  
Event object type: com.adobe.events.WBModelEvent

Dispatched when the layout of shape i.e. height, width, rotation angle changes

shapePropertiesChangeevent  
Event object type: com.adobe.events.WBModelEvent

Dispatched when the propertyData of a shape changes

shapeRemoveevent  
Event object type: com.adobe.events.WBModelEvent

Dispatched when a shape for e.g. an ellipse, rectangle is removed.

synchronizationChangeevent  
Event object type: com.adobe.rtc.events.CollectionNodeEvent

Dispatched when the SharedWhiteBoardModel has fully connected and synchronized with the service or when it loses that connection.





 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/labs/acrobatcom/com/adobe/rtc/pods/sharedWhiteBoardClasses/SharedWBModel.html