Class LineStyle

java.lang.Object
io.deephaven.plot.LineStyle
All Implemented Interfaces:
Serializable

public class LineStyle extends Object implements 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:
  • Constructor Details

  • Method Details

    • lineEndStyle

      public static LineStyle.LineEndStyle lineEndStyle(String style)
      Returns the shape drawn at the end of a line.
      Parameters:
      style - case insensitive style name.
      Returns:
      LineEndStyle specified by style
      Throws:
      IllegalArgumentException - style can not be null
    • lineEndStyleNames

      public static String[] lineEndStyleNames()
      Returns the names of available shapes draw at the end of a line.
      Returns:
      array of LineEndStyle names
    • lineJoinStyle

      public static LineStyle.LineJoinStyle lineJoinStyle(String style)
      Returns the style for drawing connections between line segments.
      Parameters:
      style - case insensitive style name
      Returns:
      LineJoinStyle specified by style
      Throws:
      IllegalArgumentException - style can not be null
    • lineJoinStyleNames

      public static String[] 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 thickness
      endStyle - line end style
      joinStyle - line join style
      dashPattern - 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 of dashPattern
      Parameters:
      width - line thickness
      endStyle - line end style
      joinStyle - line join style
      dashPattern - 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 thickness
      endStyle - line end style descriptor
      joinStyle - line join style descriptor
      dashPattern - 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 of dashPattern
      Parameters:
      width - line thickness
      endStyle - line end style descriptor
      joinStyle - line join style descriptor
      dashPattern - dash pattern
      Returns:
      line style.
    • lineStyle

      public static LineStyle lineStyle(double width)
      Returns a line style.
      Parameters:
      width - line thickness
      Returns:
      line style with no dash pattern set.
    • lineStyle

      public static LineStyle lineStyle(double width, double[] dashPattern)
      Returns a line style.
      Parameters:
      width - line thickness
      dashPattern - dash pattern
      Returns:
      line style with the line end style and line join style set to ROUND.
    • lineStyle

      public static LineStyle lineStyle(double width, int[] dashPattern)
      Returns a line style.
      Parameters:
      width - line thickness
      dashPattern - dash pattern
      Returns:
      line style with the line end style and line join style set to ROUND.
    • lineStyle

      public static LineStyle lineStyle(double width, long[] dashPattern)
      Returns a line style.
      Parameters:
      width - line thickness
      dashPattern - dash pattern
      Returns:
      line style with the line end style and line join style set to ROUND.
    • lineStyle

      public static LineStyle lineStyle(double width, float[] dashPattern)
      Returns a line style.
      Parameters:
      width - line thickness
      dashPattern - dash pattern
      Returns:
      line style with the line end style and line join style set to ROUND.
    • lineStyle

      public static <T extends Number> LineStyle lineStyle(double width, T[] dashPattern)
      Returns a line style.
      Type Parameters:
      T - data type of dashPattern
      Parameters:
      width - line thickness
      dashPattern - dash pattern
      Returns:
      line style with the line end style and line join style set to ROUND.
    • lineStyle

      public static <T extends Number> LineStyle lineStyle(double width, List<T> dashPattern)
      Returns a line style.
      Type Parameters:
      T - data type of dashPattern
      Parameters:
      width - line thickness
      dashPattern - dash pattern
      Returns:
      line style with the line end style and line join style set to ROUND.
    • lineStyle

      public static LineStyle lineStyle(double... dashPattern)
      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

      public static <T extends Number> LineStyle lineStyle(List<T> dashPattern)
      Returns a line style.
      Type Parameters:
      T - data type of dashPattern
      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

      public static LineStyle lineStyle(String endStyle, String joinStyle)
      Returns a line style.
      Parameters:
      endStyle - line end style
      joinStyle - line join style
      Returns:
      line style with the line width set to 1.0.
    • lineStyle

      public static LineStyle 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

      public LineStyle.LineEndStyle getEndStyle()
      Gets the LineStyle.LineEndStyle of this LineStyle.
      Returns:
      this LineStyle's LineStyle.LineEndStyle
    • getJoinStyle

      public LineStyle.LineJoinStyle getJoinStyle()
      Gets the LineStyle.LineJoinStyle of 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

      public String toString()
      Overrides:
      toString in class Object