public final class BasicStroke
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
BasicStroke.CAGShapePair |
Modifier and Type | Field and Description |
---|---|
(package private) int |
cap |
static int |
CAP_BUTT |
static int |
CAP_ROUND |
static int |
CAP_SQUARE |
(package private) float[] |
dash |
(package private) float |
dashPhase |
(package private) int |
join |
static int |
JOIN_BEVEL |
static int |
JOIN_MITER |
static int |
JOIN_ROUND |
(package private) float |
miterLimit |
private static int |
SAFE_ACCUMULATE_MASK |
(package private) static float |
SQRT_2 |
private float[] |
tmpMiter |
(package private) int |
type |
static int |
TYPE_CENTERED |
static int |
TYPE_INNER |
static int |
TYPE_OUTER |
(package private) float |
width |
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 |
---|---|
private void |
accumulate(float o0,
float o1,
float o2,
float o3,
float[] bbox) |
private void |
accumulateBevel(float x0,
float y0,
float pox,
float poy,
float ox,
float oy,
float[] bbox) |
private void |
accumulateCap(float dx,
float dy,
float x0,
float y0,
float ox,
float oy,
float[] bbox,
float w) |
private void |
accumulateCubic(float[] bbox,
int off,
float v0,
float vc0,
float vc1,
float v1,
float w) |
private void |
accumulateCubic(float[] bbox,
int off,
float t,
float v0,
float vc0,
float vc1,
float v1,
float w) |
private void |
accumulateJoin(float pdx,
float pdy,
float dx,
float dy,
float x0,
float y0,
float pox,
float poy,
float ox,
float oy,
float[] bbox,
float w) |
private void |
accumulateMiter(float pdx,
float pdy,
float dx,
float dy,
float pox,
float poy,
float ox,
float oy,
float x0,
float y0,
float[] bbox,
float w) |
private void |
accumulateOrdered(float o0,
float o1,
float o2,
float o3,
float[] bbox) |
private void |
accumulateQuad(float[] bbox,
int off,
float v0,
float vc,
float v1,
float w) |
void |
accumulateShapeBounds(float[] bbox,
Shape shape,
BaseTransform tx) |
private void |
computeMiter(float x0,
float y0,
float x1,
float y1,
float x0p,
float y0p,
float x1p,
float y1p,
float[] m,
int off) |
private void |
computeOffset(float lx,
float ly,
float w,
float[] m,
int off) |
BasicStroke |
copy() |
Shape |
createCenteredStrokedShape(Shape s) |
Shape |
createStrokedShape(Shape s) |
boolean |
equals(java.lang.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.
|
private boolean |
isCW(float dx1,
float dy1,
float dx2,
float dy2) |
boolean |
isDashed()
Returns true if this stroke object will apply dashing attributes
to the path.
|
(package private) static Shape |
makeBeveledRect(float rx,
float ry,
float rw,
float rh,
float d) |
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) |
(package private) Shape |
strokeRoundRectangle(RoundRectangle2D rr) |
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
float width
int type
int cap
int join
float miterLimit
float[] dash
float dashPhase
private static final int SAFE_ACCUMULATE_MASK
private float[] tmpMiter
static final float SQRT_2
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.private boolean isCW(float dx1, float dy1, float dx2, float dy2)
private void computeOffset(float lx, float ly, float w, float[] m, int off)
private void computeMiter(float x0, float y0, float x1, float y1, float x0p, float y0p, float x1p, float y1p, float[] m, int off)
private void accumulateQuad(float[] bbox, int off, float v0, float vc, float v1, float w)
private void accumulateCubic(float[] bbox, int off, float t, float v0, float vc0, float vc1, float v1, float w)
private void accumulateCubic(float[] bbox, int off, float v0, float vc0, float vc1, float v1, float w)
public void accumulateShapeBounds(float[] bbox, Shape shape, BaseTransform tx)
private void accumulate(float o0, float o1, float o2, float o3, float[] bbox)
private void accumulateOrdered(float o0, float o1, float o2, float o3, float[] bbox)
private void accumulateJoin(float pdx, float pdy, float dx, float dy, float x0, float y0, float pox, float poy, float ox, float oy, float[] bbox, float w)
private void accumulateCap(float dx, float dy, float x0, float y0, float ox, float oy, float[] bbox, float w)
private void accumulateMiter(float pdx, float pdy, float dx, float dy, float pox, float poy, float ox, float oy, float x0, float y0, float[] bbox, float w)
private void accumulateBevel(float x0, float y0, float pox, float poy, float ox, float oy, float[] bbox)
Shape strokeRoundRectangle(RoundRectangle2D rr)
static Shape makeBeveledRect(float rx, float ry, float rw, float rh, float d)
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.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
.equals
in class java.lang.Object
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.public BasicStroke copy()