Package com.illumon.iris.db.plot
Class LineStyle
java.lang.Object
com.illumon.iris.db.plot.LineStyle
- All Implemented Interfaces:
Serializable
Specifications for the style of a line. These specifications include line thickness, dash patterns, end styles,
segment join styles, and shapes.
Line thickness is 1 by default. Larger numbers draw thicker lines.
Dash pattern is defined by an array. If only one value is included in the array, the dash and the gap after the dash will be the same. If more than one value is used in the array, the first value represents the length of the first dash in the line. The next value represents the length of the gap between it and the next dash. Additional values can be added into the array for subsequent dash/gap combinations. For example, the array [20,5] creates a dash pattern with a 20 length dash and a 5 length gap. This pattern is repeated till the end of the line.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumStyle for shapes drawn at the end of a line.static enumStyle for drawing the connections between line segments. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a LineStyle.LineStyle(double width) Creates a LineStyle with specified thickness.LineStyle(double... dashPattern) Creates a LineStyle with specified dash pattern.LineStyle(double width, double[] dashPattern) Creates a LineStyle with specified thickness and dash pattern.LineStyle(double width, float[] dashPattern) Creates a LineStyle with specified thickness and dash pattern.LineStyle(double width, int[] dashPattern) Creates a LineStyle with specified thickness and dash pattern.LineStyle(double width, long[] dashPattern) Creates a LineStyle with specified thickness and dash pattern.LineStyle(double width, LineStyle.LineEndStyle endStyle, LineStyle.LineJoinStyle joinStyle, double... dashPattern) Creates a LineStyle.LineStyle(double width, LineStyle.LineEndStyle endStyle, LineStyle.LineJoinStyle joinStyle, List<T> dashPattern) Creates a LineStyle with specified thickness,LineStyle.LineEndStyle,LineStyle.LineJoinStyle, and dash pattern.Creates a LineStyle with specified thickness,LineStyle.LineEndStyle,LineStyle.LineJoinStyle, and dash pattern.Creates a LineStyle with specified thickness,LineStyle.LineEndStyle,LineStyle.LineJoinStyle, and dash pattern.Creates a LineStyle with specified thickness and dash pattern.LineStyle(double width, T[] dashPattern) Creates a LineStyle with specified thickness and dash pattern.Creates a LineStyle with specifiedLineStyle.LineEndStyleandLineStyle.LineJoinStyleDefaults line width to 1.0.Creates a LineStyle with specified dash pattern. -
Method Summary
Modifier and TypeMethodDescriptionfloat[]Gets the dash pattern of this LineStyle.Gets theLineStyle.LineEndStyleof this LineStyle.Gets theLineStyle.LineJoinStyleof this LineStyle.doublegetWidth()Gets the width of this LineStyle.static LineStyle.LineEndStylelineEndStyle(String style) Returns the shape drawn at the end of a line.static String[]Returns the names of available shapes draw at the end of a line.static LineStyle.LineJoinStylelineJoinStyle(String style) Returns the style for drawing connections between line segments.static String[]Returns the names of available styles for drawing connections between line segments.static LineStyleReturns a line style.static LineStylelineStyle(double width) Returns a line style.static LineStylelineStyle(double... dashPattern) Returns a line style.static LineStylelineStyle(double width, double[] dashPattern) Returns a line style.static LineStylelineStyle(double width, float[] dashPattern) Returns a line style.static LineStylelineStyle(double width, int[] dashPattern) Returns a line style.static LineStylelineStyle(double width, long[] dashPattern) Returns a line style.static LineStylelineStyle(double width, LineStyle.LineEndStyle endStyle, LineStyle.LineJoinStyle joinStyle, double... dashPattern) Returns a line style.lineStyle(double width, LineStyle.LineEndStyle endStyle, LineStyle.LineJoinStyle joinStyle, List<T> dashPattern) Returns a line style.static LineStyleReturns a line style.Returns a line style.Returns a line style.lineStyle(double width, T[] dashPattern) Returns a line style.static LineStyleReturns a line style.Returns a line style.toString()
-
Constructor Details
-
LineStyle
public LineStyle(double width, LineStyle.LineEndStyle endStyle, LineStyle.LineJoinStyle joinStyle, double... dashPattern) Creates a LineStyle.- Parameters:
width- line thicknessendStyle- line end stylejoinStyle- line join styledashPattern- dash pattern
-
LineStyle
public LineStyle(double width, LineStyle.LineEndStyle endStyle, LineStyle.LineJoinStyle joinStyle, List<T> dashPattern) Creates a LineStyle with specified thickness,LineStyle.LineEndStyle,LineStyle.LineJoinStyle, and dash pattern.- Type Parameters:
T- data type ofdashPattern- Parameters:
width- line thicknessendStyle- line end stylejoinStyle- line join styledashPattern- dash pattern
-
LineStyle
Creates a LineStyle with specified thickness,LineStyle.LineEndStyle,LineStyle.LineJoinStyle, and dash pattern.- Parameters:
width- line thicknessendStyle- line end style descriptorjoinStyle- line join style descriptordashPattern- dash pattern
-
LineStyle
Creates a LineStyle with specified thickness,LineStyle.LineEndStyle,LineStyle.LineJoinStyle, and dash pattern.- Type Parameters:
T- data type ofdashPattern- Parameters:
width- line thicknessendStyle- line end style descriptorjoinStyle- line join style descriptordashPattern- dash pattern
-
LineStyle
public LineStyle(double width) Creates a LineStyle with specified thickness. Defaults theLineStyle.LineEndStyleandLineStyle.LineJoinStyletoLineStyle.LineJoinStyle.ROUND. No dash pattern is set.- Parameters:
width- line thickness
-
LineStyle
public LineStyle(double width, double[] dashPattern) Creates a LineStyle with specified thickness and dash pattern. Defaults theLineStyle.LineEndStyleandLineStyle.LineJoinStyletoLineStyle.LineJoinStyle.ROUND.- Parameters:
width- line thicknessdashPattern- dash pattern
-
LineStyle
public LineStyle(double width, int[] dashPattern) Creates a LineStyle with specified thickness and dash pattern. Defaults theLineStyle.LineEndStyleandLineStyle.LineJoinStyletoLineStyle.LineJoinStyle.ROUND.- Parameters:
width- line thicknessdashPattern- dash pattern
-
LineStyle
public LineStyle(double width, long[] dashPattern) Creates a LineStyle with specified thickness and dash pattern. Defaults theLineStyle.LineEndStyleandLineStyle.LineJoinStyletoLineStyle.LineJoinStyle.ROUND.- Parameters:
width- line thicknessdashPattern- dash pattern
-
LineStyle
public LineStyle(double width, float[] dashPattern) Creates a LineStyle with specified thickness and dash pattern. Defaults theLineStyle.LineEndStyleandLineStyle.LineJoinStyletoLineStyle.LineJoinStyle.ROUND.- Parameters:
width- line thicknessdashPattern- dash pattern
-
LineStyle
public LineStyle(double width, T[] dashPattern) Creates a LineStyle with specified thickness and dash pattern. Defaults theLineStyle.LineEndStyleandLineStyle.LineJoinStyletoLineStyle.LineJoinStyle.ROUND.- Type Parameters:
T- data type ofdashPattern- Parameters:
width- line thicknessdashPattern- dash pattern
-
LineStyle
Creates a LineStyle with specified thickness and dash pattern. Defaults theLineStyle.LineEndStyleandLineStyle.LineJoinStyletoLineStyle.LineJoinStyle.ROUND.- Type Parameters:
T- data type ofdashPattern- Parameters:
width- line thicknessdashPattern- dash pattern
-
LineStyle
public LineStyle(double... dashPattern) Creates a LineStyle with specified dash pattern. Defaults line width to 1.0 and theLineStyle.LineEndStyleandLineStyle.LineJoinStyletoLineStyle.LineJoinStyle.ROUND.- Parameters:
dashPattern- dash pattern
-
LineStyle
Creates a LineStyle with specified dash pattern. Defaults line width to 1.0 and theLineStyle.LineEndStyleandLineStyle.LineJoinStyletoLineStyle.LineJoinStyle.ROUND.- Type Parameters:
T- data type ofdashPattern- Parameters:
dashPattern- dash pattern
-
LineStyle
Creates a LineStyle with specifiedLineStyle.LineEndStyleandLineStyle.LineJoinStyleDefaults line width to 1.0. No dash pattern is set.- Parameters:
endStyle- line end stylejoinStyle- line join style
-
LineStyle
public LineStyle()Creates a LineStyle. Defaults the line width to 1.0 and theLineStyle.LineEndStyleandLineStyle.LineJoinStyletoLineStyle.LineJoinStyle.ROUND. No dash pattern is set.
-
-
Method Details
-
lineEndStyle
Returns the shape drawn at the end of a line.- Parameters:
style- case insensitive style name.- Returns:
- LineEndStyle specified by
style - Throws:
IllegalArgumentException-stylecan not be null
-
lineEndStyleNames
Returns the names of available shapes draw at the end of a line.- Returns:
- array of LineEndStyle names
-
lineJoinStyle
Returns the style for drawing connections between line segments.- Parameters:
style- case insensitive style name- Returns:
- LineJoinStyle specified by
style - Throws:
IllegalArgumentException-stylecan not be null
-
lineJoinStyleNames
Returns the names of available styles for drawing connections between line segments.- Returns:
- array of LineJoinStyle names
-
lineStyle
public static LineStyle lineStyle(double width, LineStyle.LineEndStyle endStyle, LineStyle.LineJoinStyle joinStyle, double... dashPattern) Returns a line style.- Parameters:
width- line thicknessendStyle- line end stylejoinStyle- line join styledashPattern- dash pattern- Returns:
- line style.
-
lineStyle
public static <T extends Number> LineStyle lineStyle(double width, LineStyle.LineEndStyle endStyle, LineStyle.LineJoinStyle joinStyle, List<T> dashPattern) Returns a line style.- Type Parameters:
T- data type ofdashPattern- Parameters:
width- line thicknessendStyle- line end stylejoinStyle- line join styledashPattern- dash pattern- Returns:
- line style.
-
lineStyle
public static LineStyle lineStyle(double width, String endStyle, String joinStyle, double... dashPattern) Returns a line style.- Parameters:
width- line thicknessendStyle- line end style descriptorjoinStyle- line join style descriptordashPattern- dash pattern- Returns:
- line style.
-
lineStyle
public static <T extends Number> LineStyle lineStyle(double width, String endStyle, String joinStyle, List<T> dashPattern) Returns a line style.- Type Parameters:
T- data type ofdashPattern- Parameters:
width- line thicknessendStyle- line end style descriptorjoinStyle- line join style descriptordashPattern- dash pattern- Returns:
- line style.
-
lineStyle
Returns a line style.- Parameters:
width- line thickness- Returns:
- line style with no dash pattern set.
-
lineStyle
Returns a line style.- Parameters:
width- line thicknessdashPattern- dash pattern- Returns:
- line style with the line end style and line join style set to
ROUND.
-
lineStyle
Returns a line style.- Parameters:
width- line thicknessdashPattern- dash pattern- Returns:
- line style with the line end style and line join style set to
ROUND.
-
lineStyle
Returns a line style.- Parameters:
width- line thicknessdashPattern- dash pattern- Returns:
- line style with the line end style and line join style set to
ROUND.
-
lineStyle
Returns a line style.- Parameters:
width- line thicknessdashPattern- dash pattern- Returns:
- line style with the line end style and line join style set to
ROUND.
-
lineStyle
Returns a line style.- Type Parameters:
T- data type ofdashPattern- Parameters:
width- line thicknessdashPattern- dash pattern- Returns:
- line style with the line end style and line join style set to
ROUND.
-
lineStyle
Returns a line style.- Type Parameters:
T- data type ofdashPattern- Parameters:
width- line thicknessdashPattern- dash pattern- Returns:
- line style with the line end style and line join style set to
ROUND.
-
lineStyle
Returns a line style.- Parameters:
dashPattern- dash pattern- Returns:
- line style with the line end style and line join style set to
ROUND, and the line width set to 1.0.
-
lineStyle
Returns a line style.- Type Parameters:
T- data type ofdashPattern- Parameters:
dashPattern- dash pattern- Returns:
- line style with the line end style and line join style set to
ROUND, and the line width set to 1.0.
-
lineStyle
Returns a line style.- Parameters:
endStyle- line end stylejoinStyle- line join style- Returns:
- line style with the line width set to 1.0.
-
lineStyle
Returns a line style.- Returns:
- line style with the line end style and line join style set to
ROUND, the line width set to 1.0, and no dash pattern set.
-
getWidth
public double getWidth()Gets the width of this LineStyle.- Returns:
- this LineStyle's width
-
getEndStyle
Gets theLineStyle.LineEndStyleof this LineStyle.- Returns:
- this LineStyle's
LineStyle.LineEndStyle
-
getJoinStyle
Gets theLineStyle.LineJoinStyleof this LineStyle.- Returns:
- this LineStyle's
LineStyle.LineJoinStyle
-
getDashPattern
public float[] getDashPattern()Gets the dash pattern of this LineStyle.- Returns:
- this LineStyle's dash pattern
-
toString
-