Package ucar.unidata.idv.control.chart
Class TrackSegment
java.lang.Object
ucar.unidata.collab.SharableImpl
ucar.unidata.collab.PropertiedThing
ucar.unidata.idv.control.chart.ChartAnnotation
ucar.unidata.idv.control.chart.TrackSegment
- All Implemented Interfaces:
PropertyChangeListener,EventListener,org.jfree.chart.annotations.Annotation,org.jfree.chart.annotations.XYAnnotation,Sharable
Provides a time series chart
- Version:
- $Revision: 1.12 $
- Author:
- IDV Development Team
-
Field Summary
Fields inherited from class ucar.unidata.idv.control.chart.ChartAnnotation
COLOR_SELECTED, transform, x, yFields inherited from class ucar.unidata.collab.PropertiedThing
propertiesDialog -
Constructor Summary
ConstructorsConstructorDescriptionDefault ctorTrackSegment(WayPoint wayPoint1, WayPoint wayPoint2, PlotWrapper plotWrapper) Ctor -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChangeListener(org.jfree.chart.event.AnnotationChangeListener arg0) doubledistance(int x, int y) Distance to the x/y.voiddraw(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.doubleGet the domain value at the center of the segmentgetLeft()Get the left most waypoint.getRight()Get the right most waypoint.Get the tool tip textType of annotationGet the WayPoint1 property.Get the WayPoint2 property.voidremoveChangeListener(org.jfree.chart.event.AnnotationChangeListener arg0) voidsetPosition(int x, int y) Set the position to the given x/y screen coordinatevoidsetWayPoint1(WayPoint value) Set the WayPoint1 property.voidsetWayPoint2(WayPoint value) Set the WayPoint2 property.Methods inherited from class ucar.unidata.idv.control.chart.ChartAnnotation
addPropertyChangeListener, applyProperties, distance, doRemove, formatValue, getColor, getName, getPlotWrapper, getPropertiesComponents, getSelected, getX, getY, isActive, removePropertyChangeListener, setActive, setColor, setGraphicsState, setName, setPlotWrapper, setPosition, setSelected, showColorInProperties, toStringMethods inherited from class ucar.unidata.collab.PropertiedThing
doApplyProperties, firePropertyChange, firePropertyChange, getPropertyListeners, getPropertyTabs, isShowing, propertyChange, showProperties, showPropertiesMethods inherited from class ucar.unidata.collab.SharableImpl
applySharableProperties, doShare, doShare, doShareExternal, doShareInternal, getReceiveShareTime, getSharablePropertiesComponent, getShareGroup, getSharing, getUniqueId, initSharable, receiveShareData, removeSharable, setReceiveShareTime, setShareGroup, setSharing, setUniqueId, showSharableDialog
-
Constructor Details
-
TrackSegment
public TrackSegment()Default ctor -
TrackSegment
Ctor- Parameters:
wayPoint1- wayPoint1wayPoint2- wayPoint1plotWrapper- The chart I'm in
-
-
Method Details
-
getToolTipText
Get the tool tip text- Overrides:
getToolTipTextin classChartAnnotation- Returns:
- Tool tip text
-
getTypeName
Type of annotation- Specified by:
getTypeNamein classChartAnnotation- Returns:
- Type of annotation
-
setPosition
public void setPosition(int x, int y) Set the position to the given x/y screen coordinate- Overrides:
setPositionin classChartAnnotation- Parameters:
x- xy- 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
Get the left most waypoint. The one with the smallest domain value- Returns:
- Waypoint on left
-
getRight
Get the right most waypoint. the one with the largest domain value- Returns:
- Waypoint on right
-
setWayPoint1
Set the WayPoint1 property.- Parameters:
value- The new value for WayPoint1
-
getWayPoint1
Get the WayPoint1 property.- Returns:
- The WayPoint1
-
setWayPoint2
Set the WayPoint2 property.- Parameters:
value- The new value for WayPoint2
-
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:
distancein classChartAnnotation- Parameters:
x- mouse xy- mouse y- Returns:
- distance
-
addChangeListener
public void addChangeListener(org.jfree.chart.event.AnnotationChangeListener arg0) -
removeChangeListener
public void removeChangeListener(org.jfree.chart.event.AnnotationChangeListener arg0)
-