Package ucar.unidata.idv.control.chart
Class ChartAnnotation
java.lang.Object
ucar.unidata.collab.SharableImpl
ucar.unidata.collab.PropertiedThing
ucar.unidata.idv.control.chart.ChartAnnotation
- All Implemented Interfaces:
PropertyChangeListener,EventListener,org.jfree.chart.annotations.Annotation,org.jfree.chart.annotations.XYAnnotation,Sharable
- Direct Known Subclasses:
RangeFilter,TrackSegment,WayPoint
public abstract class ChartAnnotation
extends PropertiedThing
implements org.jfree.chart.annotations.XYAnnotation
Class ChartAnnotation is an abstract class for the annotations
on charts
- Version:
- $Revision: 1.20 $
- Author:
- IDV Development Team
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ColorSelected colorprotected AffineTransformThe transform from the last drawprotected intx location.protected inty location.Fields inherited from class ucar.unidata.collab.PropertiedThing
propertiesDialog -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidnew property change listenerprotected booleanApply the propertiesdoubledistance(int x, int y) Distance to the given point.static doubledistance(int x1, int y1, int x2, int y2) utility method to calculate distancevoiddoRemove()Annotation was removedformatValue(double v) tuilitygetColor()Get the Color property.getName()Get the Name property.Get the PlotWrapper property.protected voidgetPropertiesComponents(List comps, int tabIdx) Collect the components that go into the properties dialogbooleanGet the Selected property.Hook for tooltipabstract StringType of annotationintgetX()Get the x positionintgetY()Get the y positionbooleanisActive()Get the Active property.voidproperty change listenervoidsetActive(boolean value) Set the Active property.voidSet the Color property.protected voidCalled by base classes when drawn.voidSet the Name property.voidsetPlotWrapper(PlotWrapper value) Set the PlotWrapper property.voidsetPosition(int x, int y) Set the position to the given x/y screen coordinatevoidsetPosition(MouseEvent event) Set the position to the x/y of the eventvoidsetSelected(boolean value) Set the Selected property.protected booleanShould the color widget be shown in the properties dialogtoString()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, showSharableDialogMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jfree.chart.annotations.Annotation
addChangeListener, removeChangeListenerMethods inherited from interface org.jfree.chart.annotations.XYAnnotation
draw
-
Field Details
-
COLOR_SELECTED
Selected color -
x
protected int xx location. Though not all annotations have a single x/y -
y
protected int yy location. Though not all annotations have a single x/y -
transform
The transform from the last draw
-
-
Constructor Details
-
ChartAnnotation
public ChartAnnotation()Default ctor -
ChartAnnotation
Ctro- Parameters:
plotWrapper- The chart we are in
-
-
Method Details
-
formatValue
tuility- Parameters:
v- value- Returns:
- formatted value
-
getToolTipText
Hook for tooltip- Returns:
- Tooltip text for this annotation
-
setGraphicsState
Called by base classes when drawn. We set the transform here- Parameters:
g2- The graphics
-
distance
public double distance(int x, int y) Distance to the given point. This transforms our x/y to the display space.- Parameters:
x- Mouse xy- Mouse y- Returns:
- Distance to x/y
-
distance
public static double distance(int x1, int y1, int x2, int y2) utility method to calculate distance- Parameters:
x1- x1y1- y1x2- x2y2- y2- Returns:
- distance
-
getTypeName
Type of annotation- Returns:
- Type of annotation
-
applyProperties
protected boolean applyProperties()Apply the properties- Overrides:
applyPropertiesin classPropertiedThing- Returns:
- success
-
getPropertiesComponents
Collect the components that go into the properties dialog- Overrides:
getPropertiesComponentsin classPropertiedThing- Parameters:
comps- List of left/right componentstabIdx- Which tab
-
setPosition
public void setPosition(int x, int y) Set the position to the given x/y screen coordinate- Parameters:
x- xy- y
-
setPosition
Set the position to the x/y of the event- Parameters:
event- The event
-
doRemove
public void doRemove()Annotation was removed -
setSelected
public void setSelected(boolean value) Set the Selected property.- Parameters:
value- The new value for Selected
-
getSelected
public boolean getSelected()Get the Selected property.- Returns:
- The Selected
-
showColorInProperties
protected boolean showColorInProperties()Should the color widget be shown in the properties dialog- Returns:
- Show color widget
-
setColor
Set the Color property.- Parameters:
value- The new value for Color
-
getColor
Get the Color property.- Returns:
- The Color
-
setPlotWrapper
Set the PlotWrapper property.- Parameters:
value- The new value for PlotWrapper
-
getPlotWrapper
Get the PlotWrapper property.- Returns:
- The PlotWrapper
-
setName
Set the Name property.- Parameters:
value- The new value for Name
-
getName
Get the Name property.- Returns:
- The Name
-
getY
public int getY()Get the y position- Returns:
- y
-
getX
public int getX()Get the x position- Returns:
- x
-
setActive
public void setActive(boolean value) Set the Active property.- Parameters:
value- The new value for Active
-
isActive
public boolean isActive()Get the Active property.- Returns:
- The Active
-
toString
tostring -
addPropertyChangeListener
new property change listener- Overrides:
addPropertyChangeListenerin classPropertiedThing- Parameters:
listener- listener
-
removePropertyChangeListener
property change listener- Overrides:
removePropertyChangeListenerin classPropertiedThing- Parameters:
listener- listener
-