Package armyc2.c5isr.graphics2d
Class BasicStroke
java.lang.Object
armyc2.c5isr.graphics2d.BasicStroke
- All Implemented Interfaces:
Stroke
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Ends unclosed subpaths and dash segments with no added decoration.static final int
Ends unclosed subpaths and dash segments with a round decoration that has a radius equal to half of the width of the pen.static final int
Ends 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 final int
Joins path segments by connecting the outer corners of their wide outlines with a straight segment.static final int
Joins path segments by extending their outside edges until they meet.static final int
Joins path segments by rounding off the corner at a radius of half the line width. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newBasicStroke
with defaults for all attributes.BasicStroke
(float width) Constructs a solidBasicStroke
with the specified line width and with default values for the cap and join styles.BasicStroke
(float width, int cap, int join) BasicStroke
(float width, int cap, int join, float miterlimit) BasicStroke
(float width, int cap, int join, float miterlimit, float[] dash, float dash_phase) -
Method Summary
Modifier and TypeMethodDescriptioncreateStrokedShape
(Polygon poly) Returns aShape
whose interior defines the stroked outline of a specifiedShape
.float[]
Returns the array representing the lengths of the dash segments.float
int
Returns the end cap style.GetInteriorPoints
(POINT2[] pLinePoints, int vblCounter, int lineType, double dist) int
float
float
Returns the limit of miter joins.int
hashCode()
Returns the hashcode for this stroke.
-
Field Details
-
JOIN_MITER
Joins path segments by extending their outside edges until they meet.- See Also:
-
JOIN_ROUND
Joins path segments by rounding off the corner at a radius of half the line width.- See Also:
-
JOIN_BEVEL
Joins path segments by connecting the outer corners of their wide outlines with a straight segment.- See Also:
-
CAP_BUTT
Ends unclosed subpaths and dash segments with no added decoration.- See Also:
-
CAP_ROUND
Ends unclosed subpaths and dash segments with a round decoration that has a radius equal to half of the width of the pen.- See Also:
-
CAP_SQUARE
Ends 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.- See Also:
-
-
Constructor Details
-
BasicStroke
public BasicStroke(float width, int cap, int join, float miterlimit, float[] dash, float dash_phase) -
BasicStroke
-
BasicStroke
-
BasicStroke
Constructs a solidBasicStroke
with the specified line width and with default values for the cap and join styles.- Parameters:
width
- the width of theBasicStroke
- Throws:
IllegalArgumentException
- ifwidth
is negative
-
BasicStroke
public BasicStroke()Constructs a newBasicStroke
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.
-
-
Method Details
-
createStrokedShape
Returns aShape
whose interior defines the stroked outline of a specifiedShape
.- Specified by:
createStrokedShape
in interfaceStroke
- Parameters:
s
- theShape
boundary be stroked- Returns:
- the
Shape
of the stroked outline.
-
createStrokedShape
-
getLineWidth
-
getEndCap
Returns the end cap style.- Returns:
- the end cap style of this
BasicStroke
as one of the staticint
values that define possible end cap styles.
-
getLineJoin
-
getMiterLimit
Returns the limit of miter joins.- Returns:
- the limit of miter joins of the
BasicStroke
.
-
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 theShape
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:
- the dash array.
-
getDashPhase
-
hashCode
Returns the hashcode for this stroke. -
GetInteriorPoints
public static ArrayList<POINT2> GetInteriorPoints(POINT2[] pLinePoints, int vblCounter, int lineType, double dist)
-