org.jivesoftware.xiff.data.whiteboard
class Path
Object
|
+--org.jivesoftware.xiff.data.whiteboard.Path
Implemented Interfaces: ISerializableclass Path extends Object
A message extension for whitboard exchange. This class is the base class for other extension classes such as Path
- Author:Sean Treadway
- Since:2.0.0
Property Summary
The Fill object that contains the properties describing the fill of this path
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
The Stroke object that contains the properties describing the stroke of this path
Method Summary
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
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
Deserializes the Path data.
Serializes the Path data to XML for sending.
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
Field Documentation
Property Documentation
fill
public fill: Fill (read-only)
The Fill object that contains the properties describing the fill of this path
- See also:
segments
public 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
- See also:
stroke
public stroke: Stroke (read-only)
The Stroke object that contains the properties describing the stroke of this path
- See also:
Constructor Documentation
Method Documentation
addPoints
public function addPoints (
from_x: Number,
from_y: Number,
to_x: Number,
to_y: Number): Object
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 the start x coordinate from_y the start y coordinate to_x the destination x coordinate to_y the destination y coordinate - Returns:the segment object created from the parameters with the rounded values from being modified in addSegment
addSegment
public function addSegment (
seg): 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 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:the segment parameter with the rounded values
- See also:
deserialize
public function deserialize (
node: XMLNode): Boolean
Deserializes the Path data.
- Specified by:deserialize in interface org.jivesoftware.xiff.data.ISerializable
- Parameters:
node The XML node associated this data - Returns:true if deserialization was successful
serialize
public function serialize (
parent: XMLNode): Boolean
Serializes the Path data to XML for sending.
- Specified by:serialize in interface org.jivesoftware.xiff.data.ISerializable
- Parameters:
parent The parent node that this extension should be serialized into - Returns:An indicator as to whether serialization was successful
serializeSegments
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 containging the compact version
- Path.as, Last Modified: 3/10/2005 10:13:40 PM