ucar.unidata.idv.control.chart
Class RangeFilter

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.RangeFilter
All Implemented Interfaces:
PropertyChangeListener, EventListener, org.jfree.chart.annotations.XYAnnotation, Sharable

public class RangeFilter
extends ChartAnnotation

Class RangeFilter is a greater than or less than value filter

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

Field Summary
static int ANNOTATION_WIDTH
          Arrow width
static int TYPE_GREATERTHAN
          Type
static int TYPE_LESSTHAN
          Type
 
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
RangeFilter()
          Default ctor
RangeFilter(double rangeValue, TimeSeriesChartWrapper timeseries)
          ctor
 
Method Summary
protected  boolean applyProperties()
          Apply the properties
 RangeFilter doMakeAttached(MouseEvent event)
          Make the attached, but opposite, range filter
 void doRemove()
          removed from the chart.
 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.
 RangeFilter getAttached()
          Get the Attached property.
protected  void getPropertiesComponents(List comps, int tabIdx)
          Create property left/right components
 double getRangeValue()
          Get the RangeValue property.
 String getToolTipText()
          Get the tool tip text
 int getType()
          Get the Type property.
 String getTypeName()
          Type of annotation
 void setAttached(RangeFilter value)
          Set the Attached property.
 void setPosition(int x, int y)
          Set the position to the given x/y screen coordinate
 void setPosition(MouseEvent event)
          Set the position from the mouse
 void setRangeValue(double value)
          Set the DomainValue property.
 void setType(int value)
          Set the Type property.
 boolean valueOk(double value)
          Does the value pass the filter
 
Methods inherited from class ucar.unidata.idv.control.chart.ChartAnnotation
addPropertyChangeListener, distance, distance, formatValue, getColor, getName, getPlotWrapper, getSelected, getX, getY, isActive, removePropertyChangeListener, setActive, setColor, setGraphicsState, setName, setPlotWrapper, setSelected, showColorInProperties, toString
 
Methods inherited from class ucar.unidata.collab.PropertiedThing
doApplyProperties, firePropertyChange, firePropertyChange, getPropertyListeners, getPropertyTabs, 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

TYPE_LESSTHAN

public static int TYPE_LESSTHAN
Type


TYPE_GREATERTHAN

public static int TYPE_GREATERTHAN
Type


ANNOTATION_WIDTH

public static final int ANNOTATION_WIDTH
Arrow width

See Also:
Constant Field Values
Constructor Detail

RangeFilter

public RangeFilter()
Default ctor


RangeFilter

public RangeFilter(double rangeValue,
                   TimeSeriesChartWrapper timeseries)
ctor

Parameters:
rangeValue - the value
timeseries - the chart I'm in
Method Detail

getToolTipText

public String getToolTipText()
Get the tool tip text

Overrides:
getToolTipText in class ChartAnnotation
Returns:
Tool tip text

doRemove

public void doRemove()
removed from the chart. Clear out the attached reference to me.

Overrides:
doRemove in class ChartAnnotation

getTypeName

public String getTypeName()
Type of annotation

Specified by:
getTypeName in class ChartAnnotation
Returns:
Type of annotation

valueOk

public boolean valueOk(double value)
Does the value pass the filter

Parameters:
value - The value
Returns:
Passes the filter

applyProperties

protected boolean applyProperties()
Apply the properties

Overrides:
applyProperties in class ChartAnnotation
Returns:
Success

getPropertiesComponents

protected void getPropertiesComponents(List comps,
                                       int tabIdx)
Create property left/right components

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

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

setPosition

public void setPosition(MouseEvent event)
Set the position from the mouse

Overrides:
setPosition in class ChartAnnotation
Parameters:
event - mouse event

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.

setRangeValue

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

Parameters:
value - The new value for RangeValue

getRangeValue

public double getRangeValue()
Get the RangeValue property.

Returns:
The RangeValue

setType

public void setType(int value)
Set the Type property.

Parameters:
value - The new value for Type

getType

public int getType()
Get the Type property.

Returns:
The Type

doMakeAttached

public RangeFilter doMakeAttached(MouseEvent event)
Make the attached, but opposite, range filter

Parameters:
event - The event
Returns:
The attached range filter positioned near me.

setAttached

public void setAttached(RangeFilter value)
Set the Attached property.

Parameters:
value - The new value for Attached

getAttached

public RangeFilter getAttached()
Get the Attached property.

Returns:
The Attached