java.lang.Object
imagingbook.common.ij.overlay.ColoredStroke
- All Implemented Interfaces:
Cloneable
This is basically a mirror class of
BasicStroke
adding line and fill colors. Instances of this class are
cloneable and mutable, setters for all fields are provided, i.e., strokes can be easily customized. Use
getBasicStroke()
to convert to an AWT BasicStroke
instance.- Version:
- 2021/10/26
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionColoredStroke
(double lineWidth, int endCap, int lineJoin, double miterLimit, float[] dashArray, double dashPhase, Color strokeColor, Color fillColor) ColoredStroke
(double lineWidth, Color strokeColor) ColoredStroke
(double lineWidth, Color strokeColor, double dashLength) ColoredStroke
(double lineWidth, Color strokeColor, Color fillColor) -
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns a AWTBasicStroke
instance for the current state of this stroke (with no color information).void
setDash
(double... dashes) Convenience method to set (unset) the dash pattern Usage examples:void
setDashArray
(float[] dashArray) void
setDashPhase
(double dashPhase) void
setEndCap
(int endCap) void
setFillColor
(Color fillColor) void
setLineJoin
(int lineJoin) void
setLineWidth
(double lineWidth) void
setMiterLimit
(double miterLimit) void
setStrokeColor
(Color strokeColor)
-
Field Details
-
DefaultStrokeColor
-
DefaultFillColor
-
-
Constructor Details
-
ColoredStroke
public ColoredStroke() -
ColoredStroke
-
ColoredStroke
public ColoredStroke(double lineWidth, int endCap, int lineJoin, double miterLimit, float[] dashArray, double dashPhase, Color strokeColor, Color fillColor) -
ColoredStroke
-
ColoredStroke
-
ColoredStroke
-
-
Method Details
-
clone
-
setLineWidth
-
setEndCap
-
setLineJoin
-
setMiterLimit
-
setDashArray
-
setDashPhase
-
setStrokeColor
-
setFillColor
-
setDash
Convenience method to set (unset) the dash pattern Usage examples:setDash(6); // = setDashArray(new float[] {6}) setDash(6, 4); // = setDashArray(new float[] {6, 4}) setDash(); // = setDashArray(null)
- Parameters:
dashes
- a (possibly empty) sequence of dash lengths- See Also:
-
getStrokeColor
-
getFillColor
-
getBasicStroke
Returns a AWTBasicStroke
instance for the current state of this stroke (with no color information).- Returns:
- a AWT
BasicStroke
-