org.w3c.dom.svg
Interface SVGPath


public interface SVGPath

This interface represents an "SVGPath" datatype used to define the path geometry. Corresponds to SVG path specification or the "d" attribute.

The native implementations must support the following simplifications or canonicalization of path segments. Any simplifications should be lossless.

Since:
BlackBerry API 4.6.0

Field Summary
static short CLOSE
          Numeric value is ASCII code of the letter 'Z'.
static short CURVE_TO
          Numeric value is ASCII code of the letter 'C'.
static short LINE_TO
          Numeric value is ASCII code of the letter 'L'.
static short MOVE_TO
          Numeric value is ASCII code of the letter 'M'.
static short QUAD_TO
          Numeric value is ASCII code of the letter 'Q'.
 
Method Summary
 void close()
           Appends 'Z' (close path) segment to the path
 void curveTo(float x1, float y1, float x2, float y2, float x3, float y3)
           Appends 'C' (absolute cubic curve) segment to the path.
 int getNumberOfSegments()
           Return number of segments in this path.
 short getSegment(int cmdIndex)
           Returns segment command by zero-based command index.
 float getSegmentParam(int cmdIndex, int paramIndex)
           Returns segment parameter by zero-based command index and zero-based parameter index.
 void lineTo(float x, float y)
           Appends 'L' (absolute line) segment to the path with the specified coordinates.
 void moveTo(float x, float y)
           Appends 'M' (absolute move) segment to the path with the specified coordinates.
 void quadTo(float x1, float y1, float x2, float y2)
           Appends 'Q' (absolute quadratic curve) segment to the path.
 



Field Detail

MOVE_TO

static final short MOVE_TO
Numeric value is ASCII code of the letter 'M'.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

LINE_TO

static final short LINE_TO
Numeric value is ASCII code of the letter 'L'.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

CURVE_TO

static final short CURVE_TO
Numeric value is ASCII code of the letter 'C'.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

QUAD_TO

static final short QUAD_TO
Numeric value is ASCII code of the letter 'Q'.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

CLOSE

static final short CLOSE
Numeric value is ASCII code of the letter 'Z'.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0


Method Detail

getNumberOfSegments

int getNumberOfSegments()

Return number of segments in this path.

Returns:
the number of segments in this path.
Since:
BlackBerry API 4.6.0

getSegment

short getSegment(int cmdIndex)
                 throws DOMException

Returns segment command by zero-based command index. Returns one of MOVE_TO, LINE_TO, CURVE_TO, QUAD_TO or CLOSE.

Parameters:
cmdIndex - the command index for the segment command to retrieve.
Returns:
the segment command for the specified cmdIndex.
Throws:
DOMException - with error code INDEX_SIZE_ERR if segment index out of bounds.
Since:
BlackBerry API 4.6.0

getSegmentParam

float getSegmentParam(int cmdIndex,
                      int paramIndex)
                      throws DOMException

Returns segment parameter by zero-based command index and zero-based parameter index.

Parameters:
cmdIndex - the command index for the segment parameter to retrieve.
paramIndex - the parameter index for the segment parameter to retrieve.
Returns:
the segment parameter for the specified cmdIndex and paramIndex.
Throws:
DOMException - with error code INDEX_SIZE_ERR if segment index out of bounds or param index out of bounds for this segment's type.
Since:
BlackBerry API 4.6.0

moveTo

void moveTo(float x,
            float y)

Appends 'M' (absolute move) segment to the path with the specified coordinates.

Parameters:
x - the x-axis coordinate for the specified point.
y - the y-axis coordinate for the specified point.
Since:
BlackBerry API 4.6.0

lineTo

void lineTo(float x,
            float y)

Appends 'L' (absolute line) segment to the path with the specified coordinates.

Parameters:
x - the x-axis coordinate of the specified point.
y - the y-axis coordinate of the specified point.
Since:
BlackBerry API 4.6.0

quadTo

void quadTo(float x1,
            float y1,
            float x2,
            float y2)

Appends 'Q' (absolute quadratic curve) segment to the path.

Parameters:
x1 - the x-axis coordinate of the first control point.
y1 - the y-axis coordinate of the first control point.
x2 - the x-axis coordinate of the final end point.
y2 - the y-axis coordinate of the final end point.
Since:
BlackBerry API 4.6.0

curveTo

void curveTo(float x1,
             float y1,
             float x2,
             float y2,
             float x3,
             float y3)

Appends 'C' (absolute cubic curve) segment to the path.

Parameters:
x1 - the x-axis coordinate of the first control point.
y1 - the y-axis coordinate of the first control point.
x2 - the x-axis coordinate of the second end point.
y2 - the y-axis coordinate of the second end point.
x3 - the x-axis coordinate of the final end point.
y3 - the y-axis coordinate of the final end point.
Since:
BlackBerry API 4.6.0

close

void close()

Appends 'Z' (close path) segment to the path

Since:
BlackBerry API 4.6.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal