Class PathInfo

java.lang.Object
com.motivewave.platform.sdk.common.PathInfo
All Implemented Interfaces:
TagInfo, Cloneable

public class PathInfo extends Object implements Cloneable, TagInfo
Describes how to display a Path on a graph.
  • Constructor Details

    • PathInfo

      public PathInfo(Color c, float width, float[] dash, boolean enabled, boolean continuous, boolean showBars, int barCenter, Integer fixedWidth)
      Constructor. Creates a path info for displaying a series of points connected by lines.
      Parameters:
      c - color of the path
      width - width of line used to connect the path points
      dash - dash style (null if solid line)
      enabled - true if this path should be displayed
      continuous - true if this path is continuous even with missing values
      showBars - true if the path should be shown as bars
      barCenter - center point for drawing bars
      fixedWidth - fixed with of the bars
    • PathInfo

      public PathInfo(Color c, Color c2, Enums.ColorPolicy colorPolicy, Double gradientCenter, Enums.ShadeType shadeType, float width, float[] dash, int maxPoints, boolean allPoints, boolean enabled, boolean continuous, boolean showBars, int barCenter, Integer fixedWidth)
      Constructor
      Parameters:
      c - primary path color
      c2 - secondary path color
      colorPolicy - policy for applying colors to the path
      gradientCenter - center point for the gradient, null if automatic
      shadeType - type of shading for path
      width - width of the lines connecting the path points
      dash - dash style (null for solid line)
      maxPoints - max points to display
      allPoints - true if all points should be displayed
      enabled - true if this path should be displayed
      continuous - true if this path is continuous even with missing values
      showBars - true if this path should be shown as bars
      barCenter - center point for drawing bars
      fixedWidth - fixed width for the bars
    • PathInfo

      public PathInfo(Color c, Color c2, Color c3, Color c4, Enums.ColorPolicy colorPolicy, Double gradientCenter, Enums.ShadeType shadeType, float width, float[] dash, int maxPoints, boolean allPoints, boolean enabled, boolean continuous, boolean showBars, int barCenter, Integer fixedWidth)
      Constructor
      Parameters:
      c - primary path color
      c2 - secondary path color
      c3 - tertiary path color
      c4 - quaternary path color
      colorPolicy - policy for applying colors to the path
      gradientCenter - center point for the gradient, null if automatic
      shadeType - type of shading for path
      width - width of the lines connecting the path points
      dash - dash style (null for solid line)
      maxPoints - max points to display
      allPoints - true if all points should be displayed
      enabled - true if this path should be displayed
      continuous - true if this path is continuous even with missing values
      showBars - true if this path should be shown as bars
      barCenter - center point for drawing bars
      fixedWidth - fixed width for the bars
    • PathInfo

      public PathInfo(Color c, Color c2, Enums.PointType type, Enums.Size size, int maxPoints, boolean allPoints, boolean enabled, boolean continuous, boolean showBars, int barCenter, Integer fixedWidth)
      Constructor.
      Parameters:
      c - color for lines that are trending upward
      c2 - color for lines that are trending downward
      type - type of point to display
      size - size of the points
      maxPoints - max points to display
      allPoints - true if all points should be displayed
      enabled - true if this path should be displayed
      continuous - true if this path is continuous even with missing values
      showBars - true if this path should be shown as bars
      barCenter - center point for drawing bars
      fixedWidth - fixed width for the bars
    • PathInfo

      public PathInfo(Color c, Color c2, Enums.ColorPolicy colorPolicy, Double gradientCenter, Enums.ShadeType shadeType, Enums.PointType type, Enums.Size size, int maxPoints, boolean allPoints, boolean enabled, boolean continuous, boolean showBars, int barCenter, Integer fixedWidth)
      Constructor.
      Parameters:
      c - color for lines that are trending upward
      c2 - color for lines that are trending downward
      colorPolicy - policy for applying colors to the path
      gradientCenter - center point for the gradient, null if automatic
      shadeType - type of shading for path
      type - type of point to display
      size - size of the points
      maxPoints - max points to display
      allPoints - true if all points should be displayed
      enabled - true if this path should be displayed
      continuous - true if this path is continuous even with missing values
      showBars - true if this path should be shown as bars
      barCenter - center point for drawing bars
      fixedWidth - fixed width for the bars
    • PathInfo

      public PathInfo(Color c, Color c2, Color c3, Color c4, Enums.ColorPolicy colorPolicy, Double gradientCenter, Enums.ShadeType shadeType, Enums.PointType type, Enums.Size size, int maxPoints, boolean allPoints, boolean enabled, boolean continuous, boolean showBars, int barCenter, Integer fixedWidth)
      Constructor.
      Parameters:
      c - primary path color
      c2 - secondary path color
      c3 - tertiary path color
      c4 - quaternary path color
      colorPolicy - policy for applying colors to the path
      gradientCenter - center point for the gradient, null if automatic
      shadeType - type of shading for path
      type - type of point to display
      size - size of the points
      maxPoints - max points to display
      allPoints - true if all points should be displayed
      enabled - true if this path should be displayed
      continuous - true if this path is continuous even with missing values
      showBars - true if this path should be shown as bars
      barCenter - center point for drawing bars
      fixedWidth - fixed width for the bars
    • PathInfo

      public PathInfo(Color c, Color c2, Enums.ColorPolicy colorPolicy, Double gradientCenter, Enums.ShadeType shadeType, float width, float[] dash, Enums.PointType type, Enums.Size size, int maxPoints, boolean allPoints, boolean enabled, boolean continuous, boolean showBars, int barCenter, Integer fixedWidth)
      Constructor. Creates a path info for displaying the lines and points of the path.
      Parameters:
      c - color for lines that are trending upward
      c2 - color for lines that are trending downward
      colorPolicy - policy for applying colors to the path
      gradientCenter - center point for the gradient, null if automatic
      shadeType - type of shading for path
      width - width of the lines connecting the path points
      dash - dash style (null for solid line)
      type - type of point to display
      size - size of the points
      maxPoints - max points to display
      allPoints - true if all points should be displayed
      enabled - true if this path should be displayed
      continuous - true if this path is continuous even with missing values
      showBars - true if this path should be shown as bars
      barCenter - center point for drawing bars
      fixedWidth - fixed width for the bars
    • PathInfo

      public PathInfo(Color c, Color c2, Color c3, Color c4, Enums.ColorPolicy colorPolicy, Double gradientCenter, Enums.ShadeType shadeType, float width, float[] dash, Enums.PointType type, Enums.Size size, int maxPoints, boolean allPoints, boolean enabled, boolean continuous, boolean showBars, int barCenter, Integer fixedWidth)
      Constructor. Creates a path info for displaying the lines and points of the path.
      Parameters:
      c - primary color
      c2 - secondary color
      c3 - tertiary color
      c4 - quaternary color
      colorPolicy - policy for applying colors to the path
      gradientCenter - center point for the gradient, null if automatic
      shadeType - type of shading for path
      width - width of the lines connecting the path points
      dash - dash style (null for solid line)
      type - type of point to display
      size - size of the points
      maxPoints - max points to display
      allPoints - true if all points should be displayed
      enabled - true if this path should be displayed
      continuous - true if this path is continuous even with missing values
      showBars - true if this path should be shown as bars
      barCenter - center point for drawing bars
      fixedWidth - fixed width for the bars
    • PathInfo

      public PathInfo(Color c, Color c2, Color c3, Color c4, Enums.ColorPolicy colorPolicy, Double gradientCenter, Enums.ShadeType shadeType, float width, float[] dash, boolean showPath, boolean showPoints, Enums.PointType type, Enums.Size size, int maxPoints, boolean allPoints, boolean enabled, boolean continuous, boolean showBars, int barCenter, Integer fixedWidth, boolean showTag, boolean showTagValue, String tag, Font tagFont, Color tagTextColor, Color tagBgColor)
      Constructor. Creates a path info for displaying the lines and points of the path.
      Parameters:
      c - primary color
      c2 - secondary color
      c3 - tertiary color
      c4 - quaternary color
      colorPolicy - policy for applying colors to the path
      gradientCenter - center point for the gradient, null if automatic
      shadeType - type of shading for path
      width - width of the lines connecting the path points
      dash - dash style (null for solid line)
      type - type of point to display
      size - size of the points
      maxPoints - max points to display
      allPoints - true if all points should be displayed
      enabled - true if this path should be displayed
      continuous - true if this path is continuous even with missing values
      showBars - true if this path should be shown as bars
      barCenter - center point for drawing bars
      fixedWidth - fixed width for the bars
      showTag - true if the tag should be displayed
      showTagValue - true if the value should be displayed in the tag
      tag - text for the tag
      tagFont - font for the tag
      tagTextColor - color for the tag text (null for the path color)
      tagBgColor - color for the tag background (null for no background)
  • Method Details

    • getColor

      public Color getColor()
      Gets the main color of the path lines and points.
      Returns:
      main color for drawing the path
    • setColor

      public PathInfo setColor(Color color)
      Creates a copy of the object and sets main color of the path.
      Parameters:
      color - main color
      Returns:
      copy of the object
    • getColor2

      public Color getColor2()
      Gets the secondary color of the path lines and points. Typically upward trending points use color and downward trending use color2
      Returns:
      color for downward trending parts of the path
    • getColor3

      public Color getColor3()
      Gets the tertiary color of the path lines and points. The purpose of this color depends on the Color Policy
      Returns:
      tertiary color
    • getColor4

      public Color getColor4()
      Gets the quaternary color of the path lines and points. The purpose of this color depends on the Color Policy
      Returns:
      quaternary color
    • getDash

      public float[] getDash()
      Gets the dash style for the lines connecting the path points (null for solid line).
      Returns:
      dash style
    • setDash

      public PathInfo setDash(float[] dash)
      Creates a copy of the object and sets dash style
      Parameters:
      dash - dash style
      Returns:
      copy of the object
    • getWidth

      public float getWidth()
      Gets the width of the lines connecting the path points.
      Returns:
      the width of the path line
    • setWidth

      public PathInfo setWidth(float width)
      Creates a copy of the object and sets the width of the lines connecting path points.
      Parameters:
      width - width of the path line
      Returns:
      copy of the object with the width set
    • isEnabled

      public boolean isEnabled()
      Indicates if this path should be displayed.
      Returns:
      true if this path is enabled
    • isShowPoints

      public boolean isShowPoints()
      Indicates if the points should be displayed.
      Returns:
      true if the points should be drawn
    • isShowPath

      public boolean isShowPath()
      Indicates if the path lines should be shown.
      Returns:
      true if the path should be shown
    • getPointSize

      public Enums.Size getPointSize()
      Gets the size of the path points.
      Returns:
      the point size
    • getPointType

      public Enums.PointType getPointType()
      Gets the type of the path points.
      Returns:
      the type of points to draw for the path points
    • getMaxPoints

      public int getMaxPoints()
      Gets the max points to show.
      Returns:
      the maximum number of points to show.
    • isShowAllPoints

      public boolean isShowAllPoints()
      Indicates if all points should be shown.
      Returns:
      true if all points should be shown.
    • isContinuous

      public boolean isContinuous()
      Indicates if the path is continuous.
      Returns:
      true if the path is continuous
    • getColorPolicy

      public Enums.ColorPolicy getColorPolicy()
      Indicates the policy for applying colors to the series of values.
      Returns:
      color policy for applying colors
    • getShadeType

      public Enums.ShadeType getShadeType()
      Indicates the shade type for shading above/below the path.
      Returns:
      shade type for shading above/below the path
    • isGradient

      @Deprecated public boolean isGradient()
      Deprecated.
      use getColorPolicy instead
      Indicates if the color is a gradient.
      Returns:
      true if the path color is a gradient
    • getGradientCenter

      public Double getGradientCenter()
      Gets the gradient center (real value). If this value is null, then the gradient will center will be determined automatically.
      Returns:
      gradient center (null if automatically determined)
    • isShowAsBars

      public boolean isShowAsBars()
      Indicates if the path should be shown as bars.
      Returns:
      true if the path should be shown as bars
    • getBarCenter

      public int getBarCenter()
      Gets the center point for drawing bars (positive/negative bars).
      Returns:
      center point for drawing bars
    • getFixedWidth

      public Integer getFixedWidth()
      Gets the fixed width for drawing the bars (null for dynamic width). This property is only used if show as bars is true.
      Returns:
      fixed bar width (null for dynamic)
    • getStroke

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

      public Stroke getSelectedStroke()
      Gets the stroke for drawing the path when the study is selected.
      Returns:
      the stroke used to draw the path when it is selected
    • getTagFont

      public Font getTagFont()
      Gets the font for the tag label.
      Specified by:
      getTagFont in interface TagInfo
      Returns:
      font
    • isShowTag

      public boolean isShowTag()
      Indicates if the tag should be shown on the path.
      Specified by:
      isShowTag in interface TagInfo
      Returns:
      true if the tag should be shown
    • setShowTag

      public PathInfo setShowTag(boolean showTag)
      Creates a copy of the object and sets the showTag attribute.
      Parameters:
      showTag - true if the tag should be displayed
      Returns:
      copy of the object
    • isShowTagValue

      public boolean isShowTagValue()
      Indicates if the latest value should be shown in the tag.
      Specified by:
      isShowTagValue in interface TagInfo
      Returns:
      true if the latest value should be added to the tag
    • setShowTagValue

      public PathInfo setShowTagValue(boolean showTagValue)
      Creates a copy of the object and sets the showTagValue attribute.
      Parameters:
      showTag - true if the tag value should be displayed
      Returns:
      copy of the object
    • getTag

      public String getTag()
      Gets the descriptive tag to be shown next on the path.
      Specified by:
      getTag in interface TagInfo
      Returns:
      descriptive tag
    • setTag

      public PathInfo setTag(String tag)
      Creates a copy of the object and sets the tag attribute.
      Parameters:
      tag - text to be displayed in the tag
      Returns:
      copy of the object
    • getTagTextColor

      public Color getTagTextColor()
      Gets the text color for the tag.
      Specified by:
      getTagTextColor in interface TagInfo
      Returns:
      text color for the tag
    • getTagBgColor

      public Color getTagBgColor()
      Gets the background color for the tag.
      Specified by:
      getTagBgColor in interface TagInfo
      Returns:
      background color for the tag
    • clone

      public PathInfo clone()
      Creates a clone (copy) of this object.
      Overrides:
      clone in class Object
      Returns:
      clone of this object
    • equals

      public boolean equals(Object o)
      Compares the give object with this object and returns true if they are equal.
      Overrides:
      equals in class Object
      Returns:
      true if the given object equals this BarInfo