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 AWTBasicStrokeinstance for the current state of this stroke (with no color information).voidsetDash(double... dashes) Convenience method to set (unset) the dash pattern Usage examples:voidsetDashArray(float[] dashArray) voidsetDashPhase(double dashPhase) voidsetEndCap(int endCap) voidsetFillColor(Color fillColor) voidsetLineJoin(int lineJoin) voidsetLineWidth(double lineWidth) voidsetMiterLimit(double miterLimit) voidsetStrokeColor(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 AWTBasicStrokeinstance for the current state of this stroke (with no color information).- Returns:
- a AWT
BasicStroke
-