Class TrackControl

All Implemented Interfaces:
ActionListener, ItemListener, PropertyChangeListener, EventListener, HyperlinkListener, Sharable, DataChangeListener, DisplayControl, Prototypable, ControlListener, DisplayListener
Direct Known Subclasses:
GridTrajectoryControl.MyTrackControl

public class TrackControl extends GridDisplayControl
A MetApps Display Control with Displayable and controls for displaying a track (balloon sounding or aircraft track)
Version:
$Revision: 1.69 $
Author:
Unidata Development Team
  • Field Details

    • layoutModelWidget

      protected LayoutModelWidget layoutModelWidget
      the widget for the layout model
    • indicator

      protected StationModelDisplayable indicator
      selector point
    • timesHolder

      protected DisplayableData timesHolder
      the displayable that holdss the times
    • TIMES_TO_USE

      protected static final String[] TIMES_TO_USE
      Time strings
  • Constructor Details

    • TrackControl

      public TrackControl()
      Create a new Track Control; set the attribute flags
  • Method Details

    • getViewMenuItems

      protected void getViewMenuItems(List items, boolean forMenuBar)
      Add in the flythrough menu
      Overrides:
      getViewMenuItems in class DisplayControlImpl
      Parameters:
      items - the menu items
      forMenuBar - true for the menu bar
    • showFlythrough

      public void showFlythrough() throws Exception
      Show the flythrough
      Throws:
      Exception - problem showing the flythrough
    • init

      public boolean init(DataChoice dataChoice) throws VisADException, RemoteException
      Call to help make this kind of Display Control; also calls code to made the Displayable (empty of data thus far). This method is called from inside DisplayControlImpl.init(several args).
      Overrides:
      init in class DisplayControlImpl
      Parameters:
      dataChoice - the DataChoice of the moment.
      Returns:
      true if successful
      Throws:
      RemoteException - Java RMI error
      VisADException - VisAD Error
    • updateIndicator

      protected void updateIndicator()
      Update the indicator with new shapes
    • getColorWidgetLabel

      public String getColorWidgetLabel()
      Return the label that is to be used for the color widget This allows derived classes to override this and provide their own name,
      Overrides:
      getColorWidgetLabel in class DisplayControlImpl
      Returns:
      Label used for the color widget
    • setDataInstance

      protected void setDataInstance(DataInstance dataInstance)
      Set the dataInstance and its paramName in the superclass member data. Set the dataInstance in this class member getGridDataInstance(). Get appropritate contour information for the data.
      Overrides:
      setDataInstance in class DisplayControlImpl
      Parameters:
      dataInstance - the data instance to use
    • getDisplayCenter

      public LatLonPoint getDisplayCenter() throws RemoteException, VisADException
      Get the display center
      Overrides:
      getDisplayCenter in class DisplayControlImpl
      Returns:
      the center point of the display
      Throws:
      RemoteException - Java RMI error
      VisADException - VisAD Error
    • timeChanged

      protected void timeChanged(Real time)
      Respond to a timeChange event
      Overrides:
      timeChanged in class DisplayControlImpl
      Parameters:
      time - new time
    • setData

      protected boolean setData(DataChoice choice) throws VisADException, RemoteException
      Set the data in this control
      Overrides:
      setData in class DisplayControlImpl
      Parameters:
      choice - data choice
      Returns:
      true if successful
      Throws:
      RemoteException - Java RMI error
      VisADException - VisAD Error
    • mergeGrid

      protected FieldImpl mergeGrid(FieldImpl fi) throws VisADException, RemoteException
      merge tracks into one
      Parameters:
      fi - input fieldimpl contains one or more tracks
      Returns:
      one track fieldimpl
      Throws:
      RemoteException - _more_
      VisADException - _more_
    • setTrackTimes

      protected void setTrackTimes() throws VisADException, RemoteException
      Set the times on the track
      Throws:
      RemoteException - Java RMI problem
      VisADException - VisAD problem
    • doMakeContents

      protected Container doMakeContents() throws VisADException, RemoteException
      Make the gui
      Overrides:
      doMakeContents in class DisplayControlImpl
      Returns:
      The gui
      Throws:
      RemoteException - On Badness
      VisADException - On Badness
    • timeDeclutterChanged

      protected void timeDeclutterChanged()
      Handle when the time declutering state has changed
    • getTimeDeclutterComps

      protected JComponent[] getTimeDeclutterComps()
      Make the gui panel for the time decluttering
      Returns:
      The time declutter panel
    • getControlWidgets

      public void getControlWidgets(List controlWidgets) throws VisADException, RemoteException
      Add control widgets specific to this control to the list
      Overrides:
      getControlWidgets in class DisplayControlImpl
      Parameters:
      controlWidgets - list of control widgets
      Throws:
      RemoteException - Java RMI error
      VisADException - VisAD Error
    • addTimeModeWidget

      protected void addTimeModeWidget(List controlWidgets)
      the control widgets to add to
      Overrides:
      addTimeModeWidget in class DisplayControlImpl
      Parameters:
      controlWidgets - the control widgets to add to
    • doMakeTimeOptionWidget

      protected Component doMakeTimeOptionWidget()
      Make the time option widget
      Returns:
      the time option widget
    • getTrjGridDataInstance

      protected FieldImpl getTrjGridDataInstance()
      _more_
      Returns:
      _more_
    • initAfterUnPersistence

      public void initAfterUnPersistence(ControlContext vc, Hashtable properties, List preSelectedDataChoices)
      Called by the IntegratedDataViewer to initialize after this control has been unpersisted
      Specified by:
      initAfterUnPersistence in interface DisplayControl
      Overrides:
      initAfterUnPersistence in class DisplayControlImpl
      Parameters:
      vc - The context in which this control exists
      properties - Properties that may hold things
      preSelectedDataChoices - set of preselected data choices
    • addDisplaySettings

      protected void addDisplaySettings(DisplaySettingsDialog dsd)
      Add display settings paricular to this control
      Overrides:
      addDisplaySettings in class DisplayControlImpl
      Parameters:
      dsd - the DisplaySettingsDialog
    • setDataTimeRange

      public void setDataTimeRange(DataTimeRange range)
      Set the DataTimeRange
      Overrides:
      setDataTimeRange in class DisplayControlImpl
      Parameters:
      range - the DataTimeRange
    • applyTimeRange

      public void applyTimeRange()
      Handle some sort of time change. Either the subsetting interval changes or there is a new timestep.
      Overrides:
      applyTimeRange in class DisplayControlImpl
    • getRequestProperties

      protected Hashtable getRequestProperties()
      Override the base class method that creates request properties and add in the appropriate 2d/3d request parameter.
      Overrides:
      getRequestProperties in class DisplayControlImpl
      Returns:
      table of properties
    • updateTimeSelectRange

      protected void updateTimeSelectRange()
      Update the select range for the widget with the data's range
    • haveMultipleFields

      protected boolean haveMultipleFields()
      Return whether the Data held by this display control contains multiple fields (e.g., for the isosurface colored by another parameter
      Overrides:
      haveMultipleFields in class GridDisplayControl
      Returns:
      true if there are multiple fields
    • getColorRangeIndex

      protected int getColorRangeIndex()
      Returns the index to use in the GridDataInstance array of ranges for color ranges. The default is 1 though if there is not more than one field in the range then we end up with the 0th value.
      Overrides:
      getColorRangeIndex in class GridDisplayControl
      Returns:
      0
    • receiveShareData

      public void receiveShareData(Sharable from, Object dataId, Object[] data)
      Method called by other classes that share the selector.
      Specified by:
      receiveShareData in interface Sharable
      Overrides:
      receiveShareData in class DisplayControlImpl
      Parameters:
      from - other class.
      dataId - type of sharing
      data - Array of data being shared. In this case, the first (and only?) object in the array is the level
    • setTrackWidth

      public void setTrackWidth(int width)
      Set the track width property. Used by persistence
      Parameters:
      width - width for track (pixels) deprecated use #setLineWidth(int)
    • setLineWidth

      public void setLineWidth(int width)
      Set the track width property. Used by persistence
      Overrides:
      setLineWidth in class DisplayControlImpl
      Parameters:
      width - width for track (pixels) deprecated use #setLineWidth(int)
    • getLineWidth

      public int getLineWidth()
      Get the line width property.
      Overrides:
      getLineWidth in class DisplayControlImpl
      Returns:
      The line width
    • getDataTimeSet

      protected Set getDataTimeSet() throws RemoteException, VisADException
      Collect the time animation set from the displayables. If none found then return null.
      Overrides:
      getDataTimeSet in class DisplayControlImpl
      Returns:
      Animation set
      Throws:
      RemoteException - On badness
      VisADException - On badness
    • getTrackWidth

      protected int getTrackWidth()
      Get the track width property. Used by persistence
      Returns:
      width
    • setTrackType

      public void setTrackType(String type)
      Set the track type for this control. Used by persistence
      Parameters:
      type - track type
    • getTrackType

      public String getTrackType()
      Get the track type for this control. Used by persistence
      Returns:
      the track type
    • setTimeSubsetMinutes

      public void setTimeSubsetMinutes(double value)
      Set the TimeSubsetMinutes property.
      Parameters:
      value - The new value for TimeSubsetMinutes deprecated
    • setTimeSubsetEnabled

      public void setTimeSubsetEnabled(boolean value)
      Set the TimeSubsetEnabled property. deprecated
      Parameters:
      value - The new value for TimeSubsetEnabled
    • setUseTrackTime

      public void setUseTrackTime(boolean value)
      Set the useTrackTime property.
      Parameters:
      value - The new value for useTrackTime deprecated
    • setUseTrackTimes

      public void setUseTrackTimes(boolean value)
      Set the useTrackTimes property.
      Parameters:
      value - The new value for useTrackTime deprecated
    • getUseTrackTimes

      public boolean getUseTrackTimes()
      Get the useTrackTime property.
      Returns:
      The new value for useTrackTime deprecated
    • setTimeDeclutterMinutes

      public void setTimeDeclutterMinutes(double value)
      Set the TimeDeclutterMinutes property.
      Parameters:
      value - The new value for TimeDeclutterMinutes
    • getTimeDeclutterMinutes

      public double getTimeDeclutterMinutes()
      Get the TimeDeclutterMinutes property.
      Returns:
      The TimeDeclutterMinutes
    • setTimeDeclutterEnabled

      public void setTimeDeclutterEnabled(boolean value)
      Set the TimeDeclutterEnabled property.
      Parameters:
      value - The new value for TimeDeclutterEnabled
    • getTimeDeclutterEnabled

      public boolean getTimeDeclutterEnabled()
      Get the TimeDeclutterEnabled property.
      Returns:
      The TimeDeclutterEnabled
    • setAskedUserToDeclutterTime

      public void setAskedUserToDeclutterTime(boolean value)
      Set the AskedUserToDeclutterTime property.
      Parameters:
      value - The new value for AskedUserToDeclutterTime
    • getAskedUserToDeclutterTime

      public boolean getAskedUserToDeclutterTime()
      Get the AskedUserToDeclutterTime property.
      Returns:
      The AskedUserToDeclutterTime
    • setMarkerText

      public void setMarkerText(String value)
      Set the MarkerText property.
      Parameters:
      value - The new value for MarkerText deprecated now use #setMarkerLayout(StationModel)
    • setMarkerSymbol

      public void setMarkerSymbol(String value)
      Set the MarkerSymbol property.
      Parameters:
      value - The new value for MarkerSymbol deprecated now use #setMarkerLayout(StationModel)
    • setMarkerLayout

      public void setMarkerLayout(StationModel model)
      Set the current station model view.
      Parameters:
      model - station model layout
    • getMarkerLayout

      public StationModel getMarkerLayout()
      Get the current layout model view.
      Returns:
      station model layout
    • getMarkerScale

      public float getMarkerScale()
      Get the scale the user can enter
      Returns:
      The scale
    • setMarkerScale

      public void setMarkerScale(float f)
      Set the scale the user can enter
      Parameters:
      f - The scale
    • editLayoutModel

      public void editLayoutModel()
      Popup the station model editor
    • setMarkerVisible

      public void setMarkerVisible(boolean value)
      Set the marker visible
      Parameters:
      value - true to be visible
    • getMarkerVisible

      public boolean getMarkerVisible()
      Get whether the marker is visible
      Returns:
      true if visible
    • setStationModelFromWidget

      public void setStationModelFromWidget(StationModel sm)
      set the station model
      Parameters:
      sm - the station model
    • makeLayoutModelWidget

      protected JPanel makeLayoutModelWidget()
      Make the gui widget for setting the layout model
      Returns:
      the widget