Packageorg.igniterealtime.xiff.data.whiteboard
Classpublic class Path
InheritancePath Inheritance XMLStanza Inheritance ExtensionContainer Inheritance Object

A message extension for whiteboard 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
  xml : XML
[override]
Path
Public Methods
 MethodDefined By
  
Path(parent:XML = null)
Path
 Inherited
Add extension to the list of the given namespace and insert to the XML element as a child.
ExtensionContainer
  
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
 Inherited
ExtensionContainer
 Inherited
getAllExtensionsByNS(nameSpace:String):Array
ExtensionContainer
 Inherited
getAttribute(name:String):String
Convinience method for getting element value from the XML.
XMLStanza
 Inherited
getChildAttribute(elem:String, name:String):String
Convinience method for getting child element attribute value from the XML.
XMLStanza
 Inherited
getChildField(elem:String, name:String):String
Convinience method for getting child element value from the XML.
XMLStanza
 Inherited
getExtension(elementName:String):IExtension
Get the extension having the given element name.
ExtensionContainer
 Inherited
getField(name:String):String
Convinience method for getting element value from the XML.
XMLStanza
 Inherited
removeAllExtensions(nameSpace:String):void
ExtensionContainer
 Inherited
removeExtension(extension:IExtension):Boolean
ExtensionContainer
 Inherited
removeFields(name:String):void
Helper method for removing all child elements that have the given name.
XMLStanza
  
serialize(parent:XML):Boolean
TODO: make as set xml 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
 Inherited
setAttribute(name:String, value:String):void
Convinience method for setting a value to a element in the XML.
XMLStanza
 Inherited
setChildAttribute(elem:String, name:String, value:String):void
Convinience method for setting an attribute for a child element of the XML.
XMLStanza
 Inherited
setChildField(elem:String, name:String, value:String):void
Convinience method for setting a value for a child element of the XML.
XMLStanza
 Inherited
setField(name:String, value:String):void
Convinience method for setting a value to a element in the XML.
XMLStanza
 Inherited
toString():String
Converts the base stanza XML to a string.
XMLStanza
Public Constants
 ConstantDefined By
 InheritedDEFAULT_NS : Namespace
[static] Default XML namespace.
XMLStanza
  ELEMENT_NAME : String = path
[static]
Path
 InheritedFLASH_NS : Namespace
[static]
XMLStanza
 InheritedSTREAM_NS : Namespace
[static]
XMLStanza
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

xmlproperty 
xml:XML[override]


Implementation
    public function get xml():XML
    public function set xml(value:XML):void
Constructor Detail
Path()Constructor
public function Path(parent:XML = null)

Parameters
parent:XML (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

serialize()method 
public function serialize(parent:XML):Boolean

TODO: make as set xml Serializes the Path data to XML for sending.

Parameters

parent:XML — 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