public final class BasicStroke extends Object
Modifier and Type | Field and Description |
---|---|
static int |
CAP_BUTT |
static int |
CAP_ROUND |
static int |
CAP_SQUARE |
static int |
JOIN_BEVEL |
static int |
JOIN_MITER |
static int |
JOIN_ROUND |
static int |
TYPE_CENTERED |
static int |
TYPE_INNER |
static int |
TYPE_OUTER |
Constructor and Description |
---|
BasicStroke() |
BasicStroke(float width,
int cap,
int join,
float miterLimit) |
BasicStroke(float width,
int cap,
int join,
float miterLimit,
double[] dash,
float dashPhase) |
BasicStroke(float width,
int cap,
int join,
float miterLimit,
float[] dash,
float dashPhase) |
BasicStroke(int type,
float width,
int cap,
int join,
float miterLimit) |
BasicStroke(int type,
float width,
int cap,
int join,
float miterLimit,
double[] dash,
float dashPhase) |
BasicStroke(int type,
float width,
int cap,
int join,
float miterLimit,
float[] dash,
float dashPhase) |
Modifier and Type | Method and Description |
---|---|
void |
accumulateShapeBounds(float[] bbox,
Shape shape,
BaseTransform tx) |
BasicStroke |
copy() |
Shape |
createCenteredStrokedShape(Shape s) |
Shape |
createStrokedShape(Shape s) |
boolean |
equals(Object obj)
Tests if a specified object is equal to this
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 . |
float[] |
getDashArray()
Returns the array representing the lengths of the dash segments.
|
float |
getDashPhase()
Returns the current 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.
|
int |
getType()
Returns the stroke type, one of
TYPE_CENTERED ,
TYPE_INNER , or TYPE_OUTER . |
int |
hashCode()
Returns the hashcode for this stroke.
|
boolean |
isDashed()
Returns true if this stroke object will apply dashing attributes
to the path.
|
protected Shape |
makeIntersectedShape(Shape outer,
Shape inner) |
protected Shape |
makeSubtractedShape(Shape outer,
Shape inner) |
void |
set(double[] dash,
float dashPhase) |
void |
set(float[] dash,
float dashPhase) |
void |
set(int type,
float width,
int cap,
int join,
float miterLimit) |
public static final int CAP_BUTT
public static final int CAP_ROUND
public static final int CAP_SQUARE
public static final int JOIN_BEVEL
public static final int JOIN_MITER
public static final int JOIN_ROUND
public static final int TYPE_CENTERED
public static final int TYPE_INNER
public static final int TYPE_OUTER
public BasicStroke()
public BasicStroke(float width, int cap, int join, float miterLimit)
public BasicStroke(int type, float width, int cap, int join, float miterLimit)
public BasicStroke(float width, int cap, int join, float miterLimit, float[] dash, float dashPhase)
public BasicStroke(float width, int cap, int join, float miterLimit, double[] dash, float dashPhase)
public BasicStroke(int type, float width, int cap, int join, float miterLimit, float[] dash, float dashPhase)
public BasicStroke(int type, float width, int cap, int join, float miterLimit, double[] dash, float dashPhase)
public void set(int type, float width, int cap, int join, float miterLimit)
public void set(float[] dash, float dashPhase)
public void set(double[] dash, float dashPhase)
public int getType()
TYPE_CENTERED
,
TYPE_INNER
, or TYPE_OUTER
.public float getLineWidth()
Graphics2D
class comments for more information on
the user space coordinate system.BasicStroke
.public 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 boolean isDashed()
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 void accumulateShapeBounds(float[] bbox, Shape shape, BaseTransform tx)
public int hashCode()
public 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 BasicStroke copy()
Copyright © 2020. All rights reserved.