Package ucar.unidata.idv.control.chart
Class TimeSeriesChartWrapper
java.lang.Object
ucar.unidata.collab.SharableImpl
ucar.unidata.collab.PropertiedThing
ucar.unidata.idv.control.multi.DisplayComponent
ucar.unidata.idv.control.chart.ChartWrapper
ucar.unidata.idv.control.chart.PlotWrapper
ucar.unidata.idv.control.chart.TimeSeriesChartWrapper
- All Implemented Interfaces:
KeyListener,PropertyChangeListener,EventListener,Sharable
Provides a time series chart
- Version:
- $Revision: 1.51 $
- Author:
- IDV Development Team
-
Nested Class Summary
Nested classes/interfaces inherited from class ucar.unidata.idv.control.chart.PlotWrapper
PlotWrapper.MyChartPanelNested classes/interfaces inherited from class ucar.unidata.idv.control.chart.ChartWrapper
ChartWrapper.FieldProperties -
Field Summary
FieldsFields inherited from class ucar.unidata.idv.control.chart.PlotWrapper
chart, chartPanel, EVENT_DONTPASSON, EVENT_PASSONFields inherited from class ucar.unidata.idv.control.chart.ChartWrapper
animationWidget, dataChoiceWrappers, PROP_SELECTEDTIME, timeFilterSource, timeSelectSourceFields inherited from class ucar.unidata.idv.control.multi.DisplayComponent
CMD_SAVEIMAGE, CMD_SAVEMOVIE, displayControl, displayLabel, hasBeenInitialized, isRemoved, PROP_REMOVEDFields inherited from class ucar.unidata.collab.PropertiedThing
propertiesDialog -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSegment(WayPoint[] wps) Add a segment between the 2 waypointsvoidannotationChanged(ChartAnnotation chartAnnotation) The annotaiton has changed.protected booleanApply propertiesprotected booleanCan we do the data area colors in the properties dialogprotected booleanWe can set the time in the main displayprotected booleanThe timeseries can have jython applied to itprotected booleanCan we add time subsetting to this chartprotected booleanCan this chart use time selects This is used to determine whether the checkbox should be shown in the menusbooleanShow colors in fields propertiesbooleanSHow side menu in fields propertiesvoidcenterOn(RangeFilter rangeFilter) Center the range axisvoidCenter the domain axis aboutGet the tool tip textbooleanchartPanelMouseClicked(MouseEvent event) Callback method for receiving notification of a mouse click on a chart.booleanchartPanelMouseDragged(MouseEvent event) Handle event in chartbooleanchartPanelMousePressed(MouseEvent event) Callback method for receiving notification of a mouse click on a chart.booleanHandle event in chartprotected JComponentCreate the chart if neededvoiddoRemove()remove mevoideditAnnotation(ChartAnnotation annotation) Show the propertiesfindClosestAnnotation(List list, int x, int y, boolean andSetSelected, boolean addToSelected) Find the closest annotationGet the list of displayables we usedoublegetDomainValue(int x) Get the domain value of the x positionorg.jfree.chart.plot.XYPlotgetPlot()Get the plot we useprotected ListgetPopupMenuItems(List items) Get the popup menu itemsprotected voidgetPropertiesComponents(List comps, int tabIdx) Add to the properties componentsGet the RangeFilters property.doublegetRangeValue(int y) Get the range value of ygetRangeValues(int dataset) Get the List of range values for the given datasetGet the Segments property.getSelected(List annotations) Get list of selected annotationsbooleanGet the ShowDots property.Create a list of time ranges from the segmentsGet the TimeWayPoint property.Return the human readable name of this chartGet the WayPoints property.voidinitDone()Do final initializationprotected voidinitializeJython(org.python.util.PythonInterpreter interpreter) Add the state of this chart to the interpretervoidloadData()Create the chartsvoidCreate the chartsbooleanokToDraw(ChartAnnotation annotation) Is it ok to draw the annotationvoidHandle the eventvoidRange filters changedbooleanrangeValueOk(int dataset, double value) Does the value apss the range filtersvoidremoveAnnotation(ChartAnnotation annotation) Remove the annotationvoidremoveAnnotations(List annotations) Remove all of the annotations in the list.voidremoveSelectedAnnotations(List annotations) Remove the selected annotations in the list.voidsetRangeFilters(List value) Set the RangeFilters property.voidsetSegments(List value) Set the Segments property.voidsetSelectedAnnotation(ChartAnnotation annotation, List list, boolean dontClear) Set the given annotation as selected.voidsetShowDots(boolean value) Set the ShowDots property.protected voidsetTime(double value, boolean andDriveAnimation) Set the time we're atvoidsetTimeFromAnimation(Real time) Animation in main display changed.voidsetTimeWayPoint(WayPoint value) Set the TimeWayPoint property.voidsetWayPoints(List value) Set the WayPoints property.toString()to stringbooleanvaluesOk(int dataset, double domainValue, double rangeValue) Are the values ok to rendervoidzoomTo(RangeFilter rangeFilter) Zoom the range axisvoidzoomTo(TrackSegment segment) Zoom the domain axisMethods inherited from class ucar.unidata.idv.control.chart.PlotWrapper
doMakeChartPanel, getAutoRange, getBackgroundColor, getChartPanel, getDataAreaColor, getDomainLineState, getPreferredChartSize, getPropertyTabs, getRangeLineState, initXYPlot, keyPressed, keyReleased, keyTyped, panPlot, panPlot, setAutoRange, setBackgroundColor, setDataAreaColor, setDomainLineState, setName, setRangeLineState, signalChartChangedMethods inherited from class ucar.unidata.idv.control.chart.ChartWrapper
addDataChoice, addDataChoices, addField, animationTimeChanged, applyJython, applyJython, canBeASourceForTimeSelectionEvents, canDoDataChoiceList, canDoMinMaxDate, canDoParameters, canDoRemoveParameters, canDoResolution, createDataChoiceWrapper, doApplyProperties, doMakeWrapperDisplayComponent, doMultipleAddFields, filterData, formatValue, getAnimationShareGroup, getCategories, getDataChoices, getDataChoiceWrappers, getDriveTime, getFieldSelectionLabels, getFlatField, getInterpreter, getJython, getMaxDate, getMinDate, getResolution, getShowTime, getTimeFilterRanges, getTimeFilterSource, getTimeSelectSource, getTimeValues, init, removeTimeFilterSource, removeTimeSelectSource, setAnimationShareGroup, setDataChoiceWrappers, setDriveTime, setJython, setMaxDate, setMinDate, setResolution, setShowTime, setTimeFilterSource, setTimeSelectSource, wrapDataChoicesMethods inherited from class ucar.unidata.idv.control.multi.DisplayComponent
addGroupMenuItems, doMakeDisplayLabel, doSaveImage, doSaveMovie, getContents, getDisplayControl, getDisplayGroup, getDisplayLabel, getIsRemoved, getLabelShown, getName, initAfterUnPersistence, removeDisplayComponent, setDisplayControl, setDisplayGroup, setIsRemoved, setLabelShown, showPopup, showPropertiesMethods inherited from class ucar.unidata.collab.PropertiedThing
addPropertyChangeListener, firePropertyChange, firePropertyChange, getPropertyListeners, isShowing, removePropertyChangeListener, 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
-
Field Details
-
PROP_TIMERANGE
Property change id- See Also:
-
-
Constructor Details
-
TimeSeriesChartWrapper
public TimeSeriesChartWrapper()Default ctor -
TimeSeriesChartWrapper
Ctor- Parameters:
name- The namedataChoices- List of data choices
-
-
Method Details
-
getPlot
public org.jfree.chart.plot.XYPlot getPlot()Get the plot we use- Returns:
- The plot
-
getTypeName
Return the human readable name of this chart- Specified by:
getTypeNamein classChartWrapper- Returns:
- Chart type name
-
doMakeContents
Create the chart if needed- Specified by:
doMakeContentsin classDisplayComponent- Returns:
- The gui contents
-
getDisplayables
Get the list of displayables we use- Overrides:
getDisplayablesin classDisplayComponent- Returns:
- List of displayables
-
loadData
Create the charts- Overrides:
loadDatain classChartWrapper- Throws:
RemoteException- On badnessVisADException- On badness
-
loadDatax
Create the charts- Throws:
RemoteException- On badnessVisADException- On badness
-
toString
to string- Overrides:
toStringin classDisplayComponent- Returns:
- string
-
setSelectedAnnotation
Set the given annotation as selected. The list is one of rangeFilters, wayPoints or segments.- Parameters:
annotation- The annotationlist- List its indontClear- Dont clear the others in the list
-
removeAnnotations
Remove all of the annotations in the list. The list is one of rangeFilters, wayPoints or segments.- Parameters:
annotations- The list of annotations
-
removeAnnotation
Remove the annotation- Parameters:
annotation- The annotation
-
editAnnotation
Show the properties- Parameters:
annotation- The annotation
-
removeSelectedAnnotations
Remove the selected annotations in the list.- Parameters:
annotations- The list of annotations
-
chartPanelMousePressed
Callback method for receiving notification of a mouse click on a chart.- Overrides:
chartPanelMousePressedin classPlotWrapper- Parameters:
event- information about the event.- Returns:
- Did we handle this event
-
chartPanelMouseClicked
Callback method for receiving notification of a mouse click on a chart.- Overrides:
chartPanelMouseClickedin classPlotWrapper- Parameters:
event- information about the event.- Returns:
- Did we handle this event
-
getDomainValue
public double getDomainValue(int x) Get the domain value of the x position- Parameters:
x- The x position- Returns:
- Domain value
-
getRangeValue
public double getRangeValue(int y) Get the range value of y- Parameters:
y- The y position- Returns:
- Range value
-
getTimeRanges
Create a list of time ranges from the segments- Overrides:
getTimeRangesin classChartWrapper- Returns:
- List of ranges
-
setTimeFromAnimation
Animation in main display changed. Some charts show this- Overrides:
setTimeFromAnimationin classChartWrapper- Parameters:
time- the animation time
-
setTime
protected void setTime(double value, boolean andDriveAnimation) Set the time we're at- Parameters:
value- timeandDriveAnimation- Set the time in the animation widget
-
propertyChange
Handle the event- Specified by:
propertyChangein interfacePropertyChangeListener- Overrides:
propertyChangein classChartWrapper- Parameters:
event- the event
-
zoomTo
Zoom the domain axis- Parameters:
segment- The track segment
-
zoomTo
Zoom the range axis- Parameters:
rangeFilter- The range filter
-
centerOn
Center the domain axis about- Parameters:
wayPoint- The way point
-
centerOn
Center the range axis- Parameters:
rangeFilter- The range filter
-
chartPanelMouseReleased
Handle event in chart- Overrides:
chartPanelMouseReleasedin classPlotWrapper- Parameters:
event- The event- Returns:
- Did we handle this event
-
getPropertiesComponents
Add to the properties components- Overrides:
getPropertiesComponentsin classPlotWrapper- Parameters:
comps- List of componentstabIdx- Which tab in the properties dialog
-
applyProperties
protected boolean applyProperties()Apply properties- Overrides:
applyPropertiesin classPlotWrapper- Returns:
- Was successful
-
annotationChanged
The annotaiton has changed. If its a WayPoint then fire the timerange property change.- Overrides:
annotationChangedin classPlotWrapper- Parameters:
chartAnnotation- The annotation that changed
-
addSegment
Add a segment between the 2 waypoints- Parameters:
wps- 2 waypoints
-
okToDraw
Is it ok to draw the annotation- Overrides:
okToDrawin classPlotWrapper- Parameters:
annotation- The annotation- Returns:
- ok to draw
-
getSelected
Get list of selected annotations- Parameters:
annotations- The list of annotations- Returns:
- selected annotations in list
-
getPopupMenuItems
Get the popup menu items- Overrides:
getPopupMenuItemsin classPlotWrapper- Parameters:
items- list to add to- Returns:
- the list with items from this
-
findClosestAnnotation
public ChartAnnotation findClosestAnnotation(List list, int x, int y, boolean andSetSelected, boolean addToSelected) Find the closest annotation- Parameters:
list- List of annotationsx- The x positiony- The y positionandSetSelected- If true set the closest as selectedaddToSelected- If true add to selected. Else remove selection set (if andSetSelected is true.- Returns:
- Closest annotation or null
-
canDoDriveTime
protected boolean canDoDriveTime()We can set the time in the main display- Overrides:
canDoDriveTimein classChartWrapper- Returns:
- can set the time in the main display
-
canDoTimeSelect
protected boolean canDoTimeSelect()Can this chart use time selects This is used to determine whether the checkbox should be shown in the menus- Overrides:
canDoTimeSelectin classChartWrapper- Returns:
- Can this chart use time select
-
canDoJython
protected boolean canDoJython()The timeseries can have jython applied to it- Overrides:
canDoJythonin classChartWrapper- Returns:
- Can this chart have jython applied to it
-
initializeJython
protected void initializeJython(org.python.util.PythonInterpreter interpreter) Add the state of this chart to the interpreter- Overrides:
initializeJythonin classChartWrapper- Parameters:
interpreter- The interpreter to initialize
-
canDoColors
protected boolean canDoColors()Can we do the data area colors in the properties dialog- Overrides:
canDoColorsin classPlotWrapper- Returns:
- can do colors
-
canDoTimeFilters
protected boolean canDoTimeFilters()Can we add time subsetting to this chart- Overrides:
canDoTimeFiltersin classChartWrapper- Returns:
- false
-
canDoWrapperColor
public boolean canDoWrapperColor()Show colors in fields properties- Overrides:
canDoWrapperColorin classChartWrapper- Returns:
- can do colors
-
canDoWrapperSide
public boolean canDoWrapperSide()SHow side menu in fields properties- Overrides:
canDoWrapperSidein classChartWrapper- Returns:
- can do sides
-
valuesOk
public boolean valuesOk(int dataset, double domainValue, double rangeValue) Are the values ok to render- Parameters:
dataset- Which data setdomainValue- The domain valuerangeValue- The range value- Returns:
- show values
-
getRangeValues
Get the List of range values for the given dataset- Parameters:
dataset- The data set- Returns:
- List of range values
-
rangeValueOk
public boolean rangeValueOk(int dataset, double value) Does the value apss the range filters- Parameters:
dataset- Which datasetvalue- The range value- Returns:
- show values
-
chartPanelMouseDragged
Handle event in chart- Overrides:
chartPanelMouseDraggedin classPlotWrapper- Parameters:
event- The event- Returns:
- Did we handle this event
-
chartPanelGetToolTipText
Get the tool tip text- Overrides:
chartPanelGetToolTipTextin classPlotWrapper- Parameters:
event- The event- Returns:
- tool tip
-
rangeFiltersChanged
public void rangeFiltersChanged()Range filters changed -
doRemove
public void doRemove()remove me- Overrides:
doRemovein classChartWrapper
-
initDone
public void initDone()Do final initialization- Overrides:
initDonein classChartWrapper
-
setWayPoints
Set the WayPoints property.- Parameters:
value- The new value for WayPoints
-
getWayPoints
Get the WayPoints property.- Returns:
- The WayPoints
-
setSegments
Set the Segments property.- Parameters:
value- The new value for Segments
-
getSegments
Get the Segments property.- Returns:
- The Segments
-
setRangeFilters
Set the RangeFilters property.- Parameters:
value- The new value for RangeFilters
-
getRangeFilters
Get the RangeFilters property.- Returns:
- The RangeFilters
-
setTimeWayPoint
Set the TimeWayPoint property.- Parameters:
value- The new value for TimeWayPoint
-
getTimeWayPoint
Get the TimeWayPoint property.- Returns:
- The TimeWayPoint
-
setShowDots
public void setShowDots(boolean value) Set the ShowDots property.- Parameters:
value- The new value for ShowDots
-
getShowDots
public boolean getShowDots()Get the ShowDots property.- Returns:
- The ShowDots
-