Class MultiDisplayHolder

All Implemented Interfaces:
ActionListener, ItemListener, PropertyChangeListener, EventListener, HyperlinkListener, Sharable, DataChangeListener, DisplayControl, Prototypable, ControlListener, DisplayListener

public class MultiDisplayHolder extends DisplayControlImpl
A DisplayControl for station models
Version:
$Revision: 1.19 $
Author:
MetApps Development Team
  • Constructor Details

    • MultiDisplayHolder

      public MultiDisplayHolder()
      Default ctor
  • Method Details

    • initDone

      public void initDone()
      Gets called when all initialization is complete
      Overrides:
      initDone in class DisplayControlImpl
    • init

      public boolean init(List choices) 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:
      choices - the DataChoice of the moment.
      Returns:
      true if successful
      Throws:
      VisADException - some problem creating a VisAD object
      RemoteException - some problem creating a remote VisAD object
    • initAfterUnPersistence

      public void initAfterUnPersistence(ControlContext vc, Hashtable properties)
      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
    • componentChanged

      public void componentChanged()
      Some component changed. Update the manage tree.
    • showDisplayTree

      public void showDisplayTree()
      Show the manage dialog
    • getDisplayTree

      protected DisplayTree getDisplayTree()
      Return the display tree
      Returns:
      the display tree
    • getLegendLabels

      public void getLegendLabels(List labels, int legendType)
      Get the extra label used for the legend.
      Overrides:
      getLegendLabels in class DisplayControlImpl
      Parameters:
      labels - labels to append to
      legendType - The type of legend, BOTTOM_LEGEND or SIDE_LEGEND
    • findFrameForGroup

      protected JInternalFrame findFrameForGroup(DisplayGroup displayGroup)
      Find the internal frame for the given group
      Parameters:
      displayGroup - The group
      Returns:
      The frame or null if none found
    • findIdxForGroup

      protected int findIdxForGroup(DisplayGroup displayGroup)
      Find the tab index for the group
      Parameters:
      displayGroup - The group
      Returns:
      The tab index or -1
    • formatValue

      public String formatValue(double v)
      A utility to format a value using the display conventions
      Parameters:
      v - The value
      Returns:
      The formatted value
    • newName

      public void newName(DisplayGroup displayGroup, String oldName)
      The group has a new name
      Parameters:
      displayGroup - group
      oldName - the old name
    • toggleUI

      public void toggleUI()
      Switch between tabbed pane and internal frame
    • getViewMenuItems

      protected void getViewMenuItems(List items, boolean forMenuBar)
      Add the relevant edit menu items into the list
      Overrides:
      getViewMenuItems in class DisplayControlImpl
      Parameters:
      items - List of menu items
      forMenuBar - Is this for the menu in the window's menu bar or for a popup menu in the legend
    • getEditMenuItems

      protected void getEditMenuItems(List items, boolean forMenuBar)
      Add the relevant edit menu items into the list
      Overrides:
      getEditMenuItems in class DisplayControlImpl
      Parameters:
      items - List of menu items
      forMenuBar - Is this for the menu in the window's menu bar or for a popup menu in the legend
    • createComponentIn

      public void createComponentIn(Object[] args)
      Utility to create a component. The args holds the component type and the display group
      Parameters:
      args - args
    • getLowerComponentName

      protected String getLowerComponentName()
      Get the component name.
      Returns:
      tab or frame
    • getUpperComponentName

      protected String getUpperComponentName()
      Get the component name.
      Returns:
      Tab or Frame
    • createComponentInNewTab

      public void createComponentInNewTab(String type)
      Create the component.
      Parameters:
      type - type of component
    • createDisplayGroup

      public void createDisplayGroup()
      Create the display group.
    • createComponentInCurrentTab

      public void createComponentInCurrentTab(String type)
      Create the component.
      Parameters:
      type - type of component
    • createComponent

      protected void createComponent(String type, DisplayGroup displayGroup)
      Create the component
      Parameters:
      type - type of component
      displayGroup - The display group
    • addFieldToChartWrapper

      public void addFieldToChartWrapper(ChartWrapper chartWrapper)
      Add field
      Parameters:
      chartWrapper - chart
    • getPrototypes

      public List getPrototypes()
      Instantiate the list of prototype charts
      Returns:
      List of ChartWrapper objects that serves as prototypes.
    • addControlsToMenu

      protected void addControlsToMenu(JMenu newMenu, DisplayGroup displayGroup)
      Add the display control entries to the menu
      Parameters:
      newMenu - Menu to add to
      displayGroup - The group to add the display control to
    • makeControlsMenu

      public void makeControlsMenu(JMenu controlsMenu, DisplayGroup displayGroup)
      Populate the menu
      Parameters:
      controlsMenu - menu to populate
      displayGroup - Group to add the new display to
    • makeLocationsMenu

      public void makeLocationsMenu(JMenu locationsMenu, DisplayGroup displayGroup)
      Make the menu for adding new location displays
      Parameters:
      locationsMenu - menu to add to
      displayGroup - group to add new display to
    • createIdvWindow

      protected IdvWindow createIdvWindow()
      Override base class method to create a new window. We make the new IdvWindow as a main window.
      Overrides:
      createIdvWindow in class DisplayControlImpl
      Returns:
      The new window
    • initWindow

      public void initWindow(IdvWindow window)
      Initialize the window. We add the status bar to it.
      Overrides:
      initWindow in class DisplayControlImpl
      Parameters:
      window - The window to init
    • handleWindowClosing

      protected void handleWindowClosing()
      Don't close the window
      Overrides:
      handleWindowClosing in class DisplayControlImpl
    • addStationDisplay

      public void addStationDisplay(NamedStationTable stationTable, ControlDescriptor cd, DisplayGroup displayGroup)
      Add the new station location display control
      Parameters:
      stationTable - The locations
      cd - The control descriptor
      displayGroup - The group to add the new display to
    • getFileMenuItems

      protected void getFileMenuItems(List items, boolean forMenuBar)
      Add the relevant file menu items into the list
      Overrides:
      getFileMenuItems in class DisplayControlImpl
      Parameters:
      items - List of menu items
      forMenuBar - Is this for the menu in the window's menu bar or for a popup menu in the legend
    • importDisplayControl

      public void importDisplayControl(DisplayControlImpl displayControl)
      Import the given display control into me
      Parameters:
      displayControl - The control to import
    • getCurrentDisplayGroup

      public DisplayGroup getCurrentDisplayGroup()
      Get te display group in the current tab
      Returns:
      chaart group in the current tab
    • showDisplayComponent

      public void showDisplayComponent(DisplayComponent displayComponent)
      Show the tab the group is in
      Parameters:
      displayComponent - The component to show
    • addGroupNewMenu

      public void addGroupNewMenu(DisplayGroup displayGroup, JMenu newMenu)
      Add the new menu items for the given group.
      Parameters:
      displayGroup - The group to add the display to
      newMenu - The menu
    • doMakeMenuBar

      protected JMenuBar doMakeMenuBar()
      Make the menu bar. Add in the system menu bar and make the DisplayControl menus as a sub-menu.
      Overrides:
      doMakeMenuBar in class DisplayControlImpl
      Returns:
      menu bar
    • createDisplayComponent

      public DisplayComponent createDisplayComponent(String addType, List dataChoices, DisplayGroup displayGroup)
      Create the display component
      Parameters:
      addType - The thing to add
      dataChoices - data
      displayGroup - group for display component
      Returns:
      new display component
    • addGroup

      public void addGroup(DisplayGroup displayGroup)
      Add the group
      Parameters:
      displayGroup - The display group
    • createDisplayGroup

      public DisplayGroup createDisplayGroup(String groupName)
      Find or creaate the group
      Parameters:
      groupName - group name
      Returns:
      group
    • getDisplayGroup

      public DisplayGroup getDisplayGroup(String groupName)
      Find the display group by name
      Parameters:
      groupName - name
      Returns:
      display group or null
    • shouldAddAnimationListener

      protected boolean shouldAddAnimationListener()
      A hook to allow derived classes to tell us to add this as an animation listener
      Overrides:
      shouldAddAnimationListener in class DisplayControlImpl
      Returns:
      Add as animation listener
    • timeChanged

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

      public void setTimeInMainDisplay(double timeValue)
      User clicked on a chart
      Parameters:
      timeValue - The time
    • doMakeContents

      protected Container doMakeContents() throws VisADException, RemoteException
      Make the UI contents for this control.
      Overrides:
      doMakeContents in class DisplayControlImpl
      Returns:
      UI container
      Throws:
      RemoteException - Java RMI error
      VisADException - VisAD Error
    • viewManagerDestroyed

      public void viewManagerDestroyed(ViewManager viewManager) throws VisADException, RemoteException
      Called when a ViewManager which holds the display is destoryed We don't remove ourselves here because this DisplayControl can stand alone.
      Specified by:
      viewManagerDestroyed in interface DisplayControl
      Overrides:
      viewManagerDestroyed in class DisplayControlImpl
      Parameters:
      viewManager - The view manager that was destroyed
      Throws:
      RemoteException - Java RMI error
      VisADException - VisAD error
    • doRemove

      public void doRemove() throws RemoteException, VisADException
      Remove the display control
      Specified by:
      doRemove in interface DisplayControl
      Overrides:
      doRemove in class DisplayControlImpl
      Throws:
      RemoteException - On badness
      VisADException - On badness
    • removeDisplayComponent

      public void removeDisplayComponent(DisplayComponent displayComponent)
      Remove the component.
      Parameters:
      displayComponent - The component
    • removeDisplayables

      public void removeDisplayables(List displayables)
      Remove the list of displayables
      Parameters:
      displayables - List of displayables to remove from the main display
    • removeDisplayGroup

      public void removeDisplayGroup(DisplayGroup displayGroup)
      Remove the display group
      Parameters:
      displayGroup - The display group
    • loadData

      protected void loadData()
      Load data into the Displayable. This is called from DisplayControlImpl.setData(DataChoice) and whenever the projection changes. Subclasses should override this to do whatever they need to. This implementation uses a PointDataInstance to manager the data.
      See Also:
    • setDisplayGroups

      public void setDisplayGroups(List value)
      Set the DisplayGroups property.
      Parameters:
      value - The new value for DisplayGroups
    • getDisplayGroups

      public List getDisplayGroups()
      Get the DisplayGroups property.
      Returns:
      The DisplayGroups
    • setTitle

      public void setTitle(String title)
      Set the title of the window if it has been created.
      Overrides:
      setTitle in class DisplayControlImpl
      Parameters:
      title - The title
    • setInitialComponentClass

      public void setInitialComponentClass(String value)
      Set the AddType property.
      Parameters:
      value - The new value for AddType
    • getInitialComponentClass

      public String getInitialComponentClass()
      Get the AddType property.
      Returns:
      The AddType
    • setUseDesktop

      public void setUseDesktop(boolean value)
      Set the UseDesktop property.
      Parameters:
      value - The new value for UseDesktop
    • getUseDesktop

      public boolean getUseDesktop()
      Get the UseDesktop property.
      Returns:
      The UseDesktop
    • shouldShowInDisplayList

      protected boolean shouldShowInDisplayList()
      Should this show up in the list of displays
      Returns:
      Should this be added to the menu list