Class IndicatorInfo

All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
GuideInfo

public class IndicatorInfo extends TagInfo
Encapsulates configuration information for indicators that are displayed on the Price Axis (for overlays) or on the value axis (study graphs).
  • Field Details

    • id

      protected String id
    • label

      protected String label
    • labelColor

      protected Color labelColor
    • textColor

      protected Color textColor
    • lineColor

      protected Color lineColor
    • outlineColor

      protected Color outlineColor
    • font

      protected Font font
    • showLine

      protected boolean showLine
    • showLabel

      protected boolean showLabel
    • top

      protected boolean top
    • showOutline

      protected boolean showOutline
    • lineWidth

      protected float lineWidth
    • lineDash

      protected float[] lineDash
    • lineStroke

      protected BasicStroke lineStroke
  • Constructor Details

    • IndicatorInfo

      public IndicatorInfo(String id, Color lblColor, Color textColor, boolean showLine, boolean enabled)
      Constructs an Indicator Info.
      Parameters:
      id - - name (identifier)
      lblColor - - Background color
      textColor - - Text color
      showLine - - true if a vertical line should be shown with the indicator.
      enabled - - true if this indicator should be displayed.
    • IndicatorInfo

      public IndicatorInfo(String id, Color lblColor, Color textColor, Color outlineColor, boolean outlineEnabled, Font font, boolean top, boolean showLabel, Color lineColor, float lineWidth, float[] lineDash, boolean showLine, boolean showTag, String tag, Color tagTextColor, Color tagBgColor, boolean enabled)
      Constructs an Indicator Info.
      Parameters:
      id - - name (identifier)
      lblColor - - Background (Indicator Label) color
      textColor - - Text color
      outlineColor - - Outline Color for the label
      outlineEnabled - - true if the label outline should be drawn
      font - - Indicator Font
      top - - true if the indicator label should be shown on top
      showLabel - - true if the indicator label should be shown
      lineColor - - Line Color
      lineWidth - - Width of the Indicator Line
      lineDash - - Dash style of the Indicator Line (null for solid line)
      showLine - - true if a vertical line should be shown with the indicator.
      showTag - - true if the tag should be shown next to the label
      tag - - descriptive tag
      tagTextColor - text color for the tag
      tagBgColor - color for the tag background
      enabled - - true if this indicator should be displayed.
    • IndicatorInfo

      public IndicatorInfo(String id, boolean showLine, float lineWidth, float[] lineDash, Color lineColor, boolean showTag, String tag, TextStyle tagStyle, boolean showLabel, String label, Font labelFont, boolean showOutline, Color outlineColor, Color textColor, Color lblColor, boolean top, boolean enabled)
      Constructs an Indicator Info.
      Parameters:
      id - - name (identifier)
      showLine - - true if a vertical line should be shown with the indicator.
      lineWidth - - Width of the Indicator Line
      lineDash - - Dash style of the Indicator Line (null for solid line)
      lineColor - - Line Color
      showTag - - true if the tag should be shown next to the label
      tag - - descriptive tag
      showLabel - - true if the indicator label should be shown
      outlineColor - - Outline Color for the label
      textColor - - Text color
      lblColor - - Background (Indicator Label) color
      top - - true if the indicator label should be shown on top
      enabled - - true if this indicator should be displayed.
      outlineEnabled - - true if the label outline should be drawn
      font - - Indicator Font
      tagTextColor - text color for the tag
      tagBgColor - color for the tag background
  • Method Details

    • getId

      public String getId()
      Gets the name (id) of this indicator.
      Returns:
      name of the indicator
    • getName

      @Deprecated public String getName()
      Deprecated.
      use getId() instead
      Gets the name (id) of this indicator.
      Returns:
      name of the indicator
    • getLabel

      public String getLabel()
      Gets the label of this indicator.
      Returns:
      name of the indicator
    • isShowLabel

      public boolean isShowLabel()
      Indicates if this indicator label should be shown.
      Returns:
      true if the indicator label is visible
    • getLabelColor

      public Color getLabelColor()
      Gets the background color for the indicator.
      Returns:
      background color for the indicator
    • setLabelColor

      public IndicatorInfo setLabelColor(Color c)
      Creates a copy of the object and sets the label color.
      Parameters:
      c - color of the label
      Returns:
      copy of the object with the label color set
    • getTextColor

      public Color getTextColor()
      Gets the text color for the indicator.
      Returns:
      text color for the indicator
    • setTextColor

      public IndicatorInfo setTextColor(Color c)
      Creates a copy of the object and sets the text color.
      Parameters:
      c - color of the text
      Returns:
      copy of the object with the text color set
    • getOutlineColor

      public Color getOutlineColor()
      Gets the outline color for the indicator.
      Returns:
      outline color for the indicator
    • isOutlineEnabled

      public boolean isOutlineEnabled()
      Returns:
      true of the outline color should be used
    • getLineColor

      public Color getLineColor()
      Gets the color for the line.
      Returns:
      color for the line
    • isShowLine

      public boolean isShowLine()
      Indicates if this indicator should show a horizontal line.
      Returns:
      true if a line should drawn with this indicator
    • getLineDash

      public float[] getLineDash()
      Gets the dash style for the indicator line.
      Returns:
      dash style
    • getLineWidth

      public float getLineWidth()
      Gets the width of the indicator line.
      Returns:
      the with of the indicator line
    • getFont

      public Font getFont()
      Gets the font the indicator label and tag.
      Returns:
      font
    • isUseDefaultFont

      public boolean isUseDefaultFont()
      Returns:
      true if the default font should be used.
    • isTop

      public boolean isTop()
    • getLineStroke

      public Stroke getLineStroke()
    • clone

      public IndicatorInfo clone()
      Creates a clone (copy) of this object.
      Overrides:
      clone in class TagInfo
      Returns:
      clone of this object
    • toJson

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

      public static IndicatorInfo fromJson(String str, IndicatorInfo def)