org.apache.batik.parser
Interface PathSegment


public interface PathSegment

This interface represents objects which hold informations about SVG path segments.


Field Summary
static char ARC_ABS
          To represent a 'A' command.
static char ARC_REL
          To represent a 'a' command.
static char CLOSEPATH
          To represent a 'z' command.
static char CURVETO_CUBIC_ABS
          To represent a 'C' command.
static char CURVETO_CUBIC_REL
          To represent a 'c' command.
static char CURVETO_CUBIC_SMOOTH_ABS
          To represent a 'S' command.
static char CURVETO_CUBIC_SMOOTH_REL
          To represent a 's' command.
static char CURVETO_QUADRATIC_ABS
          To represent a 'Q' command.
static char CURVETO_QUADRATIC_REL
          To represent a 'q' command.
static char CURVETO_QUADRATIC_SMOOTH_ABS
          To represent a 'T' command.
static char CURVETO_QUADRATIC_SMOOTH_REL
          To represent a 't' command.
static char LINETO_ABS
          To represent a 'L' command.
static char LINETO_HORIZONTAL_ABS
          To represent a 'H' command.
static char LINETO_HORIZONTAL_REL
          To represent a 'h' command.
static char LINETO_REL
          To represent a 'l' command.
static char LINETO_VERTICAL_ABS
          To represent a 'V' command.
static char LINETO_VERTICAL_REL
          To represent a 'v' command.
static char MOVETO_ABS
          To represent a 'M' command.
static char MOVETO_REL
          To represent a 'm' command.
 
Method Summary
 float getAngle()
          Returns the rotation angle in degrees for the ellipse's x-axis relative to the x-axis of the user coordinate system if this segment type is ARC_ABS or ARC_REL.
 boolean getLargeArcFlag()
          Returns the large-arc-flag parameter value if this segment type is ARC_ABS or ARC_REL.
 float getR1()
          Returns the x-axis radius for the ellipse if this segment type is ARC_ABS or ARC_REL.
 float getR2()
          Returns the y-axis radius for the ellipse if this segment type is ARC_ABS or ARC_REL.
 boolean getSweepFlag()
          Returns the sweep-flag parameter value if this segment type is ARC_ABS or ARC_REL.
 char getType()
          Returns the type of this segment.
 float getX()
          Returns the x coordinate of this segment's end point.
 float getX1()
          Returns the x coordinate of this segment's first control point if the type is CURVETO_CUBIC_ABS, CURVETO_CUBIC_REL, CURVETO_QUADRATIC_ABS or CURVETO_QUADRATIC_REL.
 float getX2()
          Returns the x coordinate of this segment's second control point if the type is CURVETO_CUBIC_ABS, CURVETO_CUBIC_REL, CURVETO_CUBIC_SMOOTH_ABS or CURVETO_CUBIC_SMOOTH_REL.
 float getY()
          Returns the y coordinate of this segment's end point.
 float getY1()
          Returns the y coordinate of this segment's first control point if the type is CURVETO_CUBIC_ABS, CURVETO_CUBIC_REL, CURVETO_QUADRATIC_ABS or CURVETO_QUADRATIC_REL.
 float getY2()
          Returns the y coordinate of this segment's second control point if the type is CURVETO_CUBIC_ABS, CURVETO_CUBIC_REL, CURVETO_CUBIC_SMOOTH_ABS or CURVETO_CUBIC_SMOOTH_REL.
 

Field Detail

CLOSEPATH

public static final char CLOSEPATH
To represent a 'z' command.

MOVETO_ABS

public static final char MOVETO_ABS
To represent a 'M' command.

MOVETO_REL

public static final char MOVETO_REL
To represent a 'm' command.

LINETO_ABS

public static final char LINETO_ABS
To represent a 'L' command.

LINETO_REL

public static final char LINETO_REL
To represent a 'l' command.

CURVETO_CUBIC_ABS

public static final char CURVETO_CUBIC_ABS
To represent a 'C' command.

CURVETO_CUBIC_REL

public static final char CURVETO_CUBIC_REL
To represent a 'c' command.

CURVETO_QUADRATIC_ABS

public static final char CURVETO_QUADRATIC_ABS
To represent a 'Q' command.

CURVETO_QUADRATIC_REL

public static final char CURVETO_QUADRATIC_REL
To represent a 'q' command.

ARC_ABS

public static final char ARC_ABS
To represent a 'A' command.

ARC_REL

public static final char ARC_REL
To represent a 'a' command.

LINETO_HORIZONTAL_ABS

public static final char LINETO_HORIZONTAL_ABS
To represent a 'H' command.

LINETO_HORIZONTAL_REL

public static final char LINETO_HORIZONTAL_REL
To represent a 'h' command.

LINETO_VERTICAL_ABS

public static final char LINETO_VERTICAL_ABS
To represent a 'V' command.

LINETO_VERTICAL_REL

public static final char LINETO_VERTICAL_REL
To represent a 'v' command.

CURVETO_CUBIC_SMOOTH_ABS

public static final char CURVETO_CUBIC_SMOOTH_ABS
To represent a 'S' command.

CURVETO_CUBIC_SMOOTH_REL

public static final char CURVETO_CUBIC_SMOOTH_REL
To represent a 's' command.

CURVETO_QUADRATIC_SMOOTH_ABS

public static final char CURVETO_QUADRATIC_SMOOTH_ABS
To represent a 'T' command.

CURVETO_QUADRATIC_SMOOTH_REL

public static final char CURVETO_QUADRATIC_SMOOTH_REL
To represent a 't' command.
Method Detail

getType

public char getType()
Returns the type of this segment. It is also the command character.

getX

public float getX()
Returns the x coordinate of this segment's end point.
Throws:
java.lang.IllegalStateException - if this segment type is CLOSEPATH, LINETO_VERTICAL_ABS or LINETO_VERTICAL_REL.

getY

public float getY()
Returns the y coordinate of this segment's end point.
Throws:
java.lang.IllegalStateException - if this segment type is CLOSEPATH, LINETO_HORIZONTAL_ABS or LINETO_HORIZONTAL_REL.

getX1

public float getX1()
Returns the x coordinate of this segment's first control point if the type is CURVETO_CUBIC_ABS, CURVETO_CUBIC_REL, CURVETO_QUADRATIC_ABS or CURVETO_QUADRATIC_REL.
Throws:
java.lang.IllegalStateException - if this segment type is not an allowed one.

getY1

public float getY1()
Returns the y coordinate of this segment's first control point if the type is CURVETO_CUBIC_ABS, CURVETO_CUBIC_REL, CURVETO_QUADRATIC_ABS or CURVETO_QUADRATIC_REL.
Throws:
java.lang.IllegalStateException - if this segment type is not an allowed one.

getX2

public float getX2()
Returns the x coordinate of this segment's second control point if the type is CURVETO_CUBIC_ABS, CURVETO_CUBIC_REL, CURVETO_CUBIC_SMOOTH_ABS or CURVETO_CUBIC_SMOOTH_REL.
Throws:
java.lang.IllegalStateException - if this segment type is not an allowed one.

getY2

public float getY2()
Returns the y coordinate of this segment's second control point if the type is CURVETO_CUBIC_ABS, CURVETO_CUBIC_REL, CURVETO_CUBIC_SMOOTH_ABS or CURVETO_CUBIC_SMOOTH_REL.
Throws:
java.lang.IllegalStateException - if this segment type is not an allowed one.

getR1

public float getR1()
Returns the x-axis radius for the ellipse if this segment type is ARC_ABS or ARC_REL.
Throws:
java.lang.IllegalStateException - if this segment is not arc.

getR2

public float getR2()
Returns the y-axis radius for the ellipse if this segment type is ARC_ABS or ARC_REL.
Throws:
java.lang.IllegalStateException - if this segment is not an arc.

getAngle

public float getAngle()
Returns the rotation angle in degrees for the ellipse's x-axis relative to the x-axis of the user coordinate system if this segment type is ARC_ABS or ARC_REL.
Throws:
java.lang.IllegalStateException - if this segment is not an arc.

getLargeArcFlag

public boolean getLargeArcFlag()
Returns the large-arc-flag parameter value if this segment type is ARC_ABS or ARC_REL.
Throws:
java.lang.IllegalStateException - if this segment is not an arc.

getSweepFlag

public boolean getSweepFlag()
Returns the sweep-flag parameter value if this segment type is ARC_ABS or ARC_REL.
Throws:
java.lang.IllegalStateException - if this segment is not an arc.


Copyright © 2001 Apache Software Foundation. All Rights Reserved.