Class IdvUIManager

All Implemented Interfaces:
ActionListener, EventListener, IdvConstants

public class IdvUIManager extends IdvManager
Manages the user interface for the IDV
Author:
IDV development team
  • Field Details

    • FIELDTYPE_TEXT

      public static final String FIELDTYPE_TEXT
      type names for user data choices gui creation
      See Also:
    • FIELDTYPE_BOOLEAN

      public static final String FIELDTYPE_BOOLEAN
      type names for user data choices gui creation
      See Also:
    • FIELDTYPE_CHOICE

      public static final String FIELDTYPE_CHOICE
      type names for user data choices gui creation
      See Also:
    • FIELDTYPE_FILE

      public static final String FIELDTYPE_FILE
      type names for user data choices gui creation
      See Also:
    • FIELDTYPE_LOCATION

      public static final String FIELDTYPE_LOCATION
      type names for user data choices gui creation
      See Also:
    • FIELDTYPE_AREA

      public static final String FIELDTYPE_AREA
      type names for user data choices gui creation
      See Also:
    • ICON_LOCK

      public static ImageIcon ICON_LOCK
      The icon used to show locked legend components
    • ICON_UNLOCK

      public static ImageIcon ICON_UNLOCK
      The icon used to show unlocked legend components
    • ICON_REMOVE

      public static ImageIcon ICON_REMOVE
      Icon used to remove displays
    • PROP_SUPPORT_PACKAGE

      public static final String PROP_SUPPORT_PACKAGE
      property for support form
      See Also:
    • PROP_SUPPORT_MESSAGE

      public static final String PROP_SUPPORT_MESSAGE
      property for support form
      See Also:
    • PROP_HELP_EMAIL

      public static final String PROP_HELP_EMAIL
      property for support form
      See Also:
    • PROP_HELP_ORG

      public static final String PROP_HELP_ORG
      property for support form
      See Also:
    • PROP_HELP_NAME

      public static final String PROP_HELP_NAME
      property for support form
      See Also:
    • TAG_ACTION

      public static final String TAG_ACTION
      Xml tag for the actions resource
      See Also:
    • ATTR_ID

      public static final String ATTR_ID
      Xml attribute name for the in the actions resource
      See Also:
    • ATTR_MAINWINDOW

      public static final String ATTR_MAINWINDOW
      Xml attribute name for skin mainwindow attribute
      See Also:
    • ATTR_DESCRIPTION

      public static final String ATTR_DESCRIPTION
      Xml attribute name for the description in the actions resource
      See Also:
    • ATTR_GROUP

      public static final String ATTR_GROUP
      Xml attribute name for the group in the actions resource
      See Also:
    • ATTR_ACTION

      public static final String ATTR_ACTION
      Xml attribute name for the action in the actions resource
      See Also:
    • ATTR_IMAGE

      public static final String ATTR_IMAGE
      Xml attribute name for the image in the actions resource
      See Also:
    • COMP_FAVORITESBAR

      public static final String COMP_FAVORITESBAR
      The identifier of the toolbar component
      See Also:
    • COMP_HELP

      public static final String COMP_HELP
      Help tag for xmlui
      See Also:
    • COMP_MENUBAR

      public static final String COMP_MENUBAR
      The identifier of the menubar component
      See Also:
    • COMP_TOOLBAR

      public static final String COMP_TOOLBAR
      The identifier of the toolbar component
      See Also:
    • COMP_DATASELECTOR

      public static final String COMP_DATASELECTOR
      The identifier of the data selector component
      See Also:
    • COMP_COMPONENT_GROUP

      public static final String COMP_COMPONENT_GROUP
      The identifier of the group component
      See Also:
    • COMP_COMPONENT_CHOOSERS

      public static final String COMP_COMPONENT_CHOOSERS
      The identifier of the choosers component
      See Also:
    • COMP_COMPONENT_SKIN

      public static final String COMP_COMPONENT_SKIN
      The identifier for skins
      See Also:
    • COMP_COMPONENT_HTML

      public static final String COMP_COMPONENT_HTML
      The identifier for html
      See Also:
    • COMP_MEMORYMONITOR_VIEW

      public static final String COMP_MEMORYMONITOR_VIEW
      The identifier of the toolbar component on view window
      See Also:
    • COMP_MEMORYMONITOR_DASH

      public static final String COMP_MEMORYMONITOR_DASH
      The identifier of the toolbar component on dashboard
      See Also:
    • COMP_WAITLABEL

      public static final String COMP_WAITLABEL
      The identifier of the wait label
      See Also:
    • COMP_STREAMINGLABEL

      public static final String COMP_STREAMINGLABEL
      The identifier of the streaming indicator
      See Also:
    • COMP_READINGLABEL

      public static final String COMP_READINGLABEL
      The identifier of the wait label
      See Also:
    • COMP_PROGRESSBAR

      public static final String COMP_PROGRESSBAR
      The identifier of the progress bar
      See Also:
    • COMP_DATATREE

      public static final String COMP_DATATREE
      Xml tag name for datatree
      See Also:
    • COMP_VIEWPANEL

      public static final String COMP_VIEWPANEL
      Xml tag name for the panel that holds all of the views
      See Also:
    • COMP_MESSAGELOGGER

      public static final String COMP_MESSAGELOGGER
      Xml tag name for messagelogger
      See Also:
    • COMP_MESSAGELABEL

      public static final String COMP_MESSAGELABEL
      Xml tag name for messagelabel
      See Also:
    • COMP_MAPVIEW

      public static final String COMP_MAPVIEW
      Xml tag name for map view manager
      See Also:
    • COMP_GLOBEVIEW

      public static final String COMP_GLOBEVIEW
      Xml tag name for map view manager
      See Also:
    • COMP_TRANSECTVIEW

      public static final String COMP_TRANSECTVIEW
      Xml tag name for map view manager
      See Also:
    • COMP_VIEW

      public static final String COMP_VIEW
      Xml tag name for any view manager
      See Also:
    • COMP_STATUSBAR

      public static final String COMP_STATUSBAR
      Xml tag name for status label
      See Also:
    • COMP_CHOOSER

      public static final String COMP_CHOOSER
      Xml tag name for the chooser tag. We overwrite the XmlUi component factory method to handle these special tags
      See Also:
    • COMP_CHOOSERS

      public static final String COMP_CHOOSERS
      tag for xmlui to show choosers
      See Also:
    • lastActiveFrame

      protected IdvWindow lastActiveFrame
      Keep track of the last window that the user has moused in We do this so when we are adding a DisplayControl into one of the main windows we add it into the last active window.
    • PREF_LightWeightPopupEnabled

      public static final String PREF_LightWeightPopupEnabled
      light weight popup
      See Also:
    • timeSinceLastWait

      public static long timeSinceLastWait
      For timing debugs
    • startTime

      public static long startTime
      For timing debugs
  • Constructor Details

    • IdvUIManager

      public IdvUIManager(IntegratedDataViewer idv)
      Create me with the IDV
      Parameters:
      idv - The IDV
  • Method Details

    • loadLookAndFeel

      public void loadLookAndFeel()
      Load in the look and feel
    • init

      public void init()
      Called by the IDV when its initialization is done. This method closes the splash window and opens any windows that need to be open,
    • doMakeInitialGui

      public void doMakeInitialGui()
      Create the first display window
    • doMakeBasicWindows

      public void doMakeBasicWindows()
      Create the basic windows. This gets called at start up and if the user presses "show dashboard" and there isn't any windows available
    • findComponent

      public Object findComponent(String id)
      Find the component that is in an IdvWindow with the id
      Parameters:
      id - id
      Returns:
      component
    • getWindowGroup

      public List getWindowGroup(Object group)
      This gets all of the objects that are associated with the given group for all active windows. We use this for finding the active choosers.
      Parameters:
      group - The group id
      Returns:
      List of objects in the given group
    • getComponents

      public List getComponents()
      Get all components in all windows
      Returns:
      components
    • getScreen

      public GraphicsDevice getScreen(Point p)
      return the screen containing the point, null if none do
      Parameters:
      p - point in the display
      Returns:
      the GraphicsDevice for that point
    • closeCurrentWindow

      public void closeCurrentWindow()
      Close the currently active window.
    • getViewPanel

      public ViewPanel getViewPanel()
      get the view panel, the one that holds the displays. If it doesn't exist then create it
      Returns:
      ViewPanel
    • doMakeViewPanel

      protected ViewPanel doMakeViewPanel()
      Factory method for making the ViewPanel
      Returns:
      The view panel
    • handleSideLegend

      public boolean handleSideLegend(ViewManager viewManager, JComponent sideLegend)
      noop
      Parameters:
      viewManager - The view manager
      sideLegend - The side legend
      Returns:
      true if this UIManager will embed the legend. False if the ViewManager should deal with the legend as usual.
    • viewManagerAdded

      public void viewManagerAdded(ViewManager viewManager)
      Be notified of the addition of a VM
      Parameters:
      viewManager - The VM
    • viewManagerDestroyed

      public void viewManagerDestroyed(ViewManager viewManager)
      Called when the ViewManager is removed. If we are showing legends in a window then we remove the tab
      Parameters:
      viewManager - The ViewManager that was destroyed
    • viewManagerActiveChanged

      public void viewManagerActiveChanged(ViewManager viewManager)
      The active state of the view manager has changed
      Parameters:
      viewManager - The view manager
    • viewManagerChanged

      public void viewManagerChanged(ViewManager viewManager)
      Called when the ViewManager is changed. If we are showing legends in a window then we update the tab label
      Parameters:
      viewManager - The ViewManager that was changed
    • getViewManagerTabLabel

      protected String getViewManagerTabLabel(ViewManager viewManager, JTabbedPane tabs)
      Create the tab label for the embedded legend tabs
      Parameters:
      viewManager - View manager in the tab
      tabs - The tabs
      Returns:
      Label to use
    • initDone

      public void initDone()
      Called by the IDV when its initialization is done. This method closes the splash window and opens any windows that need to be open,
    • makeActionMenu

      public List makeActionMenu(Object object, String method, boolean makeCall)
      Make the menu of actions
      Parameters:
      object - object to call
      method - method to call
      makeCall - If true we call idv.handleAction
      Returns:
      List of menus
    • isAction

      public boolean isAction(String id)
      Is the given id an action. Does it start with action:
      Parameters:
      id - The id
      Returns:
      Is it an action
    • stripAction

      public String stripAction(String id)
      Strip any "action:invalid input: '&' string from the beginning.
      Parameters:
      id - The action id
      Returns:
      The id stripped of any action:
    • getActionNode

      public Element getActionNode(String id)
      Find the xml element for the given action
      Parameters:
      id - The action id. May start with "action:"
      Returns:
      The xml element that describes the action
    • getActionAttr

      public String getActionAttr(String id, String attr)
      Get the given named attribute from the xml element that represents the action id
      Parameters:
      id - The action
      attr - The attr name
      Returns:
      The attr value or null if none found
    • getAction

      public String getAction(String id)
      Get the action action for the given action id
      Parameters:
      id - The action id
      Returns:
      The aciton to invoke_
    • getActionImage

      public String getActionImage(String id)
      Get the image for the given action
      Parameters:
      id - The action id
      Returns:
      The image
    • getActionDescription

      public String getActionDescription(String id)
      Get the description for the given action
      Parameters:
      id - The action id
      Returns:
      The description
    • getActions

      public List getActions()
      Get the list of (String) action ids.
      Returns:
      List of actions
    • showWindow

      public void showWindow(DisplayControl control, IdvWindow window)
      Implementation of the ControlContext method. If the idv has been initialized then this simply shows the window. If not yet fully initialized then we place this window in a list of windows to be displayed after initialization is done.
      Parameters:
      control - The new DisplayControl
      window - Its window
    • isMac

      public boolean isMac()
      Is this running on a Mac?
      Returns:
      true if running on Mac
    • initSplash

      public void initSplash()
      Create the splash screen if needed
    • getWaitCursorCount

      public int getWaitCursorCount()
      Return the number of open wait cursor calls
      Returns:
      number of wait cursor calls pending
    • showWaitCursor

      public void showWaitCursor()
      Increment the waitCursorCount and set the wait cursor on the last active frame
      Overrides:
      showWaitCursor in class IdvManager
    • showNormalCursor

      public void showNormalCursor()
      Helper method to show the "normal" cursor. Actually will decrement the waitCursorCount and only show the normal cursor when waitCursorCount invalid input: '<'= 0. This enables a bunch of code to show the wait cursor and keep showing it until all is done.
      Overrides:
      showNormalCursor in class IdvManager
    • clearWaitCursor

      public void clearWaitCursor()
      Helper method to clear any outstanding wait cursor calls.
    • startReading

      public void startReading(Object source)
      Start reading
      Parameters:
      source - the object to read
    • stopReading

      public void stopReading(Object source)
      Stop reading
      Parameters:
      source - the object to stop reading
    • showAllWindows

      public void showAllWindows()
      Run through all windows and call show
    • toFrontMainWindows

      public void toFrontMainWindows()
      Run through all windows and call show
    • resetLastActiveViewManager

      public void resetLastActiveViewManager()
      Update the last active view manager.
    • handleWindowActivated

      public void handleWindowActivated(IdvWindow window)
      Handle when the window is activated. Set the last active view manager
      Parameters:
      window - The window
    • removeWindow

      public void removeWindow(IdvWindow window)
      Remove the window from the list of windows
      Parameters:
      window - The window to remove
    • updateHistoryLinks

      public void updateHistoryLinks()
      Update history links
    • addDCD

      public DataControlDialog addDCD(DataControlDialog dcd)
      Adds the given DataControlDialog to the dcdWindows list. We keep this list around so we can set the cursor on a showWaitCursor call.
      Parameters:
      dcd - The dialog
      Returns:
      The dcd argument
    • removeDCD

      public void removeDCD(DataControlDialog dcd)
      Removes the given DataControlDialog from the dcdWindows list. We keep this list around so we can set the cursor on a showWaitCursor call.
      Parameters:
      dcd - The dialog
    • processDialog

      public void processDialog(DataControlDialog dcd)
      Handle (polymorphically) the DataControlDialog. This dialog is used to either select a display control to create or is used to set the timers used for a DataSource.
      Parameters:
      dcd - The dialog
    • handleMenuSelected

      protected void handleMenuSelected(String id, JMenu menu, IdvWindow idvWindow)
      Initialize the given menu before it is shown
      Parameters:
      id - Id of the menu
      menu - The menu
      idvWindow - the IDV window
    • handleMenuDeSelected

      protected void handleMenuDeSelected(String id, JMenu menu, IdvWindow idvWindow)
      DeInitialize the given menu before it is shown
      Parameters:
      id - Id of the menu
      menu - The menu
      idvWindow - the IDV window
    • getMenuIds

      public Hashtable getMenuIds()
      Get the map of menu ids
      Returns:
      menus
    • doMakeMenuBar

      public JMenuBar doMakeMenuBar()
      Make the menu bar and menus for the given IdvWindow. Use the set of xml menu files defined by the menubarResources member
      Returns:
      The menu bar we just created
    • doMakeMenuBar

      public JMenuBar doMakeMenuBar(IdvWindow idvWindow)
      Make the menu bar and menus for the given IdvWindow. Use the set of xml menu files defined by the menubarResources member
      Parameters:
      idvWindow - the IDV window
      Returns:
      The menu bar we just created
    • getComponentGroupMenuItems

      public void getComponentGroupMenuItems(IdvComponentGroup group, List items)
      Get component group items
      Parameters:
      group - the group
      items - list of items
    • makeSkinMenuItems

      public List makeSkinMenuItems(ActionListener listener, boolean onlyUI, boolean onlyEmbedded)
      Make the skin menu items
      Parameters:
      listener - the listener for the menu
      onlyUI - true if only in the UI
      onlyEmbedded - true if only for embedded
      Returns:
      the list of menus
    • getSkinHtml

      public String getSkinHtml()
      Get the skin's HTML
      Returns:
      the skin's name
    • loadSkinByIndex

      public void loadSkinByIndex(int skinIndex)
      Load the skin by index
      Parameters:
      skinIndex - index for the skin
    • makeWindowsMenu

      public void makeWindowsMenu(JMenu menu, IdvWindow idvWindow)
      Make the windows menu. This lists all of the current windows and allows the user to show them.
      Parameters:
      menu - windows menu
      idvWindow - the IDV window
    • makeWindowMenu

      protected void makeWindowMenu(IdvWindow window, JMenu menu)
      Make the window menu
      Parameters:
      window - the window
      menu - the menu
    • makeViewStateMenu

      public void makeViewStateMenu(JMenu menu)
      This adds to the given menu a set of MenuItems, one for each saved viewmanager in the vmState list.
      Parameters:
      menu - The menu
    • makeViewStateMenu

      public void makeViewStateMenu(JMenu menu, ViewManager vm)
      This adds to the given menu a set of MenuItems, one for each saved viewmanager in the vmState list. If the ViewManager parameter vm is non-null then the result of the selection will be to apply the selected ViewManager state to the given vm. Else a new window will be created with a new ViewManager.
      Parameters:
      menu - The menu
      vm - The view manager
    • makeDeleteViewsMenu

      public void makeDeleteViewsMenu(JMenu menu)
      This adds to the given menu a set of MenuItems, one for each saved ViewManager, for deleting the selected saved ViewManager.
      Parameters:
      menu - The menu
    • editDisplaySettings

      public void editDisplaySettings()
      Show the modal display settings dialog
    • editFormulasMenuSelected

      public void editFormulasMenuSelected(JMenu menu)
      Add in the dynamic menu for editing formulas
      Parameters:
      menu - edit menu to add to
    • historyMenuSelected

      public void historyMenuSelected(JMenu fileMenu)
      User just clicked on the file-history menu. Add in the items
      Parameters:
      fileMenu - The menu to fill
    • historyMenuSelectedV

      public void historyMenuSelectedV(JMenu fileMenu, String type)
      User just clicked on the file-history menu. Add in the items
      Parameters:
      fileMenu - The menu to fill
    • deleteHistoryMenuSelected

      public void deleteHistoryMenuSelected(JMenu fileMenu)
      Fill in the delete history menu
      Parameters:
      fileMenu - the menu to fill
    • addChoicesToMenu

      public void addChoicesToMenu(DataSource dataSource, JMenu dataSourceMenu, JMenu dataMenu)
      Add the menu items for dealing with the DataChoices from the given dataSource into the given menu.
      Parameters:
      dataSource - The data source
      dataSourceMenu - Its menu
      dataMenu - The menu to hold the data choice items
    • createDataChoiceMenuItem

      public void createDataChoiceMenuItem(DataChoice choice, JMenu parentMenu, JMenu dataMenu)
      Create the menu items for dealing with the given data choice
      Parameters:
      choice - The data choice
      parentMenu - The parent menu
      dataMenu - Where to put the items
    • processBundle

      public void processBundle(SavedBundle bundle)
      Pass through to the idv to load in the given bundle
      Parameters:
      bundle - The bundle to create
    • processBundleMenu

      protected void processBundleMenu(JMenu displayMenu, int bundleType)
      Create the bundle menu for the given list of bundles
      Parameters:
      displayMenu - The menu to add the bundle menu into
      bundleType - Is this for the favorites or the display templates
    • processMapMenu

      protected void processMapMenu(JMenu displayMenu, boolean makeNew)
      Add the map menu into the display menu
      Parameters:
      displayMenu - The display menu
      makeNew - if true, make a new menu
    • processStationMenu

      protected void processStationMenu(JMenu displayMenu, boolean makeNew)
      Add the station menu into the display menu
      Parameters:
      displayMenu - The display menu
      makeNew - if true, make a new menu
    • getStandAloneControlDescriptors

      public List getStandAloneControlDescriptors()
      Add the stand alone displays into the display menu
      Returns:
      List of ControlDescriptor-s that can stand alone.
    • processStandAloneMenu

      protected void processStandAloneMenu(JMenu displayMenu, boolean makeNew)
      Add the stand alone displays into the display menu
      Parameters:
      displayMenu - The display menu
      makeNew - if true, make a new menu
    • processInstanceMenu

      protected void processInstanceMenu(JMenu displayMenu)
      Add the instances into the display menu
      Parameters:
      displayMenu - The display menu
    • initializeViewMenu

      protected void initializeViewMenu(JMenu viewMenu)
      Add in the menu items for the given view menu
      Parameters:
      viewMenu - The view menu
    • initializeDisplayMenu

      protected void initializeDisplayMenu(JMenu displayMenu)
      Add in the menu items for the given display menu
      Parameters:
      displayMenu - The display menu
    • initializeBundleMenu

      protected void initializeBundleMenu(JMenu bundleMenu)
      Add in the menu items for the given display menu
      Parameters:
      bundleMenu - The display menu
    • showBundleDialog

      public void showBundleDialog()
      Popup the favorites manage dialog
    • showBundleDialog

      public void showBundleDialog(int bundleType)
      Popup the dialog that edits the list of bundles
      Parameters:
      bundleType - What is the type of the bundle we are showing an edit dialog for
    • displayTemplatesChanged

      public void displayTemplatesChanged()
      Use this to notify when any of the display templates changed. This passes through the calls to the data source holders and recreates the display menus
    • favoriteBundlesChanged

      public void favoriteBundlesChanged()
      Use this to notify when any of the favorite bundles changed. This updates the toolbars and bundle trees
    • displayControlsChanged

      public void displayControlsChanged()
      Called by the IDV when there has been a change to the display controls.
    • displayControlChanged

      public void displayControlChanged(DisplayControl displayControl)
      The display changed
      Parameters:
      displayControl - display that changed
    • addStationDisplay

      public void addStationDisplay(NamedStationTable stationTable, ControlDescriptor cd)
      Create the station table display for the given station table
      Parameters:
      stationTable - The station table
      cd - The display control descriptor for the station location display
    • doMakeDataSourceMenuItems

      public List doMakeDataSourceMenuItems(DataSource dataSource, Component src)
      Return the list of menu items to use when the user has clicked on a DataSource.
      Parameters:
      dataSource - The data source
      src - Where this menu pops up
      Returns:
      List of menu items for dealing with the given dataSource
    • changeState

      public void changeState(DataSource dataSource)
      Notify the data source of a change in state
      Parameters:
      dataSource - the data source to notify
    • setAlias

      public void setAlias(DataSource dataSource)
      This prompts the user for the alias name for the given dataSource and sets the alias on the data source.
      Parameters:
      dataSource - The data source to set an alias on
    • showDataSourceDetails

      public void showDataSourceDetails(DataSource dataSource)
      Show the html description of the given data source.
      Parameters:
      dataSource - The data source to show details for
    • showTimeSelection

      public void showTimeSelection(DataSource dataSource, Component src)
      Show the DataControlDialog for selecting times for the given dataSource
      Parameters:
      dataSource - The data source
      src - Where to popup the dialog deprecated Don't use this anymore
    • doMakeDataChoiceMenu

      public JMenu doMakeDataChoiceMenu(DataChoice dataChoice)
      Make the menu for the given data choice
      Parameters:
      dataChoice - The data choice
      Returns:
      The menu
    • doMakeDataChoiceMenus

      public List doMakeDataChoiceMenus(DataChoice dataChoice)
      Make the menu items for the given data choice
      Parameters:
      dataChoice - The data choice
      Returns:
      A list of menu items
    • doMakeDataChoiceMenuItems

      public List doMakeDataChoiceMenuItems(DataChoice dataChoice, boolean isUserFormula, boolean showAll)
      Make the menu items for the given data choice
      Parameters:
      dataChoice - The data choice
      isUserFormula - Is this data choice a user formula
      showAll - If true then add in the items for creating applicable displays
      Returns:
      List of menu items
    • doMakeControlButtons

      public JPanel doMakeControlButtons(boolean vertical)
      Creates the icon buttons for creating display controls
      Parameters:
      vertical - Alignment is vertical
      Returns:
      Panel holding the icon buttons
    • showDataTreeMenu

      public void showDataTreeMenu(DataTree dataTree, MouseEvent event, boolean showFullMenu)
      Popup a menu for a datachoice object over the tree component at (x,y)
      Parameters:
      dataTree - The data tree to show a menu for
      event - The click
      showFullMenu - Should show the full menu
    • initHelpTips

      public void initHelpTips(boolean checkPrefs)
      Create (if null) and show the HelpTipDialog. If checkPrefs is true then only create the dialog if the PREF_HELPTIPSHOW preference is true.
      Parameters:
      checkPrefs - Should the user preferences be checked
    • closeHelpTips

      public void closeHelpTips()
      If created, close the HelpTipDialog window.
    • showHelpTips

      public void showHelpTips()
      Create (if null) and show the HelpTipDialog
    • splashMsg

      public void splashMsg(String m)
      Show a message in the splash screen (if it exists)
      Parameters:
      m - The message to show
    • splashClose

      public void splashClose()
      Close and dispose of the splash window (if it has been created).
    • about

      public void about()
      Popup the about dialog. Show the title and the version.
    • deleteKeyPressed

      public void deleteKeyPressed(DataTree dataTree)
      Handle when the delete key is pressed in the data tree
      Parameters:
      dataTree - The data tree
    • dataTreeClick

      public void dataTreeClick(DataTree dataTree, MouseEvent event)
      The data tree was clicked. Either show the data tree menu or popup the control dialog, depending on whether it was right click or a double click
      Parameters:
      dataTree - The DataTree that was clicked
      event - The MouseEvent
    • showControlDialog

      public void showControlDialog(DataTree dataTree, MouseEvent event)
      Create and show a DataControlDialog for the DataChoice in the DataTree at the given mouse x and y (if there is a data choice there).
      Parameters:
      dataTree - The DataTree
      event - The MouseEvent
    • doMakeStatusBar

      public JPanel doMakeStatusBar(IdvWindow window)
      Make the status bar for the window. This contains a MemoryMonitor and a message label. This does not add the status bar to the frame though.
      Parameters:
      window - The window
      Returns:
      The status bar
    • doMakeRovingProgressBar

      public RovingProgress doMakeRovingProgressBar()
      Make the roving progress bar
      Returns:
      Roving progress bar
    • getStatusBorder

      public Border getStatusBorder()
      Get the border used for the status bar
      Returns:
      The border
    • getFrame

      public JFrame getFrame()
      If there is a lastActiveFrame then return that. Else return the first window in the list of windows
      Overrides:
      getFrame in class WindowHolder
      Returns:
      Some JFrame
    • doBasicInitialization

      public void doBasicInitialization()
      Do basic initialization
    • findWindowThatMatches

      protected IdvWindow findWindowThatMatches(List currentWindows, WindowInfo windowInfo)
      Find the window that matches the window info
      Parameters:
      currentWindows - list of windows
      windowInfo - the info to search for
      Returns:
      the matching window or null
    • unpersistWindowInfo

      public void unpersistWindowInfo(List windows, List newViewManagers, boolean okToMerge, boolean fromCollab, boolean didRemoveAll)
      Handle the list of IdvWindow-s from the bundle
      Parameters:
      windows - The windows form the bundle.
      newViewManagers - List of the new view managers. We remove any ones we init
      okToMerge - true if okay to merge
      fromCollab - From collaboration
      didRemoveAll - true if remove all was done
    • disposeAllWindows

      public void disposeAllWindows()
      Dispose of all Windows
    • createNewWindow

      public IdvWindow createNewWindow()
      Create a new window containing a new MapViewManager
      Returns:
      The new window
    • createNewWindow

      public IdvWindow createNewWindow(List viewManagers)
      Create a new IdvWindow for the given viewManager. Put the contents of the viewManager into the window
      Parameters:
      viewManagers - The view managers
      Returns:
      The new window
    • createNewWindow

      public IdvWindow createNewWindow(List viewManagers, String skinPath)
      Create a new IdvWindow with the lsit of ViewManager-s and the xml skin.
      Parameters:
      viewManagers - The view managers to put in the window.
      skinPath - The skin
      Returns:
      The window
    • createNewWindow

      public IdvWindow createNewWindow(List viewManagers, boolean notifyCollab)
      Create a new IdvWindow for the given viewManager. Put the contents of the viewManager into the window
      Parameters:
      viewManagers - The view managers
      notifyCollab - Should the CollabManager be notified
      Returns:
      The new window
    • createNewWindow

      public IdvWindow createNewWindow(List viewManagers, boolean notifyCollab, String title, String skinPath, Element root)
      Create a new window
      Parameters:
      viewManagers - the ViewManagers for the window
      notifyCollab - true if we should notify collaborators
      title - the window title
      skinPath - the path tot he skin
      root - the skin root element
      Returns:
      the window
    • createNewWindow

      public IdvWindow createNewWindow(List viewManagers, String skinPath, String windowTitle, WindowInfo windowInfo)
      Create a new IdvWindow with the lsit of ViewManager-s and the xml skin.
      Parameters:
      viewManagers - The view managers to put in the window.
      skinPath - The skin
      windowTitle - title
      windowInfo - the WindowInfo
      Returns:
      The window
    • createNewWindow

      public IdvWindow createNewWindow(List viewManagers, boolean notifyCollab, String skinPath, Element skinRoot)
      Create a new IdvWindow
      Parameters:
      viewManagers - The view managers to put in the window.
      notifyCollab - Should we tell the collab facility
      skinPath - The skin. May be null.
      skinRoot - Root of the skin xml. May be null.
      Returns:
      The window.
    • createNewWindow

      public IdvWindow createNewWindow(List viewManagers, boolean notifyCollab, String title, String skinPath, Element skinRoot, boolean show, WindowInfo windowInfo)
      Create a new window
      Parameters:
      viewManagers - The view managers to put in the window.
      notifyCollab - Should we tell the collab facility
      title - The title
      skinPath - The skin. May be null.
      skinRoot - Root of the skin xml. May be null.
      show - If true show the window once created, otherwise leave it to the caller.
      Returns:
      The window.
    • getComponentGroups

      public List getComponentGroups()
      Get the component groups
      Returns:
      the List of groups
    • getWindowsToPersist

      public List getWindowsToPersist()
      Get the list of IdvWindows that should be saved in a bundle
      Returns:
      List of windows to persist
    • getToolbarUI

      public JComponent getToolbarUI()
      Create a gui component of the toolbar
      Returns:
      the toolbar
    • doMakeIdvXmlUi

      protected IdvXmlUi doMakeIdvXmlUi(IdvWindow window, List viewManagers, Element skinRoot)
      Factory method to create an xmlui
      Parameters:
      window - The window
      viewManagers - The view manager
      skinRoot - The skin xml
      Returns:
      The xmlui
    • doMakeToolbar

      protected JComponent doMakeToolbar()
      Make the toolbar
      Returns:
      toolbar
    • reloadToolbarResources

      public void reloadToolbarResources()
      Reload the toolbar xml resources
    • updateIconBar

      public void updateIconBar()
      Update the icon toolbar in all windows
    • checkToolbarVisibility

      public void checkToolbarVisibility()
      Check and toggle the toolbar visibility
    • doMakeDefaultContents

      public JComponent doMakeDefaultContents(IdvWindow window, ViewManager viewManager)
      If we don't have a UI skin then this method is called to create the window contents
      Parameters:
      window - The window
      viewManager - The ViewManager being shown in the window
      Returns:
      The GUI contents
    • getToolbarRoot

      public Element getToolbarRoot()
      Get the root of the toolbar xml
      Returns:
      The toolbar xml root
    • showResults

      public void showResults(DataSourceResults results)
      Display any errors that are contained in the given results. The results are from one or more data source create calls.
      Parameters:
      results - The results to show
    • removeDataSourceHolder

      public void removeDataSourceHolder(DataSourceHolder holder)
      Remove the given data tree from the list of data trees
      Parameters:
      holder - The holder to remove
    • addDataSourceHolder

      public void addDataSourceHolder(DataSourceHolder holder)
      Add the given data source holder to the list of data source holders
      Parameters:
      holder - The holder to initialize
    • initDataSourceHolder

      public void initDataSourceHolder(DataSourceHolder holder, boolean inWindow)
      Add the set of data sources to the given holder. Put it in a window if inWindow is true.
      Parameters:
      holder - The holder to initialize
      inWindow - Put the holder in a window?
    • addDisplayControl

      public void addDisplayControl(DisplayControl control)
      Notify the data source holders of a new display control. Redo any menus
      Parameters:
      control - The new control
    • showDashboard

      public void showDashboard()
      This tries to show one of the main gui windows
    • haveBasicWindow

      public boolean haveBasicWindow()
      Do we have a basic window
      Returns:
      true if the window is a basic window
    • showBasicWindow

      public boolean showBasicWindow(boolean createThemIfNotThere)
      This tries to show one of the main gui windows
      Parameters:
      createThemIfNotThere - If true then, if there isn't any non view containing windows then call doMakeBasicWindows()
      Returns:
      Were there any found
    • addViewMenuItems

      public void addViewMenuItems(DisplayControl control, List items)
      Gets called by the display controls. We add the 'embed in tabs' menu items
      Parameters:
      control - The control
      items - List of menu items
    • getShowControlsInTab

      protected boolean getShowControlsInTab()
      Do we do control tabs
      Returns:
      Do we do control tabs
    • removeDisplayControl

      public void removeDisplayControl(DisplayControl control)
      Notify the data source holders of a removed display control. Redo any menus
      Parameters:
      control - The removed control
    • removeAllDataSources

      public void removeAllDataSources()
      Remove all data sources from the data source holders. Update any menus.
    • removeDataSource

      public void removeDataSource(DataSource dataSource)
      Remove the data source the data source holders. Update the data menu in all menu bars.
      Parameters:
      dataSource - The removed data source
    • dataSourceChanged

      public void dataSourceChanged(DataSource source)
      Tell the data source holders of the change. Update any menus.
      Parameters:
      source - The data source that changed.
    • dataSourceTimeChanged

      public void dataSourceTimeChanged(DataSource source)
      Tell the data source holders of the change. Update any menus.
      Parameters:
      source - The data source that changed.
    • addDataSource

      public void addDataSource(DataSource dataSource)
      Tell the data source holders of the change. Update any menus.
      Parameters:
      dataSource - The new data source
    • addStateToBundle

      public void addStateToBundle(Hashtable data)
      Add any UI state to the bundle. Example: commands to show color table editor, station model editor, etc.
      Parameters:
      data - Where to put the state.
    • addDataHolderState

      public void addDataHolderState(Hashtable data)
      Add any UI state concerning the data holders (e.g., window size) to the bundle.
      Parameters:
      data - Where to put the state.
    • applyDataHolderState

      public void applyDataHolderState(Hashtable misc)
      misc contains state that was from a bundle. Apply it to the data source holders.
      Parameters:
      misc - The state
    • getDataSourceHolders

      public List getDataSourceHolders()
      Get the list of DataSource holders
      Returns:
      the list of holders
    • showMenu

      public void showMenu(String s)
      This automatically pops up the menu identified by the colon delimited string of menu names
      Parameters:
      s - colon delimited list of menu names
    • showMenuInThread

      public void showMenuInThread(String s)
      This automatically pops up the menu identified by the colon delimited string of menu names
      Parameters:
      s - colon delimited list of menu names
    • showHelp

      public void showHelp(String target)
      Show the help identified by the given target
      Parameters:
      target - The target in the help system
    • showHelp

      public void showHelp(String url, String target)
      Show the javahelp with the given base url and help target
      Parameters:
      url - The base url. May be null, if so use the StateManager's getDefaultHelpUrl
      target - The javahelp target. May be null, if so use the StateManager's getDefaultHelpTarget
    • createDataTree

      public DataTree createDataTree(boolean inOwnWindow)
      Create a DataTree object. Put it in its own window if the parameter inOwnWindow is true.
      Parameters:
      inOwnWindow - Put it in its own window
      Returns:
      The new DataTree
    • createDataTreeWindow

      public DataTree createDataTreeWindow()
      Create a DataTree object that is in its own window
      Returns:
      The new DataTree
    • createDataTree

      public DataTree createDataTree()
      Create a DataTree object that is not in its own window
      Returns:
      The new DataTree
    • initDataTree

      public void initDataTree(DataTree dataTree)
      When a new DataTree is created this method is called. It adds a mouseListener on the tree to listen for mouseClick events which it then calls the dataTreeClick method.
      Parameters:
      dataTree - The DataTree to initialize
    • createDataSelector

      public DataSelector createDataSelector()
      Create a DataSelector window. Put it in its own window if the parameter inOwnWindow is true.
      Returns:
      The new DataSelector
    • embedFieldSelectorInDashboard

      public boolean embedFieldSelectorInDashboard()
      Should we embed the selector in the dashboard
      Returns:
      embed the selector in the dashboard
    • embedQuickLinksInDashboard

      public boolean embedQuickLinksInDashboard()
      Should we embed the quick links in the dashboard
      Returns:
      embed the quick links in the dashboard
    • embedDataChooserInDashboard

      public boolean embedDataChooserInDashboard()
      Should we embed the chooser in the dashboard
      Returns:
      embed the chooser in the dashboard
    • embedLegendInDashboard

      public boolean embedLegendInDashboard()
      Should we embed the legends in the dashboard
      Returns:
      embed legends in the dashboard
    • showOrCreateDataSelector

      public void showOrCreateDataSelector()
      If there is a data selector window around then show it. Else create a new one. deprecated Moving away from hard-coded windows
    • dataSelectorToFrontIfOk

      public void dataSelectorToFrontIfOk()
      Show the data selector window if its ok with the user preference deprecated Moving away from hard-coded windows
    • showDataSelector

      public boolean showDataSelector()
      Show data selector. Called by reflection, public by implementation. Do not call directly
      Returns:
      Was there a data selector shown
    • dataSelectorToFront

      public boolean dataSelectorToFront()
      If there is a data selector window around then show it.
      Returns:
      true if successful
    • createInitialDataSelector

      public void createInitialDataSelector()
      Create the first data selector. deprecated not used
    • createDataSelector

      public DataSelector createDataSelector(boolean inOwnWindow)
      Create a DataSelector window. Put it in its own window if the parameter inOwnWindow is true.
      Parameters:
      inOwnWindow - Should the data selector be in its own window.
      Returns:
      The new DataSelector
    • createDataSelector

      public DataSelector createDataSelector(boolean horizontalOrientation, boolean inOwnWindow)
      Create the data selector
      Parameters:
      horizontalOrientation - Do we have all 4 components horizontal or do we stack the 'Displays' and 'Times' component
      inOwnWindow - Should we popup a window
      Returns:
      The selector
    • selectDataChoice

      public DataChoice selectDataChoice(ControlDescriptor descriptor)
      Popup a DataTreeDialog to let the user select a DataChoice that the given control descriptor is applicable to.
      Parameters:
      descriptor - The control descriptor
      Returns:
      The selected data choice
    • selectDataChoices

      public List selectDataChoices(List operands)
      Popup a dialog containing a DataTree for each operand in the given operands list Return a List of DataChoice's the user selects or null if they canceled.
      Parameters:
      operands - List of param names
      Returns:
      List of DataChoices
    • selectUserChoices

      public List selectUserChoices(String msg, List userOperands)
      Popup a JTextField containing dialog that allows the user to enter text values, one for each name in the userChoices List. This strips off any leading "user_" and converts any underscores into spaces in the userChoices list.
      Parameters:
      msg - The message to display in the GUI
      userOperands - List of DataOperand-s, one for each value
      Returns:
      List of Strings the user entered or null if they cancelled
    • checkHaiku

      public boolean checkHaiku(String action)
      Just some haiku stuff
      Parameters:
      action - some haiku stuff
      Returns:
      some haiku stuff
    • captureImage

      public void captureImage(String filename)
      Capture an image from the first active view managers
      Parameters:
      filename - The image filename deprecated Use ImageGenerator.captureImage
    • captureMovie

      public void captureMovie(String filename)
      Capture a movie from the first view manager
      Parameters:
      filename - The movie filename deprecated Use ImageGenerator.captureMovie
    • showSupportForm

      public void showSupportForm()
      Show the support request form
    • showSupportForm

      public void showSupportForm(String description, String stackTrace)
      Show the support request form
      Parameters:
      description - Default value for the description form entry
      stackTrace - The stack trace that caused this error.
    • showSupportForm

      public void showSupportForm(String description, String stackTrace, JDialog dialog)
      Show the support request form
      Parameters:
      description - Default value for the description form entry
      stackTrace - The stack trace that caused this error.
      dialog - The dialog to put the gui in, if non-null.
    • getSystemInfo

      public StringBuffer getSystemInfo()
      Get the system info
      Returns:
      the system info
    • addToolbarPreferences

      public void addToolbarPreferences(IdvPreferenceManager preferenceManager)
      Create the toolbar preference panel
      Parameters:
      preferenceManager - The preference manager
    • setDateFormat

      public void setDateFormat()
      Set the date format from the preferences
    • getParamsMenuItems

      public static List getParamsMenuItems(JTextComponent fld, String delimiter, boolean includeAliases)
      A utility method to make a list of menu items of the current parameters and the aliases. This sets the text of the given JTextComponent if delimiter is null. Else it appends the param name to the component with the delimiter
      Parameters:
      fld - fld to set
      delimiter - delimiter to use. If null then do fld.setText
      includeAliases - Do we include the list of aliases
      Returns:
      List of menu items
    • showParamsPopup

      public static void showParamsPopup(JTextComponent fld, MouseEvent e, String delimiter, boolean includeAliases)
      A utility method to popup a menu listing the current parameters and the aliases. This sets the text of the given JTextComponent if delimiter is null. Else it appends the param name to the component with the delimiter
      Parameters:
      fld - fld to set
      e - mouse event
      delimiter - delimiter to use. If null then do fld.setText
      includeAliases - Do we include the list of aliases
    • doMakeParamField

      public static JTextField doMakeParamField(String delimiter, boolean includeAliases)
      Make a JTextField that is for entering a parameter name. This adds a mouselistener to popup the params menu above.
      Parameters:
      delimiter - If non-null then we append the name from the popup menu, else we set the text on the field.
      includeAliases - Include the list of aliases in the popup
      Returns:
      The field
    • popupCenterMenu

      public void popupCenterMenu(JComponent near, LatLonWidget latLonWidget)
      Popup a centering menu
      Parameters:
      near - component to popup near
      latLonWidget - the lat/lon widget
    • makeCenterMenus

      public List makeCenterMenus(ActionListener listener)
      Make menus for centering
      Parameters:
      listener - a listener for the actions
      Returns:
      a list of menus showing the center points of the displays
    • getMapLocations

      public List getMapLocations()
      Get the map locations
      Returns:
      the map locations
    • sendEmail

      public static boolean sendEmail(String username, String fromEmail, String subject, String htmlBody) throws javax.mail.MessagingException
      Sends an email to the predefined support address.
      Parameters:
      username - The user's name or identifier for the "From" field.
      fromEmail - The actual "reply-to" or sender email address.
      subject - The subject line of the email.
      htmlBody - The body of the email, formatted as HTML.
      Returns:
      true if the email was sent successfully, false otherwise.
      Throws:
      javax.mail.MessagingException
    • sendSupportEmail

      public static boolean sendSupportEmail(String username, String fromEmail, String subject, String htmlBody, List<IdvUIManager.EmailAttachment> attachments) throws javax.mail.MessagingException, UnsupportedEncodingException
      Sends an email to the predefined support address.
      Parameters:
      username - The user's name or identifier for the "From" field.
      fromEmail - The actual "reply-to" or sender email address.
      subject - The subject line of the email.
      htmlBody - The body of the email, formatted as HTML.
      Returns:
      true if the email was sent successfully, false otherwise.
      Throws:
      javax.mail.MessagingException
      UnsupportedEncodingException