Class LineInfo

java.lang.Object
com.motivewave.platform.sdk.common.BaseInfo
com.motivewave.platform.sdk.common.LineInfo
All Implemented Interfaces:
Cloneable

public class LineInfo extends BaseInfo
Describes a horizontal line that is to be displayed in a Study.
  • Constructor Details

    • LineInfo

      public LineInfo()
    • LineInfo

      public LineInfo(boolean enabled)
    • LineInfo

      public LineInfo(float[] dash)
    • LineInfo

      public LineInfo(Color lineColor)
      Constructor.
      Parameters:
      lineColor - color of the line
    • LineInfo

      public LineInfo(Color lineColor, boolean enabled)
      Constructor.
      Parameters:
      lineColor - color of the line
      enabled - true if the line is enabled
    • LineInfo

      public LineInfo(Color lineColor, float width, boolean enabled)
      Constructor.
      Parameters:
      lineColor - color of the line
      width - width of the line
      enabled - true if the line is enabled
    • LineInfo

      public LineInfo(double value, Color lineColor, float width, float[] dash)
      Constructor.
      Parameters:
      value - y value for the horizontal line
      lineColor - color of the line
      width - width of the line
      dash - dash style (null for solid line)
    • LineInfo

      public LineInfo(double value, Color lineColor, float width, float[] dash, boolean enabled)
      Constructor.
      Parameters:
      value - y value for the horizontal line
      lineColor - color of the line
      width - width of the line
      dash - dash style (null for solid line)
    • LineInfo

      public LineInfo(Color lineColor, float width, float[] dash, boolean enabled)
      Constructor.
      Parameters:
      lineColor - color of the line
      width - width of the line
      dash - dash style (null for solid line)
      enabled - true if this line is enabled
  • Method Details

    • updateKey

      protected void updateKey()
      Overrides:
      updateKey in class BaseInfo
    • getValue

      public double getValue()
      Gets the y value (real value) for drawing this line.
      Returns:
      the y value (real value) for drawing this line.
    • getLineColor

      public Color getLineColor()
      Gets the color of the line (null if default line color)
      Returns:
      the color of the line (null if default line color)
    • getLineColor

      public Color getLineColor(Defaults def)
      Gets the color of the line and returns the default line color if the color is null
      Returns:
      the color of the line (null if default line color)
    • getDash

      public float[] getDash()
      Gets the dash style for the line (null for a solid line)
      Returns:
      the dash style for the line (null for a solid line)
    • getWidth

      public float getWidth()
      Gets the width of the line (null for a solid line)
      Returns:
      the width of the line (null for a solid line)
    • getStroke

      public Stroke getStroke(boolean selected)
    • getStroke

      public Stroke getStroke()
      Gets the stroke for drawing the line.
      Returns:
      stroke used to draw the line
    • getSelectedStroke

      public Stroke getSelectedStroke()
      Gets the stroke for drawing the line when the study is selected.
      Returns:
      stroke used to draw the line when it is selected by the user
    • withWidth

      public LineInfo withWidth(float width)
    • withLineColor

      public LineInfo withLineColor(Color c)
    • withDash

      public LineInfo withDash(float[] dash)
    • withValue

      public LineInfo withValue(double value)
    • withEnabled

      public LineInfo withEnabled(boolean b)
    • clone

      public LineInfo clone()
      Creates a clone (copy) of this object.
      Overrides:
      clone in class BaseInfo
      Returns:
      clone of this object
    • apply

      public void apply(Graphics2D gc)
      Applies settings to the graphics context.
    • toString

      public String toString()
      Gets string representation of this LineInfo object
      Overrides:
      toString in class BaseInfo
      Returns:
      string representation
    • toJson

      public Object toJson(BaseInfo def1)
      Specified by:
      toJson in class BaseInfo
    • fromJson

      public static LineInfo fromJson(Object obj, LineInfo def)