public class LineStyle extends Object implements Serializable
Specifies the drawing style of a line.
LineStyle
specifies the line thickness, dash pattern and join and end styles.
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.LineStyle.LineEndStyle
specifies the shape drawn at the end of a line.
LineStyle.LineJoinStyle
specifies the shape drawn at data points along the line.Modifier and Type | Class and Description |
---|---|
static class |
LineStyle.LineEndStyle
Style for drawing the end of a line.
|
static class |
LineStyle.LineJoinStyle
Style for drawing the connections between line segments.
|
Constructor and Description |
---|
LineStyle()
Creates a LineStyle.
|
LineStyle(double... dashPattern)
Creates a LineStyle with specified dash pattern.
|
LineStyle(double width)
Creates a LineStyle with specified thickness.
|
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,
LineStyle.LineEndStyle endStyle,
LineStyle.LineJoinStyle joinStyle,
double... dashPattern)
Creates a LineStyle with specified thickness,
LineStyle.LineEndStyle ,
LineStyle.LineJoinStyle , and dash pattern. |
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. |
LineStyle(double width,
List<T> 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,
String endStyle,
String joinStyle,
double... dashPattern)
Creates a LineStyle with specified thickness,
LineStyle.LineEndStyle ,
LineStyle.LineJoinStyle , and dash pattern. |
LineStyle(double width,
String endStyle,
String joinStyle,
List<T> dashPattern)
Creates a LineStyle with specified thickness,
LineStyle.LineEndStyle ,
LineStyle.LineJoinStyle , and dash pattern. |
LineStyle(double width,
T[] dashPattern)
Creates a LineStyle with specified thickness and dash pattern.
|
LineStyle(List<T> dashPattern)
Creates a LineStyle with specified dash pattern.
|
LineStyle(String endStyle,
String joinStyle)
Creates a LineStyle with specified
LineStyle.LineEndStyle and LineStyle.LineJoinStyle
Defaults line width to 1.0. |
Modifier and Type | Method and Description |
---|---|
float[] |
getDashPattern()
Gets the dash pattern of this LineStyle.
|
LineStyle.LineEndStyle |
getEndStyle()
Gets the
LineStyle.LineEndStyle of this LineStyle. |
LineStyle.LineJoinStyle |
getJoinStyle()
Gets the
LineStyle.LineJoinStyle of this LineStyle. |
double |
getWidth()
Gets the width of this LineStyle.
|
static LineStyle.LineEndStyle |
lineEndStyle(String style)
Gets the LineEndStyle.
|
static String[] |
lineEndStyleNames()
Gets the names of available LineEndStyles.
|
static LineStyle.LineJoinStyle |
lineJoinStyle(String style)
Gets the LineJoinStyle.
|
static String[] |
lineJoinStyleNames()
Gets the names of available LineJoinStyles.
|
static LineStyle |
lineStyle()
Creates a LineStyle.
|
static LineStyle |
lineStyle(double... dashPattern)
Gets a LineStyle instance with specified dash pattern.
|
static LineStyle |
lineStyle(double width)
Gets a LineStyle instance with specified thickness.
|
static LineStyle |
lineStyle(double width,
double[] dashPattern)
Gets a LineStyle instance with specified thickness and dash pattern.
|
static LineStyle |
lineStyle(double width,
float[] dashPattern)
Gets a LineStyle instance with specified thickness and dash pattern.
|
static LineStyle |
lineStyle(double width,
int[] dashPattern)
Gets a LineStyle instance with specified thickness and dash pattern.
|
static LineStyle |
lineStyle(double width,
LineStyle.LineEndStyle endStyle,
LineStyle.LineJoinStyle joinStyle,
double... dashPattern)
Gets a LineStyle instance with specified thickness,
LineStyle.LineEndStyle ,
LineStyle.LineJoinStyle , and dash pattern. |
static <T extends Number> |
lineStyle(double width,
LineStyle.LineEndStyle endStyle,
LineStyle.LineJoinStyle joinStyle,
List<T> dashPattern)
Gets a LineStyle instance with specified thickness,
LineStyle.LineEndStyle ,
LineStyle.LineJoinStyle , and dash pattern. |
static <T extends Number> |
lineStyle(double width,
List<T> dashPattern)
Gets a LineStyle instance with specified thickness and dash pattern.
|
static LineStyle |
lineStyle(double width,
long[] dashPattern)
Gets a LineStyle instance with specified thickness and dash pattern.
|
static LineStyle |
lineStyle(double width,
String endStyle,
String joinStyle,
double... dashPattern)
Gets a LineStyle instance with specified thickness,
LineStyle.LineEndStyle ,
LineStyle.LineJoinStyle , and dash pattern. |
static <T extends Number> |
lineStyle(double width,
String endStyle,
String joinStyle,
List<T> dashPattern)
Gets a LineStyle instance with specified thickness,
LineStyle.LineEndStyle ,
LineStyle.LineJoinStyle , and dash pattern. |
static <T extends Number> |
lineStyle(double width,
T[] dashPattern)
Gets a LineStyle instance with specified thickness and dash pattern.
|
static <T extends Number> |
lineStyle(List<T> dashPattern)
Gets a LineStyle instance with specified dash pattern.
|
static LineStyle |
lineStyle(String endStyle,
String joinStyle)
Gets a LineStyle instance with specified
LineStyle.LineEndStyle and LineStyle.LineJoinStyle
Defaults line width to 1.0. |
String |
toString() |
public LineStyle(double width, LineStyle.LineEndStyle endStyle, LineStyle.LineJoinStyle joinStyle, double... dashPattern)
LineStyle.LineEndStyle
,
LineStyle.LineJoinStyle
, and dash pattern.width
- line thicknessendStyle
- line end stylejoinStyle
- line join styledashPattern
- dash patternpublic LineStyle(double width, LineStyle.LineEndStyle endStyle, LineStyle.LineJoinStyle joinStyle, List<T> dashPattern)
LineStyle.LineEndStyle
,
LineStyle.LineJoinStyle
, and dash pattern.T
- data type of dashPattern
width
- line thicknessendStyle
- line end stylejoinStyle
- line join styledashPattern
- dash patternpublic LineStyle(double width, String endStyle, String joinStyle, double... dashPattern)
LineStyle.LineEndStyle
,
LineStyle.LineJoinStyle
, and dash pattern.width
- line thicknessendStyle
- line end style descriptorjoinStyle
- line join style descriptordashPattern
- dash patternpublic LineStyle(double width, String endStyle, String joinStyle, List<T> dashPattern)
LineStyle.LineEndStyle
,
LineStyle.LineJoinStyle
, and dash pattern.T
- data type of dashPattern
width
- line thicknessendStyle
- line end style descriptorjoinStyle
- line join style descriptordashPattern
- dash patternpublic LineStyle(double width)
LineStyle.LineEndStyle
and LineStyle.LineJoinStyle
to LineStyle.LineJoinStyle.ROUND
.
No dash pattern is set.width
- line thicknesspublic LineStyle(double width, double[] dashPattern)
LineStyle.LineEndStyle
and LineStyle.LineJoinStyle
to LineStyle.LineJoinStyle.ROUND
.width
- line thicknessdashPattern
- dash patternpublic LineStyle(double width, int[] dashPattern)
LineStyle.LineEndStyle
and LineStyle.LineJoinStyle
to LineStyle.LineJoinStyle.ROUND
.width
- line thicknessdashPattern
- dash patternpublic LineStyle(double width, long[] dashPattern)
LineStyle.LineEndStyle
and LineStyle.LineJoinStyle
to LineStyle.LineJoinStyle.ROUND
.width
- line thicknessdashPattern
- dash patternpublic LineStyle(double width, float[] dashPattern)
LineStyle.LineEndStyle
and LineStyle.LineJoinStyle
to LineStyle.LineJoinStyle.ROUND
.width
- line thicknessdashPattern
- dash patternpublic LineStyle(double width, T[] dashPattern)
LineStyle.LineEndStyle
and LineStyle.LineJoinStyle
to LineStyle.LineJoinStyle.ROUND
.T
- data type of dashPattern
width
- line thicknessdashPattern
- dash patternpublic LineStyle(double width, List<T> dashPattern)
LineStyle.LineEndStyle
and LineStyle.LineJoinStyle
to LineStyle.LineJoinStyle.ROUND
.T
- data type of dashPattern
width
- line thicknessdashPattern
- dash patternpublic LineStyle(double... dashPattern)
LineStyle.LineEndStyle
and LineStyle.LineJoinStyle
to LineStyle.LineJoinStyle.ROUND
.dashPattern
- dash patternpublic LineStyle(List<T> dashPattern)
LineStyle.LineEndStyle
and LineStyle.LineJoinStyle
to LineStyle.LineJoinStyle.ROUND
.T
- data type of dashPattern
dashPattern
- dash patternpublic LineStyle(String endStyle, String joinStyle)
LineStyle.LineEndStyle
and LineStyle.LineJoinStyle
Defaults line width to 1.0. No dash pattern is set.endStyle
- line end stylejoinStyle
- line join stylepublic LineStyle()
LineStyle.LineEndStyle
and
LineStyle.LineJoinStyle
to LineStyle.LineJoinStyle.ROUND
. No dash pattern is set.public static LineStyle.LineEndStyle lineEndStyle(String style)
style
- case insensitive style name.style
IllegalArgumentException
- style
can not be nullpublic static String[] lineEndStyleNames()
public static LineStyle.LineJoinStyle lineJoinStyle(String style)
style
- case insensitive style namestyle
IllegalArgumentException
- style
can not be nullpublic static String[] lineJoinStyleNames()
public static LineStyle lineStyle(double width, LineStyle.LineEndStyle endStyle, LineStyle.LineJoinStyle joinStyle, double... dashPattern)
LineStyle.LineEndStyle
,
LineStyle.LineJoinStyle
, and dash pattern.width
- line thicknessendStyle
- line end stylejoinStyle
- line join styledashPattern
- dash patternLineStyle.LineEndStyle
and LineStyle.LineJoinStyle
.public static <T extends Number> LineStyle lineStyle(double width, LineStyle.LineEndStyle endStyle, LineStyle.LineJoinStyle joinStyle, List<T> dashPattern)
LineStyle.LineEndStyle
,
LineStyle.LineJoinStyle
, and dash pattern.T
- data type of dashPattern
width
- line thicknessendStyle
- line end stylejoinStyle
- line join styledashPattern
- dash patternLineStyle.LineEndStyle
and LineStyle.LineJoinStyle
.public static LineStyle lineStyle(double width, String endStyle, String joinStyle, double... dashPattern)
LineStyle.LineEndStyle
,
LineStyle.LineJoinStyle
, and dash pattern.width
- line thicknessendStyle
- line end style descriptorjoinStyle
- line join style descriptordashPattern
- dash patternLineStyle.LineEndStyle
and LineStyle.LineJoinStyle
.public static <T extends Number> LineStyle lineStyle(double width, String endStyle, String joinStyle, List<T> dashPattern)
LineStyle.LineEndStyle
,
LineStyle.LineJoinStyle
, and dash pattern.T
- data type of dashPattern
width
- line thicknessendStyle
- line end style descriptorjoinStyle
- line join style descriptordashPattern
- dash patternLineStyle.LineEndStyle
and LineStyle.LineJoinStyle
.public static LineStyle lineStyle(double width)
LineStyle.LineEndStyle
and LineStyle.LineJoinStyle
to LineStyle.LineJoinStyle.ROUND
.
No dash pattern is set.width
- line thicknessLineStyle.LineEndStyle
and LineStyle.LineJoinStyle
.public static LineStyle lineStyle(double width, double[] dashPattern)
LineStyle.LineEndStyle
and LineStyle.LineJoinStyle
to LineStyle.LineJoinStyle.ROUND
.width
- line thicknessdashPattern
- dash patternLineStyle.LineEndStyle
and LineStyle.LineJoinStyle
.public static LineStyle lineStyle(double width, int[] dashPattern)
LineStyle.LineEndStyle
and LineStyle.LineJoinStyle
to LineStyle.LineJoinStyle.ROUND
.width
- line thicknessdashPattern
- dash patternLineStyle.LineEndStyle
and LineStyle.LineJoinStyle
.public static LineStyle lineStyle(double width, long[] dashPattern)
LineStyle.LineEndStyle
and LineStyle.LineJoinStyle
to LineStyle.LineJoinStyle.ROUND
.width
- line thicknessdashPattern
- dash patternLineStyle.LineEndStyle
and LineStyle.LineJoinStyle
.public static LineStyle lineStyle(double width, float[] dashPattern)
LineStyle.LineEndStyle
and LineStyle.LineJoinStyle
to LineStyle.LineJoinStyle.ROUND
.width
- line thicknessdashPattern
- dash patternLineStyle.LineEndStyle
and LineStyle.LineJoinStyle
.public static <T extends Number> LineStyle lineStyle(double width, T[] dashPattern)
LineStyle.LineEndStyle
and LineStyle.LineJoinStyle
to LineStyle.LineJoinStyle.ROUND
.T
- data type of dashPattern
width
- line thicknessdashPattern
- dash patternLineStyle.LineEndStyle
and LineStyle.LineJoinStyle
.public static <T extends Number> LineStyle lineStyle(double width, List<T> dashPattern)
LineStyle.LineEndStyle
and LineStyle.LineJoinStyle
to LineStyle.LineJoinStyle.ROUND
.T
- data type of dashPattern
width
- line thicknessdashPattern
- dash patternLineStyle.LineEndStyle
and LineStyle.LineJoinStyle
.public static LineStyle lineStyle(double... dashPattern)
LineStyle.LineEndStyle
and LineStyle.LineJoinStyle
to LineStyle.LineJoinStyle.ROUND
.dashPattern
- dash patternLineStyle.LineEndStyle
, and LineStyle.LineJoinStyle
.public static <T extends Number> LineStyle lineStyle(List<T> dashPattern)
LineStyle.LineEndStyle
and LineStyle.LineJoinStyle
to LineStyle.LineJoinStyle.ROUND
.T
- data type of dashPattern
dashPattern
- dash patternLineStyle.LineEndStyle
, and LineStyle.LineJoinStyle
.public static LineStyle lineStyle(String endStyle, String joinStyle)
LineStyle.LineEndStyle
and LineStyle.LineJoinStyle
Defaults line width to 1.0. No dash pattern is set.endStyle
- line end stylejoinStyle
- line join styleLineStyle.LineEndStyle
and LineStyle.LineJoinStyle
and default line width and dash pattern.public static LineStyle lineStyle()
LineStyle.LineEndStyle
and
LineStyle.LineJoinStyle
to LineStyle.LineJoinStyle.ROUND
. No dash pattern is set.public double getWidth()
public LineStyle.LineEndStyle getEndStyle()
LineStyle.LineEndStyle
of this LineStyle.LineStyle.LineEndStyle
public LineStyle.LineJoinStyle getJoinStyle()
LineStyle.LineJoinStyle
of this LineStyle.LineStyle.LineJoinStyle
public float[] getDashPattern()