Packageorg.igniterealtime.xiff.data.whiteboard
Classpublic class Path
ImplementsISerializable

A message extension for whitboard exchange. This class is the base class for other extension classes such as Path



Public Properties
 PropertyDefined by
  fill : Fill
[read-only] The Fill object that contains the properties describing the fill of this path
Path
  segments : Array
[read-only] The read-only list of start and end points encoded as an array of objects with the format { from: { x: ###, y: ### }, to: { x: ###, y: ### } } You should not modify this list.
Path
  stroke : Stroke
[read-only] The Stroke object that contains the properties describing the stroke of this path
Path
Public Methods
 MethodDefined by
  
Path(parent:XMLNode = null)
Path
  
addPoints(from_x:Number, from_y:Number, to_x:Number, to_y:Number):Object
Another interface to add segments to this extension.
Path
  
addSegment(seg:Object):Object
Adds a start point and end point to this path.
Path
  
deserialize(node:XMLNode):Boolean
Deserializes the Path data.
Path
  
serialize(parent:XMLNode):Boolean
Serializes the Path data to XML for sending.
Path
  
Creates the compact form of the segments in the fomrmat defined by SVG Example: M100 200L14 -15 L 125 100L150 200 300 400M10 20L30 40 50 60 z
Path
Public Constants
 ConstantDefined by
  ELEMENT_NAME : String = "path"
[static]
Path
Property detail
fillproperty
fill:Fill  [read-only]

The Fill object that contains the properties describing the fill of this path

Implementation
    public function get fill():Fill

See also

segmentsproperty 
segments:Array  [read-only]

The read-only list of start and end points encoded as an array of objects with the format { from: { x: ###, y: ### }, to: { x: ###, y: ### } } You should not modify this list. Segments should be added with addSegment

Implementation
    public function get segments():Array

See also

strokeproperty 
stroke:Stroke  [read-only]

The Stroke object that contains the properties describing the stroke of this path

Implementation
    public function get stroke():Stroke

See also

Constructor detail
Path()constructor
public function Path(parent:XMLNode = null)Parameters
parent:XMLNode (default = null)
Method detail
addPoints()method
public function addPoints(from_x:Number, from_y:Number, to_x:Number, to_y:Number):Object

Another interface to add segments to this extension. Instead of passing an object, you can pass parameters that will be converted into a segment and passed to addSegment

Parameters
from_x:Number — the start x coordinate
 
from_y:Number — the start y coordinate
 
to_x:Number — the destination x coordinate
 
to_y:Number — the destination y coordinate

Returns
Object — the segment object created from the parameters with the rounded values from being modified in addSegment
addSegment()method 
public function addSegment(seg:Object):Object

Adds a start point and end point to this path. The points will be rounded to the nearest integer to save serialization space. 10.0000001 takes 4 times as much spaces as 10

Parameters
seg:Object — An object containing the properties "from" and "to" which are objects with the properties "x" and "y". An example would be { from: { x: 100, y: 200 }, to: { x: 200, y: 300 } }

Returns
Object — the segment parameter with the rounded values

See also

deserialize()method 
public function deserialize(node:XMLNode):Boolean

Deserializes the Path data.

Parameters
node:XMLNode — The XML node associated this data

Returns
Boolean — true if deserialization was successful
serialize()method 
public function serialize(parent:XMLNode):Boolean

Serializes the Path data to XML for sending.

Parameters
parent:XMLNode — The parent node that this extension should be serialized into

Returns
Boolean — An indicator as to whether serialization was successful
serializeSegments()method 
public function serializeSegments():String

Creates the compact form of the segments in the fomrmat defined by SVG Example: M100 200L14 -15 L 125 100L150 200 300 400M10 20L30 40 50 60 z

Returns
String — String containging the compact version
Constant detail
ELEMENT_NAMEconstant
public static const ELEMENT_NAME:String = "path"