|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
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 |
---|
static final short MOVE_TO
static final short LINE_TO
static final short CURVE_TO
static final short QUAD_TO
static final short CLOSE
Method Detail |
---|
int getNumberOfSegments()
Return number of segments in this path.
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.
cmdIndex
- the command index for the segment command to retrieve.
DOMException
- with error code INDEX_SIZE_ERR if segment index out of bounds.float getSegmentParam(int cmdIndex, int paramIndex) throws DOMException
Returns segment parameter by zero-based command index and zero-based parameter index.
cmdIndex
- the command index for the segment parameter to retrieve.paramIndex
- the parameter index for the segment parameter to retrieve.
DOMException
- with error code INDEX_SIZE_ERR if segment index out
of bounds or param index out of bounds for this segment's type.void moveTo(float x, float y)
Appends 'M' (absolute move) segment to the path with the specified coordinates.
x
- the x-axis coordinate for the specified point.y
- the y-axis coordinate for the specified point.void lineTo(float x, float y)
Appends 'L' (absolute line) segment to the path with the specified coordinates.
x
- the x-axis coordinate of the specified point.y
- the y-axis coordinate of the specified point.void quadTo(float x1, float y1, float x2, float y2)
Appends 'Q' (absolute quadratic curve) segment to the path.
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.void curveTo(float x1, float y1, float x2, float y2, float x3, float y3)
Appends 'C' (absolute cubic curve) segment to the path.
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.void close()
Appends 'Z' (close path) segment to the path
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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