ucar.unidata.idv.control.chart
Class WayPoint

java.lang.Object
  extended by ucar.unidata.collab.SharableImpl
      extended by ucar.unidata.collab.PropertiedThing
          extended by ucar.unidata.idv.control.chart.ChartAnnotation
              extended by ucar.unidata.idv.control.chart.WayPoint
All Implemented Interfaces:
PropertyChangeListener, EventListener, org.jfree.chart.annotations.XYAnnotation, Sharable

public class WayPoint
extends ChartAnnotation

Class WayPoint is used in the time series chart to show a way point along the time domain

Version:
$Revision: 1.22 $
Author:
IDV Development Team

Field Summary
static int ANNOTATION_WIDTH
          Arrow width
static String PROP_WAYPOINTVALUE
          Used for property changed when waypoint is moved
 
Fields inherited from class ucar.unidata.idv.control.chart.ChartAnnotation
COLOR_SELECTED, transform, x, y
 
Fields inherited from class ucar.unidata.collab.PropertiedThing
propertiesDialog
 
Constructor Summary
WayPoint()
          Default ctor
WayPoint(double domainValue, TimeSeriesChartWrapper timeseries)
          Ctor
 
Method Summary
protected  boolean applyProperties()
          Apply properties
 boolean canPlaySound()
          Can the waypoint play sound
 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 annotation.
 Color getColorToUse()
          What color should we use.
 double getDomainValue()
          Get the DomainValue property.
 boolean getIsForAnimation()
          Get the IsForAnimation property.
 MidiManager getMidiManager()
          Create, if needed, and return the midimanager that plays sounds
 MidiProperties getMidiProperties()
          Get the MidiProperties property.
 double getMinutesSpan()
          Get the MinutesSpan property.
protected  void getPropertiesComponents(List comps, int tabIdx)
          Add to properties gui
 String[] getPropertyTabs()
          return the array of tab names for the proeprties dialog
 String getToolTipText()
          Get the tool tip text
 String getTypeName()
          Type of annotation
protected  int getXFromValue(Rectangle2D dataArea, org.jfree.chart.axis.ValueAxis domainAxis)
          Get the x position from the domain value
 void setDomainValue(double value)
          Set the DomainValue property.
 void setIsForAnimation(boolean value)
          Set the IsForAnimation property.
 void setMidiProperties(MidiProperties value)
          Set the MidiProperties property.
 void setMinutesSpan(double value)
          Set the MinutesSpan property.
 void setPosition(int x, int y)
          Set the position to the given x/y screen coordinate
protected  boolean showColorInProperties()
          Should the color swatch be shown in the properties dialog
 
Methods inherited from class ucar.unidata.idv.control.chart.ChartAnnotation
addPropertyChangeListener, distance, distance, doRemove, formatValue, getColor, getName, getPlotWrapper, getSelected, getX, getY, isActive, removePropertyChangeListener, setActive, setColor, setGraphicsState, setName, setPlotWrapper, setPosition, setSelected, toString
 
Methods inherited from class ucar.unidata.collab.PropertiedThing
doApplyProperties, firePropertyChange, firePropertyChange, getPropertyListeners, isShowing, propertyChange, showProperties, showProperties
 
Methods 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROP_WAYPOINTVALUE

public static final String PROP_WAYPOINTVALUE
Used for property changed when waypoint is moved

See Also:
Constant Field Values

ANNOTATION_WIDTH

public static final int ANNOTATION_WIDTH
Arrow width

See Also:
Constant Field Values
Constructor Detail

WayPoint

public WayPoint()
Default ctor


WayPoint

public WayPoint(double domainValue,
                TimeSeriesChartWrapper timeseries)
Ctor

Parameters:
domainValue - The domain value
timeseries - The chart I'm in
Method Detail

getMidiManager

public MidiManager getMidiManager()
Create, if needed, and return the midimanager that plays sounds

Returns:
The midi manager

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

getColorToUse

public Color getColorToUse()
What color should we use. If selected use the selected color

Returns:
The color

showColorInProperties

protected boolean showColorInProperties()
Should the color swatch be shown in the properties dialog

Overrides:
showColorInProperties in class ChartAnnotation
Returns:
Show color in properties

getPropertyTabs

public String[] getPropertyTabs()
return the array of tab names for the proeprties dialog

Overrides:
getPropertyTabs in class PropertiedThing
Returns:
array of tab names

getPropertiesComponents

protected void getPropertiesComponents(List comps,
                                       int tabIdx)
Add to properties gui

Overrides:
getPropertiesComponents in class ChartAnnotation
Parameters:
comps - List of comps
tabIdx - Which tab in the properties dialog

canPlaySound

public boolean canPlaySound()
Can the waypoint play sound

Returns:
Can this waypoint play sound

applyProperties

protected boolean applyProperties()
Apply properties

Overrides:
applyProperties in class ChartAnnotation
Returns:
success

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 annotation.

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.

getXFromValue

protected int getXFromValue(Rectangle2D dataArea,
                            org.jfree.chart.axis.ValueAxis domainAxis)
Get the x position from the domain value

Parameters:
dataArea - data area
domainAxis - domain axis
Returns:
The x value

setDomainValue

public void setDomainValue(double value)
Set the DomainValue property.

Parameters:
value - The new value for DomainValue

getDomainValue

public double getDomainValue()
Get the DomainValue property.

Returns:
The DomainValue

setIsForAnimation

public void setIsForAnimation(boolean value)
Set the IsForAnimation property.

Parameters:
value - The new value for IsForAnimation

getIsForAnimation

public boolean getIsForAnimation()
Get the IsForAnimation property.

Returns:
The IsForAnimation

setMinutesSpan

public void setMinutesSpan(double value)
Set the MinutesSpan property.

Parameters:
value - The new value for MinutesSpan

getMinutesSpan

public double getMinutesSpan()
Get the MinutesSpan property.

Returns:
The MinutesSpan

setMidiProperties

public void setMidiProperties(MidiProperties value)
Set the MidiProperties property.

Parameters:
value - The new value for MidiProperties

getMidiProperties

public MidiProperties getMidiProperties()
Get the MidiProperties property.

Returns:
The MidiProperties