Package armyc2.c5isr.graphics2d
Class BasicStroke
java.lang.Object
armyc2.c5isr.graphics2d.BasicStroke
- All Implemented Interfaces:
Stroke
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intEnds unclosed subpaths and dash segments with no added decoration.static final intEnds unclosed subpaths and dash segments with a round decoration that has a radius equal to half of the width of the pen.static final intEnds 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 intJoins path segments by connecting the outer corners of their wide outlines with a straight segment.static final intJoins path segments by extending their outside edges until they meet.static final intJoins path segments by rounding off the corner at a radius of half the line width. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newBasicStrokewith defaults for all attributes.BasicStroke(float width) Constructs a solidBasicStrokewith 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 aShapewhose interior defines the stroked outline of a specifiedShape.float[]Returns the array representing the lengths of the dash segments.floatintReturns the end cap style.GetInteriorPoints(POINT2[] pLinePoints, int vblCounter, int lineType, double dist) intfloatfloatReturns the limit of miter joins.inthashCode()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 solidBasicStrokewith the specified line width and with default values for the cap and join styles.- Parameters:
width- the width of theBasicStroke- Throws:
IllegalArgumentException- ifwidthis negative
-
BasicStroke
public BasicStroke()Constructs a newBasicStrokewith 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 aShapewhose interior defines the stroked outline of a specifiedShape.- Specified by:
createStrokedShapein interfaceStroke- Parameters:
s- theShapeboundary be stroked- Returns:
- the
Shapeof the stroked outline.
-
createStrokedShape
-
getLineWidth
-
getEndCap
Returns the end cap style.- Returns:
- the end cap style of this
BasicStrokeas one of the staticintvalues 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 theShapeto 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)
-