java.lang.Object | +--java.awt.BasicStroke
Safe:
static int
CAP_ROUND
static int
CAP_SQUARE
static int
JOIN_BEVEL
static int
JOIN_MITER
static int
JOIN_ROUND
BasicStroke(float width)
BasicStroke with the specified
line width and with default values for the cap and join
styles.
BasicStroke(float width,
int cap,
int join)
BasicStroke with the specified
attributes.
BasicStroke(float width,
int cap,
int join,
float miterlimit)
BasicStroke with the specified
attributes.
BasicStroke(float width,
int cap,
int join,
float miterlimit,
float[] dash,
float dash_phase)
BasicStroke with the specified
attributes.
Shape
createStrokedShape(Shape s)
Shape whose interior defines the
stroked outline of a specified Shape.
boolean
equals(Object obj)
BasicStroke
by first testing if it is a BasicStroke and then comparing
its width, join, cap, miter limit, dash, and dash phase attributes with
those of this BasicStroke.
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
float width
int join
int cap
float miterlimit
float[] dash
float dash_phase
private static final int[] RasterizerCaps
private static final int[] RasterizerCorners
public BasicStroke(float width, int cap, int join, float miterlimit, float[] dash, float dash_phase)
BasicStroke with the specified
attributes.
width - the width of this BasicStroke. The
width must be greater than or equal to 0.0f. If width is
set to 0.0f, the stroke is rendered as the thinnest
possible line for the target device and the antialias
hint setting.cap - the decoration of the ends of a BasicStrokejoin - the decoration applied where path segments meetmiterlimit - the limit to trim the miter join. The miterlimit
must be greater than or equal to 1.0f.dash - the array representing the dashing patterndash_phase - the offset to start the dashing pattern
IllegalArgumentException - if width is negative
IllegalArgumentException - if cap is not either
CAP_BUTT, CAP_ROUND or CAP_SQUARE
IllegalArgumentException - if miterlimit is less
than 1 and join is JOIN_MITER
IllegalArgumentException - if join is not
either JOIN_ROUND, JOIN_BEVEL, or JOIN_MITER
IllegalArgumentException - if dash_phase
is negative and dash is not null
IllegalArgumentException - if the length of
dash is zero
IllegalArgumentException - if dash lengths are all zero.public BasicStroke(float width, int cap, int join, float miterlimit)
BasicStroke with the specified
attributes.
width - the width of the BasicStrokecap - the decoration of the ends of a BasicStrokejoin - the decoration applied where path segments meetmiterlimit - the limit to trim the miter join
IllegalArgumentException - if width is negative
IllegalArgumentException - if cap is not either
CAP_BUTT, CAP_ROUND or CAP_SQUARE
IllegalArgumentException - if miterlimit is less
than 1 and join is JOIN_MITER
IllegalArgumentException - if join is not
either JOIN_ROUND, JOIN_BEVEL, or JOIN_MITERpublic BasicStroke(float width, int cap, int join)
BasicStroke with the specified
attributes. The miterlimit parameter is
unnecessary in cases where the default is allowable or the
line joins are not specified as JOIN_MITER.
width - the width of the BasicStrokecap - the decoration of the ends of a BasicStrokejoin - the decoration applied where path segments meet
IllegalArgumentException - if width is negative
IllegalArgumentException - if cap is not either
CAP_BUTT, CAP_ROUND or CAP_SQUARE
IllegalArgumentException - if join is not
either JOIN_ROUND, JOIN_BEVEL, or JOIN_MITERpublic BasicStroke(float width)
BasicStroke with the specified
line width and with default values for the cap and join
styles.
width - the width of the BasicStroke
IllegalArgumentException - if width is negativepublic BasicStroke()
BasicStroke with defaults for all
attributes.
The default attributes are a solid line of width 1.0, CAP_SQUARE,
JOIN_MITER, a miter limit of 10.0.
public Shape createStrokedShape(Shape s)
Shape whose interior defines the
stroked outline of a specified Shape.
createStrokedShape in interface Strokes - the Shape boundary be stroked
Shape of the stroked outline.public float getLineWidth()
Graphics2D class comments for more information on
the user space coordinate system.
BasicStroke.Graphics2Dpublic int getEndCap()
BasicStroke as one
of the static int values that define possible end cap
styles.public int getLineJoin()
BasicStroke as one
of the static int values that define possible line
join styles.public float getMiterLimit()
BasicStroke.public float[] getDashArray()
Shape
to be stroked, the user space
distance that the pen travels is accumulated. The distance
value is used to index into the dash array.
The pen is opaque when its current cumulative distance maps
to an even element of the dash array and transparent otherwise.
public float getDashPhase()
float value.public int hashCode()
java.lang.Object#equals(java.lang.Object),
java.util.Hashtablepublic boolean equals(Object obj)
BasicStroke
by first testing if it is a BasicStroke and then comparing
its width, join, cap, miter limit, dash, and dash phase attributes with
those of this BasicStroke.
obj - the specified object to compare to this
BasicStroke
true if the width, join, cap, miter limit, dash, and
dash phase are the same for both objects;
false otherwise.Object.hashCode(),
java.util.Hashtable