Class Marker


public class Marker extends SinglePointFigure
Draws a marker of the given type and size on the graph.
  • Constructor Details

    • Marker

      public Marker(Coordinate loc, Enums.MarkerType type)
      Constructor. Creates a marker using absolute positioning.
      Parameters:
      loc - location to display the marker
      type - type of marker to display
    • Marker

      public Marker(Coordinate loc, Enums.Position position, MarkerInfo info)
      Constructor. Creates a marker using absolute positioning.
      Parameters:
      loc - location to display the marker
      position - relative position to display the marker around the location
      info - information used to display the marker
    • Marker

      public Marker(Coordinate loc, Enums.Position position, MarkerInfo info, String popupMessage)
      Constructor. Creates a marker using absolute positioning.
      Parameters:
      loc - location to display the marker
      position - relative position to display the marker around the location
      info - information used to display the marker
      popupMessage - message to display when the mouse cursor is above the marker
    • Marker

      public Marker(Coordinate loc, Enums.MarkerType type, Enums.Size size, Enums.Position position, Color fillColor, Color outlineColor)
      Constructor.
      Parameters:
      loc - location to display the marker
      type - type of marker to display
      size - size of the marker
      position - relative position to display the marker around the location
      fillColor - color used to fill the marker
      outlineColor - color used on the marker outline
  • Method Details

    • getType

      public Enums.MarkerType getType()
      Gets the type of marker to display.
      Returns:
      type of marker to display
    • setType

      public void setType(Enums.MarkerType type)
      Sets the type of marker to display.
      Parameters:
      type - type of the marker
    • getOutlineColor

      public Color getOutlineColor()
      Gets the color used on the marker outline.
      Returns:
      outline color for this marker
    • setOutlineColor

      public void setOutlineColor(Color color)
      Sets the color used on the marker outline.
      Parameters:
      color - outline color
    • getFillColor

      public Color getFillColor()
      Gets the color used to fill the marker.
      Returns:
      fill color
    • setFillColor

      public void setFillColor(Color color)
      Sets the color used to fill the marker.
      Parameters:
      color - fill color
    • getSize

      public Enums.Size getSize()
      Gets the size of the marker.
      Returns:
      size of the marker
    • setSize

      public void setSize(Enums.Size size)
      Sets the size of the marker.
      Parameters:
      size - size of the marker
    • setPosition

      public void setPosition(Enums.Position position)
      Sets the relative position of the marker to its location.
      Overrides:
      setPosition in class SinglePointFigure
      Parameters:
      position - position of the marker
    • setTextValue

      public void setTextValue(String text)
      Sets the value of the text label to be displayed with the marker.
      Parameters:
      text - text value to display with the marker
    • getText

      public Text getText()
      Gets the text label that is to be displayed with the marker.
      Returns:
      text label to display with the marker.
    • getTextPosition

      public Enums.Position getTextPosition()
      Gets the position of the text label that is displayed with the marker.
      Returns:
      position of the text label
    • setTextPosition

      public void setTextPosition(Enums.Position position)
      Sets the position of the text label that is displayed with the marker.
      Parameters:
      position - location to display text
    • draw

      public void draw(Graphics2D gc, DrawContext ctx)
      Draws the marker (and optional text).
      Overrides:
      draw in class Figure
      Parameters:
      gc - Graphics Context
      ctx - Draw Context
    • layout

      public void layout(DrawContext ctx)
      Lays out the marker by converting time and price coordinates into displayable x and y coordinates.
      Overrides:
      layout in class Figure
      Parameters:
      ctx - draw context
    • getStroke

      protected Stroke getStroke()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object