public class PenStroke
extends java.lang.Object
implements java.awt.Stroke
| Modifier and Type | Field and Description |
|---|---|
static int |
CAP_BUTT
End unclosed subpaths and dash segments with no added
decoration.
|
static int |
CAP_ROUND
End unclosed subpaths and dash segments with a round
decoration with radius equal to half of the line width.
|
static int |
CAP_SQUARE
End unclosed subpaths and dash segments with a square
projection that extends beyond the end of the segment
to a distance equal to half of the line width.
|
static int |
JOIN_BEVEL
Join line segments by connecting the outer corners of their
wide outlines with a straight segment.
|
static int |
JOIN_MITER
Join line segments by extending their outside edges until
they meet.
|
static int |
JOIN_ROUND
Join line segments by rounding off the corner at a radius
of half the line width.
|
| Constructor and Description |
|---|
PenStroke()
Construct a new stroke with defaults for all attributes.
|
PenStroke(float width)
Construct a new stroke with the specified line width, and
with default values for the cap and join styles and no dashing.
|
PenStroke(float width,
int cap,
int join)
Construct a new stroke with the specified attributes, but
no dashing.
|
PenStroke(float width,
int cap,
int join,
float miterlimit)
Construct a new stroke with the specified attributes, but
no dashing.
|
PenStroke(float width,
int cap,
int join,
float miterlimit,
float[] dash,
float dash_phase)
Construct a new stroke with the specified attributes.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone()
Clone the stroke.
|
java.awt.Shape |
createStrokedShape(java.awt.Shape s)
Returns a shape whose interior defines the stroked outline of
a given shape.
|
boolean |
equals(java.lang.Object obj)
Check whether the object is equal to the obejct that is passed.
|
float[] |
getDashArray()
Return the array representing the lengths of the dash segments.
|
float |
getDashPhase()
Returns the dash phase.
|
int |
getEndCap()
Returns the end cap style.
|
int |
getLineJoin()
Returns the line join style.
|
float |
getLineWidth()
Returns the line width.
|
float |
getMiterLimit()
Returns the limit of miter joins.
|
void |
setDashArray(float[] dash)
Sets the array representing the lengths of the dash segments.
|
void |
setDashPhase(float dash_phase)
Sets the dash phase.
|
void |
setEndCap(int cap)
Sets the end cap style.
|
void |
setLineJoin(int join)
Sets the line join style.
|
void |
setLineWidth(float width)
Sets the line width.
|
void |
setMiterLimit(float miterlimit)
Sets the limit of miter joins.
|
java.lang.String |
toString()
Returns the string repesentation of te stroke.
|
public static final int JOIN_MITER
public static final int JOIN_ROUND
public static final int JOIN_BEVEL
public static final int CAP_BUTT
public static final int CAP_ROUND
public static final int CAP_SQUARE
public PenStroke(float width,
int cap,
int join,
float miterlimit,
float[] dash,
float dash_phase)
width - The width of the stroke.cap - The style of the ends of a stroke.join - The style to join strokes together.miterlimit - The limit to trim the miter join.dash - The array representing the dashing pattern.dash_phase - The offset to start the dashing pattern.public PenStroke(float width,
int cap,
int join,
float miterlimit)
width - The width of the stroke.cap - The style of the ends of a stroke.join - The style to join strokes together.miterlimit - The limit to trim the miter join.public PenStroke(float width,
int cap,
int join)
width - The width of the stroke.cap - The style of the ends of a stroke.join - The style to join strokes together.public PenStroke(float width)
width - The width of the stroke.public PenStroke()
public java.lang.Object clone()
clone in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.awt.Shape createStrokedShape(java.awt.Shape s)
createStrokedShape in interface java.awt.Strokes - The shape whose boundary should be stroked.Stroke.createStrokedShape(java.awt.Shape)public float getLineWidth()
setLineWidth(float)public void setLineWidth(float width)
getLineWidth()public int getEndCap()
getEndCap()public void setEndCap(int cap)
setEndCap(int)public int getLineJoin()
setLineJoin(int)public void setLineJoin(int join)
getLineJoin()public float getMiterLimit()
setMiterLimit(float)public void setMiterLimit(float miterlimit)
getMiterLimit()public float[] getDashArray()
setDashArray(float[])public void setDashArray(float[] dash)
getDashArray()public float getDashPhase()
setDashPhase(float)public void setDashPhase(float dash_phase)
getDashPhase()public boolean equals(java.lang.Object obj)
equals in class java.lang.Object