APIdia Launch Partner
Top Inners Fields Constructors Methods
com.sun.prism

public final Class BasicStroke

extends Object
Class Inheritance
Imports
com.sun.javafx.geom.Area, .GeneralShapePair, .Path2D, .PathIterator, .RoundRectangle2D, .Shape, .ShapePair, com.sun.javafx.geom.transform.BaseTransform, com.sun.prism.impl.shape.ShapeUtil

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv int
public static final int
CAP_BUTT

Constant value for end cap style.

public static final int
CAP_ROUND

Constant value for end cap style.

public static final int
CAP_SQUARE

Constant value for end cap style.

pack-priv float[]
pack-priv float
pack-priv int
public static final int
JOIN_BEVEL

Constant value for join style.

public static final int
JOIN_MITER

Constant value for join style.

public static final int
JOIN_ROUND

Constant value for join style.

pack-priv float
private static final int
pack-priv static final float
private float[]
pack-priv int
public static final int
public static final int
public static final int
pack-priv float

Constructor Summary

AccessConstructor and Description
public
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)

Method Summary

Modifier and TypeMethod 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 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)

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)

public void
accumulateShapeBounds(float[] bbox, Shape shape, BaseTransform tx)

private void
computeMiter(final float x0, final float y0, final float x1, final float y1, final float x0p, final float y0p, final float x1p, final float y1p, final float[] m, int off)

private void
computeOffset(final float lx, final float ly, final float w, final float[] m, int off)

public BasicStroke
copy()

public Shape
public Shape
public boolean

Returns:

true if the width, join, cap, miter limit, dash, and dash phase are the same for both objects; false otherwise.
equals
(Object
the specified object to compare to this BasicStroke
obj
)

Overrides java.lang.Object.equals.

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.

public float[]

Returns:

the dash array.
getDashArray
()

Returns the array representing the lengths of the dash segments.

public float

Returns:

the dash phase as a float value.
getDashPhase
()

Returns the current dash phase.

public int

Returns:

the end cap style of this BasicStroke as one of the static int values that define possible end cap styles.
getEndCap
()

Returns the end cap style.

public int

Returns:

the line join style of the BasicStroke as one of the static int values that define possible line join styles.
getLineJoin
()

Returns the line join style.

public float

Returns:

the line width of this BasicStroke.
getLineWidth
()

Returns the line width.

public float

Returns:

the limit of miter joins of the BasicStroke.
getMiterLimit
()

Returns the limit of miter joins.

public int

Returns:

the stroke type
getType
()

Returns the stroke type, one of TYPE_CENTERED, TYPE_INNER, or TYPE_OUTER.

public int

Returns:

a hash code for this stroke.
hashCode
()

Overrides java.lang.Object.hashCode.

Returns the hashcode for this stroke.

private boolean
isCW(final float dx1, final float dy1, final float dx2, final float dy2)

public boolean

Returns:

whether the stroke has dashes
isDashed
()

Returns true if this stroke object will apply dashing attributes to the path.

pack-priv static Shape
makeBeveledRect(float rx, float ry, float rw, float rh, float d)

protected Shape
protected Shape
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)

pack-priv Shape
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

capback to summary
pack-priv int cap
CAP_BUTTback to summary
public static final int CAP_BUTT

Constant value for end cap style.

CAP_ROUNDback to summary
public static final int CAP_ROUND

Constant value for end cap style.

CAP_SQUAREback to summary
public static final int CAP_SQUARE

Constant value for end cap style.

dashback to summary
pack-priv float[] dash
dashPhaseback to summary
pack-priv float dashPhase
joinback to summary
pack-priv int join
JOIN_BEVELback to summary
public static final int JOIN_BEVEL

Constant value for join style.

JOIN_MITERback to summary
public static final int JOIN_MITER

Constant value for join style.

JOIN_ROUNDback to summary
public static final int JOIN_ROUND

Constant value for join style.

miterLimitback to summary
pack-priv float miterLimit
SAFE_ACCUMULATE_MASKback to summary
private static final int SAFE_ACCUMULATE_MASK
SQRT_2back to summary
pack-priv static final float SQRT_2
tmpMiterback to summary
private float[] tmpMiter
typeback to summary
pack-priv int type
TYPE_CENTEREDback to summary
public static final int TYPE_CENTERED
TYPE_INNERback to summary
public static final int TYPE_INNER
TYPE_OUTERback to summary
public static final int TYPE_OUTER
widthback to summary
pack-priv float width

Constructor Detail

BasicStrokeback to summary
public BasicStroke()
BasicStrokeback to summary
public BasicStroke(float width, int cap, int join, float miterLimit)
BasicStrokeback to summary
public BasicStroke(int type, float width, int cap, int join, float miterLimit)
BasicStrokeback to summary
public BasicStroke(float width, int cap, int join, float miterLimit, float[] dash, float dashPhase)
BasicStrokeback to summary
public BasicStroke(float width, int cap, int join, float miterLimit, double[] dash, float dashPhase)
BasicStrokeback to summary
public BasicStroke(int type, float width, int cap, int join, float miterLimit, float[] dash, float dashPhase)
BasicStrokeback to summary
public BasicStroke(int type, float width, int cap, int join, float miterLimit, double[] dash, float dashPhase)

Method Detail

accumulateback to summary
private void accumulate(float o0, float o1, float o2, float o3, float[] bbox)
accumulateBevelback to summary
private void accumulateBevel(float x0, float y0, float pox, float poy, float ox, float oy, float[] bbox)
accumulateCapback to summary
private void accumulateCap(float dx, float dy, float x0, float y0, float ox, float oy, float[] bbox, float w)
accumulateCubicback to summary
private void accumulateCubic(float[] bbox, int off, float t, float v0, float vc0, float vc1, float v1, float w)
accumulateCubicback to summary
private void accumulateCubic(float[] bbox, int off, float v0, float vc0, float vc1, float v1, float w)
accumulateJoinback to summary
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)
accumulateMiterback to summary
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)
accumulateOrderedback to summary
private void accumulateOrdered(float o0, float o1, float o2, float o3, float[] bbox)
accumulateQuadback to summary
private void accumulateQuad(float[] bbox, int off, float v0, float vc, float v1, float w)
accumulateShapeBoundsback to summary
public void accumulateShapeBounds(float[] bbox, Shape shape, BaseTransform tx)
computeMiterback to summary
private void computeMiter(final float x0, final float y0, final float x1, final float y1, final float x0p, final float y0p, final float x1p, final float y1p, final float[] m, int off)
computeOffsetback to summary
private void computeOffset(final float lx, final float ly, final float w, final float[] m, int off)
copyback to summary
public BasicStroke copy()
createCenteredStrokedShapeback to summary
public Shape createCenteredStrokedShape(final Shape s)
createStrokedShapeback to summary
public Shape createStrokedShape(Shape s)
equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

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.

Parameters
obj:Object

the specified object to compare to this BasicStroke

Returns:boolean

true if the width, join, cap, miter limit, dash, and dash phase are the same for both objects; false otherwise.

Annotations
@Override
getDashArrayback to summary
public float[] getDashArray()

Returns the array representing the lengths of the dash segments. Alternate entries in the array represent the user space lengths of the opaque and transparent segments of the dashes. As the pen moves along the outline of the 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.

Returns:float[]

the dash array.

getDashPhaseback to summary
public float getDashPhase()

Returns the current dash phase. The dash phase is a distance specified in user coordinates that represents an offset into the dashing pattern. In other words, the dash phase defines the point in the dashing pattern that will correspond to the beginning of the stroke.

Returns:float

the dash phase as a float value.

getEndCapback to summary
public int getEndCap()

Returns the end cap style.

Returns:int

the end cap style of this BasicStroke as one of the static int values that define possible end cap styles.

getLineJoinback to summary
public int getLineJoin()

Returns the line join style.

Returns:int

the line join style of the BasicStroke as one of the static int values that define possible line join styles.

getLineWidthback to summary
public float getLineWidth()

Returns the line width. Line width is represented in user space, which is the default-coordinate space used by Java 2D. See the Graphics2D class comments for more information on the user space coordinate system.

Returns:float

the line width of this BasicStroke.

getMiterLimitback to summary
public float getMiterLimit()

Returns the limit of miter joins.

Returns:float

the limit of miter joins of the BasicStroke.

getTypeback to summary
public int getType()

Returns the stroke type, one of TYPE_CENTERED, TYPE_INNER, or TYPE_OUTER.

Returns:int

the stroke type

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns the hashcode for this stroke.

Returns:int

a hash code for this stroke.

Annotations
@Override
isCWback to summary
private boolean isCW(final float dx1, final float dy1, final float dx2, final float dy2)
isDashedback to summary
public boolean isDashed()

Returns true if this stroke object will apply dashing attributes to the path.

Returns:boolean

whether the stroke has dashes

makeBeveledRectback to summary
pack-priv static Shape makeBeveledRect(float rx, float ry, float rw, float rh, float d)
makeIntersectedShapeback to summary
protected Shape makeIntersectedShape(Shape outer, Shape inner)
makeSubtractedShapeback to summary
protected Shape makeSubtractedShape(Shape outer, Shape inner)
setback to summary
public void set(int type, float width, int cap, int join, float miterLimit)
setback to summary
public void set(float[] dash, float dashPhase)
setback to summary
public void set(double[] dash, float dashPhase)
strokeRoundRectangleback to summary
pack-priv Shape strokeRoundRectangle(RoundRectangle2D rr)
com.sun.prism back to summary

pack-priv Class BasicStroke.CAGShapePair

extends GeneralShapePair
Class Inheritance

Field Summary

Modifier and TypeField and Description
private Shape

Constructor Summary

AccessConstructor and Description
public
CAGShapePair(Shape outer, Shape inner, int type)

Method Summary

Modifier and TypeMethod and Description
public PathIterator
getPathIterator(BaseTransform tx)

Overrides com.sun.javafx.geom.GeneralShapePair.getPathIterator.

Returns an iterator object that iterates along the Shape boundary and provides access to the geometry of the Shape outline.

Inherited from com.sun.javafx.geom.GeneralShapePair:
containscontainscopygetBoundsgetCombinationTypegetInnerShapegetOuterShapegetPathIteratorintersects

Field Detail

cagshapeback to summary
private Shape cagshape

Constructor Detail

CAGShapePairback to summary
public CAGShapePair(Shape outer, Shape inner, int type)

Method Detail

getPathIteratorback to summary
public PathIterator getPathIterator(BaseTransform tx)

Overrides com.sun.javafx.geom.GeneralShapePair.getPathIterator.

Doc from com.sun.javafx.geom.Shape.getPathIterator.

Returns an iterator object that iterates along the Shape boundary and provides access to the geometry of the Shape outline. If an optional BaseTransform is specified, the coordinates returned in the iteration are transformed accordingly.

Each call to this method returns a fresh PathIterator object that traverses the geometry of the Shape object independently from any other PathIterator objects in use at the same time.

It is recommended, but not guaranteed, that objects implementing the Shape interface isolate iterations that are in process from any changes that might occur to the original object's geometry during such iterations.

Annotations
@Override