|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcodeblocks.rendering.BevelIterator
public class BevelIterator
The BevelIterator
class handles the geometry calculations involved in
creating a bevel effect around the edge of a shape. Like a FlatteningPathIterator
,
it iterates over a set of line segments that follows the shape's boundary. For each segment
it provides four points, of which the 2nd and 3rd are the endpoints of the current segment,
and the 1st and 4th are the endpoints of the neighboring segments. From these four points
relevant vectors for drawing a bevel are automatically calculated and provided.
Points and vectors are specified by (x,y) coordinates in an array.
PathIterator
Field Summary | |
---|---|
float[] |
inset2
a vector pointing inwards from pt2 , bisecting the angle at that point,
scaled to have a length appropriate for a bevel of thickness 1.0 (in other words, lying
on the line that is parallel to the current segment and a distance of 1.0 inwards). |
float[] |
inset3
a vector pointing inwards from pt3 , bisecting the angle at that point,
scaled to have a length appropriate for a bevel of thickness 1.0 (in other words, lying
on the line that is parallel to the current segment and a distance of 1.0 inwards). |
float[] |
perpVec
a unit vector perpendicular to the current segment, pointing outwards |
float[] |
pt1
the point that comes before the current segment's start-point |
float[] |
pt2
the start-point of the current segment |
float[] |
pt3
the end-point of the current segment |
float[] |
pt4
the point that comes after the current segment's end-point |
Constructor Summary | |
---|---|
BevelIterator(java.awt.Shape area,
double flatness)
Constructs a BevelIterator for a given shape. |
Method Summary | |
---|---|
float[] |
insetPoint2(float scalar,
float[] f)
Scales the vector inset2 by the factor scalar and adds it to pt2 . |
float[] |
insetPoint3(float scalar,
float[] f)
Scales the vector inset3 by the factor scalar and adds it to pt3 . |
boolean |
isDone()
Returns true if a call to nextSegment will move to a new segment. |
void |
nextSegment()
Fills in this class's fields with information about the next segment. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public float[] pt1
public float[] pt2
public float[] pt3
public float[] pt4
public float[] inset2
pt2
, bisecting the angle at that point,
scaled to have a length appropriate for a bevel of thickness 1.0 (in other words, lying
on the line that is parallel to the current segment and a distance of 1.0 inwards).
public float[] inset3
pt3
, bisecting the angle at that point,
scaled to have a length appropriate for a bevel of thickness 1.0 (in other words, lying
on the line that is parallel to the current segment and a distance of 1.0 inwards).
public float[] perpVec
Constructor Detail |
---|
public BevelIterator(java.awt.Shape area, double flatness)
flatness
parameter has
the same meaning as in the constructor of FlatteningPathIterator
. The fields of this class
are undefined until nextSegment
is first called.
area
- the region whose boundary is to be beveledflatness
- the maximum allowable distance by which the segments can deviate from the actual boundaryMethod Detail |
---|
public void nextSegment()
public boolean isDone()
true
if a call to nextSegment
will move to a new segment.
public float[] insetPoint2(float scalar, float[] f)
inset2
by the factor scalar
and adds it to pt2
.
The returned point is pt2
inset by an amount appropriate for a bevel of
thickness scalar
.
scalar
- amount to scale inset2
byf
- receives the new point
f
public float[] insetPoint3(float scalar, float[] f)
inset3
by the factor scalar
and adds it to pt3
.
The returned point is pt3
inset by an amount appropriate for a bevel of
thickness scalar
.
scalar
- amount to scale inset3
byf
- receives the new point
f
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |