Class TimeSeriesChartWrapper

All Implemented Interfaces:
KeyListener, PropertyChangeListener, EventListener, Sharable

public class TimeSeriesChartWrapper extends PlotWrapper
Provides a time series chart
Version:
$Revision: 1.51 $
Author:
IDV Development Team
  • Field Details

  • Constructor Details

    • TimeSeriesChartWrapper

      public TimeSeriesChartWrapper()
      Default ctor
    • TimeSeriesChartWrapper

      public TimeSeriesChartWrapper(String name, List dataChoices)
      Ctor
      Parameters:
      name - The name
      dataChoices - List of data choices
  • Method Details

    • getPlot

      public org.jfree.chart.plot.XYPlot getPlot()
      Get the plot we use
      Returns:
      The plot
    • getTypeName

      public String getTypeName()
      Return the human readable name of this chart
      Specified by:
      getTypeName in class ChartWrapper
      Returns:
      Chart type name
    • doMakeContents

      protected JComponent doMakeContents()
      Create the chart if needed
      Specified by:
      doMakeContents in class DisplayComponent
      Returns:
      The gui contents
    • getDisplayables

      public List getDisplayables()
      Get the list of displayables we use
      Overrides:
      getDisplayables in class DisplayComponent
      Returns:
      List of displayables
    • loadData

      public void loadData() throws VisADException, RemoteException
      Create the charts
      Overrides:
      loadData in class ChartWrapper
      Throws:
      RemoteException - On badness
      VisADException - On badness
    • loadDatax

      public void loadDatax() throws VisADException, RemoteException
      Create the charts
      Throws:
      RemoteException - On badness
      VisADException - On badness
    • toString

      public String toString()
      to string
      Overrides:
      toString in class DisplayComponent
      Returns:
      string
    • setSelectedAnnotation

      public void setSelectedAnnotation(ChartAnnotation annotation, List list, boolean dontClear)
      Set the given annotation as selected. The list is one of rangeFilters, wayPoints or segments.
      Parameters:
      annotation - The annotation
      list - List its in
      dontClear - Dont clear the others in the list
    • removeAnnotations

      public void removeAnnotations(List annotations)
      Remove all of the annotations in the list. The list is one of rangeFilters, wayPoints or segments.
      Parameters:
      annotations - The list of annotations
    • removeAnnotation

      public void removeAnnotation(ChartAnnotation annotation)
      Remove the annotation
      Parameters:
      annotation - The annotation
    • editAnnotation

      public void editAnnotation(ChartAnnotation annotation)
      Show the properties
      Parameters:
      annotation - The annotation
    • removeSelectedAnnotations

      public void removeSelectedAnnotations(List annotations)
      Remove the selected annotations in the list.
      Parameters:
      annotations - The list of annotations
    • chartPanelMousePressed

      public boolean chartPanelMousePressed(MouseEvent event)
      Callback method for receiving notification of a mouse click on a chart.
      Overrides:
      chartPanelMousePressed in class PlotWrapper
      Parameters:
      event - information about the event.
      Returns:
      Did we handle this event
    • chartPanelMouseClicked

      public boolean chartPanelMouseClicked(MouseEvent event)
      Callback method for receiving notification of a mouse click on a chart.
      Overrides:
      chartPanelMouseClicked in class PlotWrapper
      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

      public List getTimeRanges()
      Create a list of time ranges from the segments
      Overrides:
      getTimeRanges in class ChartWrapper
      Returns:
      List of ranges
    • setTimeFromAnimation

      public void setTimeFromAnimation(Real time)
      Animation in main display changed. Some charts show this
      Overrides:
      setTimeFromAnimation in class ChartWrapper
      Parameters:
      time - the animation time
    • setTime

      protected void setTime(double value, boolean andDriveAnimation)
      Set the time we're at
      Parameters:
      value - time
      andDriveAnimation - Set the time in the animation widget
    • propertyChange

      public void propertyChange(PropertyChangeEvent event)
      Handle the event
      Specified by:
      propertyChange in interface PropertyChangeListener
      Overrides:
      propertyChange in class ChartWrapper
      Parameters:
      event - the event
    • zoomTo

      public void zoomTo(TrackSegment segment)
      Zoom the domain axis
      Parameters:
      segment - The track segment
    • zoomTo

      public void zoomTo(RangeFilter rangeFilter)
      Zoom the range axis
      Parameters:
      rangeFilter - The range filter
    • centerOn

      public void centerOn(WayPoint wayPoint)
      Center the domain axis about
      Parameters:
      wayPoint - The way point
    • centerOn

      public void centerOn(RangeFilter rangeFilter)
      Center the range axis
      Parameters:
      rangeFilter - The range filter
    • chartPanelMouseReleased

      public boolean chartPanelMouseReleased(MouseEvent event)
      Handle event in chart
      Overrides:
      chartPanelMouseReleased in class PlotWrapper
      Parameters:
      event - The event
      Returns:
      Did we handle this event
    • getPropertiesComponents

      protected void getPropertiesComponents(List comps, int tabIdx)
      Add to the properties components
      Overrides:
      getPropertiesComponents in class PlotWrapper
      Parameters:
      comps - List of components
      tabIdx - Which tab in the properties dialog
    • applyProperties

      protected boolean applyProperties()
      Apply properties
      Overrides:
      applyProperties in class PlotWrapper
      Returns:
      Was successful
    • annotationChanged

      public void annotationChanged(ChartAnnotation chartAnnotation)
      The annotaiton has changed. If its a WayPoint then fire the timerange property change.
      Overrides:
      annotationChanged in class PlotWrapper
      Parameters:
      chartAnnotation - The annotation that changed
    • addSegment

      public void addSegment(WayPoint[] wps)
      Add a segment between the 2 waypoints
      Parameters:
      wps - 2 waypoints
    • okToDraw

      public boolean okToDraw(ChartAnnotation annotation)
      Is it ok to draw the annotation
      Overrides:
      okToDraw in class PlotWrapper
      Parameters:
      annotation - The annotation
      Returns:
      ok to draw
    • getSelected

      public List getSelected(List annotations)
      Get list of selected annotations
      Parameters:
      annotations - The list of annotations
      Returns:
      selected annotations in list
    • getPopupMenuItems

      protected List getPopupMenuItems(List items)
      Get the popup menu items
      Overrides:
      getPopupMenuItems in class PlotWrapper
      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 annotations
      x - The x position
      y - The y position
      andSetSelected - If true set the closest as selected
      addToSelected - 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:
      canDoDriveTime in class ChartWrapper
      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:
      canDoTimeSelect in class ChartWrapper
      Returns:
      Can this chart use time select
    • canDoJython

      protected boolean canDoJython()
      The timeseries can have jython applied to it
      Overrides:
      canDoJython in class ChartWrapper
      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:
      initializeJython in class ChartWrapper
      Parameters:
      interpreter - The interpreter to initialize
    • canDoColors

      protected boolean canDoColors()
      Can we do the data area colors in the properties dialog
      Overrides:
      canDoColors in class PlotWrapper
      Returns:
      can do colors
    • canDoTimeFilters

      protected boolean canDoTimeFilters()
      Can we add time subsetting to this chart
      Overrides:
      canDoTimeFilters in class ChartWrapper
      Returns:
      false
    • canDoWrapperColor

      public boolean canDoWrapperColor()
      Show colors in fields properties
      Overrides:
      canDoWrapperColor in class ChartWrapper
      Returns:
      can do colors
    • canDoWrapperSide

      public boolean canDoWrapperSide()
      SHow side menu in fields properties
      Overrides:
      canDoWrapperSide in class ChartWrapper
      Returns:
      can do sides
    • valuesOk

      public boolean valuesOk(int dataset, double domainValue, double rangeValue)
      Are the values ok to render
      Parameters:
      dataset - Which data set
      domainValue - The domain value
      rangeValue - The range value
      Returns:
      show values
    • getRangeValues

      public List getRangeValues(int dataset)
      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 dataset
      value - The range value
      Returns:
      show values
    • chartPanelMouseDragged

      public boolean chartPanelMouseDragged(MouseEvent event)
      Handle event in chart
      Overrides:
      chartPanelMouseDragged in class PlotWrapper
      Parameters:
      event - The event
      Returns:
      Did we handle this event
    • chartPanelGetToolTipText

      public String chartPanelGetToolTipText(MouseEvent event)
      Get the tool tip text
      Overrides:
      chartPanelGetToolTipText in class PlotWrapper
      Parameters:
      event - The event
      Returns:
      tool tip
    • rangeFiltersChanged

      public void rangeFiltersChanged()
      Range filters changed
    • doRemove

      public void doRemove()
      remove me
      Overrides:
      doRemove in class ChartWrapper
    • initDone

      public void initDone()
      Do final initialization
      Overrides:
      initDone in class ChartWrapper
    • setWayPoints

      public void setWayPoints(List value)
      Set the WayPoints property.
      Parameters:
      value - The new value for WayPoints
    • getWayPoints

      public List getWayPoints()
      Get the WayPoints property.
      Returns:
      The WayPoints
    • setSegments

      public void setSegments(List value)
      Set the Segments property.
      Parameters:
      value - The new value for Segments
    • getSegments

      public List getSegments()
      Get the Segments property.
      Returns:
      The Segments
    • setRangeFilters

      public void setRangeFilters(List value)
      Set the RangeFilters property.
      Parameters:
      value - The new value for RangeFilters
    • getRangeFilters

      public List getRangeFilters()
      Get the RangeFilters property.
      Returns:
      The RangeFilters
    • setTimeWayPoint

      public void setTimeWayPoint(WayPoint value)
      Set the TimeWayPoint property.
      Parameters:
      value - The new value for TimeWayPoint
    • getTimeWayPoint

      public WayPoint 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