|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatt.grappa.GrappaLine
public class GrappaLine
This class provides line and bezier-curve support for Grappa.
Field Summary | |
---|---|
private int |
arrow
|
static double |
arrowLength
Arrow head length |
static double |
arrowWidth
Arrow head width |
static int |
BOTH_ARROW_EDGE
Bit flag to indicate that line has arrow heads at both ends. |
private GrappaPoint[] |
gpts
|
static int |
HEAD_ARROW_EDGE
Bit flag to indicate that line has an arrow head at its head end. |
static int |
NONE_ARROW_EDGE
Bit flag to indicate that line has no arrow heads. |
private java.awt.geom.GeneralPath |
path
|
static int |
TAIL_ARROW_EDGE
Bit flag to indicate that line has an arrow head at its tail end. |
private java.awt.geom.GeneralPath |
testpath
|
private int |
windingRule
|
Constructor Summary | |
---|---|
GrappaLine(GrappaPoint[] pts,
int type)
Constructs a new GrappaLine object from an array of
(cubic) curve points. |
|
GrappaLine(java.lang.String curve)
Constructs a new GrappaLine object from a string of
(cubic) curve points as used by "dot". |
Method Summary | |
---|---|
private void |
addArrow(java.awt.geom.GeneralPath path,
java.awt.geom.GeneralPath testpath,
GrappaPoint tip,
GrappaPoint shaft,
double length,
double width)
|
boolean |
changeArrowType(int new_type)
Changes the arrow type for this line. |
java.lang.Object |
clone()
Creates a new object of the same class as this object. |
boolean |
contains(double x,
double y)
|
boolean |
contains(double x,
double y,
double width,
double height)
|
boolean |
contains(java.awt.geom.Point2D p)
|
boolean |
contains(java.awt.geom.Rectangle2D r)
|
boolean |
equals(java.lang.Object obj)
Check for equality of this object with the supplied object. |
int |
getArrowType()
Return the arrow type for this line. |
java.awt.Rectangle |
getBounds()
|
java.awt.geom.Rectangle2D |
getBounds2D()
|
java.awt.geom.PathIterator |
getPathIterator()
Equivalent to getPathIterator(null). |
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform at)
|
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform at,
double flatness)
|
int |
getWindingRule()
Return the winding rule for this line. |
boolean |
intersects(double x,
double y,
double width,
double height)
|
boolean |
intersects(java.awt.geom.Rectangle2D r)
|
boolean |
startsNear(java.awt.geom.Point2D pt)
Check is the line is oriented away from the given point. |
java.lang.String |
toAttributeString()
Provides a string representation of this object consistent with Grappa attributes. |
java.lang.String |
toFormattedString(java.lang.String pointFormat)
Provides a formatted string representation of this object. |
java.lang.String |
toString()
Provides a generic string representation of this object. |
private void |
updateLine(GrappaPoint[] grpts,
int type)
|
private void |
updateLine(java.lang.String curve)
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final double arrowLength
public static final double arrowWidth
public static final int NONE_ARROW_EDGE
public static final int HEAD_ARROW_EDGE
public static final int TAIL_ARROW_EDGE
public static final int BOTH_ARROW_EDGE
private java.awt.geom.GeneralPath path
private java.awt.geom.GeneralPath testpath
private int arrow
private GrappaPoint[] gpts
private int windingRule
Constructor Detail |
---|
public GrappaLine(GrappaPoint[] pts, int type)
GrappaLine
object from an array of
(cubic) curve points.
The winding rule for this path is defaulted (from Grappa.windingRule).
pts
- the GrappaPoint
array used to describe the curvetype
- indicates arrow type (NONE_ARROW_EDGE,HEAD_ARROW_EDGE,
TAIL_ARROW_EDGE,BOTH_ARROW_EDGE)public GrappaLine(java.lang.String curve)
GrappaLine
object from a string of
(cubic) curve points as used by "dot".
All of the initial geometry and the winding rule for this path are
defaulted.
curve
- the String
that specifies the point list; the
format is: [s,x0,y0|e,xN,yN] [x1,y2] ... [xN-1,yN-1]Method Detail |
---|
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
the
- object to be checked for equality
public int getArrowType()
public int getWindingRule()
public boolean startsNear(java.awt.geom.Point2D pt)
public java.lang.String toAttributeString()
public java.lang.String toFormattedString(java.lang.String pointFormat)
pointFormat
- the specific format directive to use for each point in the line (%p is the base directive).
public java.lang.String toString()
toString
in class java.lang.Object
public boolean changeArrowType(int new_type)
new_type
- indicates arrow type (NONE_ARROW_EDGE,HEAD_ARROW_EDGE,
TAIL_ARROW_EDGE,BOTH_ARROW_EDGE)
private void addArrow(java.awt.geom.GeneralPath path, java.awt.geom.GeneralPath testpath, GrappaPoint tip, GrappaPoint shaft, double length, double width)
private void updateLine(java.lang.String curve)
private void updateLine(GrappaPoint[] grpts, int type)
public java.lang.Object clone()
clone
in class java.lang.Object
java.lang.OutOfMemoryError
- if there is not enough memory.Cloneable
public final boolean contains(double x, double y)
contains
in interface java.awt.Shape
public final boolean contains(double x, double y, double width, double height)
contains
in interface java.awt.Shape
public final boolean contains(java.awt.geom.Point2D p)
contains
in interface java.awt.Shape
public final boolean contains(java.awt.geom.Rectangle2D r)
contains
in interface java.awt.Shape
public final java.awt.Rectangle getBounds()
getBounds
in interface java.awt.Shape
public final java.awt.geom.Rectangle2D getBounds2D()
getBounds2D
in interface java.awt.Shape
public final java.awt.geom.PathIterator getPathIterator()
getPathIterator(AffineTransform)
public final java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at)
getPathIterator
in interface java.awt.Shape
public final java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at, double flatness)
getPathIterator
in interface java.awt.Shape
public final boolean intersects(double x, double y, double width, double height)
intersects
in interface java.awt.Shape
public final boolean intersects(java.awt.geom.Rectangle2D r)
intersects
in interface java.awt.Shape
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |