Class TrackSegment

All Implemented Interfaces:
PropertyChangeListener, EventListener, org.jfree.chart.annotations.Annotation, org.jfree.chart.annotations.XYAnnotation, Sharable

public class TrackSegment extends ChartAnnotation
Provides a time series chart
Version:
$Revision: 1.12 $
Author:
IDV Development Team
  • Constructor Details

    • TrackSegment

      public TrackSegment()
      Default ctor
    • TrackSegment

      public TrackSegment(WayPoint wayPoint1, WayPoint wayPoint2, PlotWrapper plotWrapper)
      Ctor
      Parameters:
      wayPoint1 - wayPoint1
      wayPoint2 - wayPoint1
      plotWrapper - The chart I'm in
  • Method Details

    • getToolTipText

      public String getToolTipText()
      Get the tool tip text
      Overrides:
      getToolTipText in class ChartAnnotation
      Returns:
      Tool tip text
    • getTypeName

      public String getTypeName()
      Type of annotation
      Specified by:
      getTypeName in class ChartAnnotation
      Returns:
      Type of annotation
    • setPosition

      public void setPosition(int x, int y)
      Set the position to the given x/y screen coordinate
      Overrides:
      setPosition in class ChartAnnotation
      Parameters:
      x - x
      y - y
    • getCenterValue

      public double getCenterValue()
      Get the domain value at the center of the segment
      Returns:
      center value
    • draw

      public void draw(Graphics2D g2, org.jfree.chart.plot.XYPlot plot, Rectangle2D dataArea, org.jfree.chart.axis.ValueAxis domainAxis, org.jfree.chart.axis.ValueAxis rangeAxis, int rendererIndex, org.jfree.chart.plot.PlotRenderingInfo info)
      Draws the wayPoint.
      Parameters:
      g2 - the graphics device.
      plot - the plot.
      dataArea - the data area.
      domainAxis - the domain axis.
      rangeAxis - the range axis.
      rendererIndex - the renderer index.
      info - an optional info object that will be populated with entity information.
    • getLeft

      public WayPoint getLeft()
      Get the left most waypoint. The one with the smallest domain value
      Returns:
      Waypoint on left
    • getRight

      public WayPoint getRight()
      Get the right most waypoint. the one with the largest domain value
      Returns:
      Waypoint on right
    • setWayPoint1

      public void setWayPoint1(WayPoint value)
      Set the WayPoint1 property.
      Parameters:
      value - The new value for WayPoint1
    • getWayPoint1

      public WayPoint getWayPoint1()
      Get the WayPoint1 property.
      Returns:
      The WayPoint1
    • setWayPoint2

      public void setWayPoint2(WayPoint value)
      Set the WayPoint2 property.
      Parameters:
      value - The new value for WayPoint2
    • getWayPoint2

      public WayPoint getWayPoint2()
      Get the WayPoint2 property.
      Returns:
      The WayPoint2
    • distance

      public double distance(int x, int y)
      Distance to the x/y. If the mouse is left of the left waypoint then use the distance to the left point. Same with the right waypoint. If is is between the end points then use the y distance.
      Overrides:
      distance in class ChartAnnotation
      Parameters:
      x - mouse x
      y - mouse y
      Returns:
      distance
    • addChangeListener

      public void addChangeListener(org.jfree.chart.event.AnnotationChangeListener arg0)
    • removeChangeListener

      public void removeChangeListener(org.jfree.chart.event.AnnotationChangeListener arg0)