ucar.unidata.idv.ui
Class IdvUIManager

java.lang.Object
  extended by ucar.unidata.ui.WindowHolder
      extended by ucar.unidata.idv.IdvManager
          extended by ucar.unidata.idv.ui.IdvUIManager
All Implemented Interfaces:
ActionListener, EventListener, IdvConstants

public class IdvUIManager
extends IdvManager

Manages the user interface for the IDV

Author:
IDV development team

Field Summary
static String ATTR_ACTION
          Xml attribute name for the action in the actions resource
static String ATTR_DESCRIPTION
          Xml attribute name for the description in the actions resource
static String ATTR_GROUP
          Xml attribute name for the group in the actions resource
static String ATTR_ID
          Xml attribute name for the in the actions resource
static String ATTR_IMAGE
          Xml attribute name for the image in the actions resource
static String ATTR_MAINWINDOW
          Xml attribute name for skin mainwindow attribute
static String COMP_CHOOSER
          Xml tag name for the chooser tag.
static String COMP_CHOOSERS
          tag for xmlui to show choosers
static String COMP_COMPONENT_CHOOSERS
          _more_
static String COMP_COMPONENT_GROUP
          _more_
static String COMP_COMPONENT_HTML
          _more_
static String COMP_COMPONENT_SKIN
          _more_
static String COMP_DATASELECTOR
          The identifier of the data selector component
static String COMP_DATATREE
          Xml tag name for datatree
static String COMP_FAVORITESBAR
          The identifier of the toolbar component
static String COMP_GLOBEVIEW
          Xml tag name for map view manager
static String COMP_HELP
          Help tag for xmlui
static String COMP_MAPVIEW
          Xml tag name for map view manager
static String COMP_MEMORYMONITOR
          The identifier of the toolbar component
static String COMP_MENUBAR
          The identifier of the menubar component
static String COMP_MESSAGELABEL
          Xml tag name for messagelabel
static String COMP_MESSAGELOGGER
          Xml tag name for messagelogger
static String COMP_PROGRESSBAR
          The identifier of the progress bar
static String COMP_READINGLABEL
          The identifier of the wait label
static String COMP_STATUSBAR
          Xml tag name for status label
static String COMP_STREAMINGLABEL
          The identifier of the streaming indicator
static String COMP_TOOLBAR
          The identifier of the toolbar component
static String COMP_TRANSECTVIEW
          Xml tag name for map view manager
static String COMP_VIEW
          Xml tag name for any view manager
static String COMP_VIEWPANEL
          Xml tag name for the panel that holds all of the views
static String COMP_WAITLABEL
          The identifier of the wait label
static String FIELDTYPE_AREA
           
static String FIELDTYPE_BOOLEAN
           
static String FIELDTYPE_CHOICE
           
static String FIELDTYPE_FILE
           
static String FIELDTYPE_LOCATION
           
static String FIELDTYPE_TEXT
           
static ImageIcon ICON_LOCK
          _more_
static ImageIcon ICON_REMOVE
          Icon used to remove displays
static ImageIcon ICON_UNLOCK
          The icon used to show unlocked legend components
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.
static String MENU_DATA
          The identifier of the "Data" menu held in the xml file that defines the menu bar (e.g., resources/defaultmenu.xml).
static String MENU_DELETEHISTORY
          The identifier of the "Deletehistory" menu held in the xml file that defines the menu bar (e.g., resources/defaultmenu.xml).
static String MENU_DELETEVIEWS
          Menu id in the menu xml for the delete views menu
static String MENU_DISPLAYS
          The identifier of the "Displays" menu held in the xml file that defines the menu bar (e.g., resources/defaultmenu.xml).
static String MENU_EDITFORMULAS
          the edit formulas menu
static String MENU_HELP
          Help menu
static String MENU_HISTORY
          The identifier of the "History" menu held in the xml file that defines the menu bar (e.g., resources/defaultmenu.xml).
static String MENU_LOCATIONS
          identifier for locations menu
static String MENU_MAPS
          identifier for maps menu
static String MENU_NEWDISPLAY
          Id of the "New Display" menu item for the file menu
static String MENU_NEWVIEWS
          The identifier of the "New views" menu item held in the xml file that defines the menu bar (e.g., resources/defaultmenu.xml).
static String MENU_PUBLISH
          The identifier of the "Data" menu held in the xml file that defines the menu bar (e.g., resources/defaultmenu.xml).
static String MENU_PUBLISH_CONFIG
          Menu id in the menu xml for the publis/configure menu
static String MENU_SPECIAL
          identifier for special menu
static String MENU_VIEW
          ID for the View menu
static String MENU_WINDOWS
          id for the windows menu
static String PROP_HELP_EMAIL
          property for support form
static String PROP_HELP_NAME
          property for support form
static String PROP_HELP_ORG
          property for support form
static String PROP_SUPPORT_MESSAGE
          property for support form
static String PROP_SUPPORT_PACKAGE
          property for support form
static long startTime
          For timing debugs
static String TAG_ACTION
          Xml tag for the actions resource
static long timeSinceLastWait
          For timing debugs
 
Fields inherited from class ucar.unidata.ui.WindowHolder
contents, dialog, frame, window
 
Fields inherited from interface ucar.unidata.idv.IdvConstants
ARG_B64BUNDLE, ARG_BUNDLE, ARG_CATALOG, ARG_CHOOSER, ARG_CLEARDEFAULT, ARG_CODE, ARG_CONNECT, ARG_CURRENTTIME, ARG_DATA, ARG_DEBUG, ARG_DEFAULT, ARG_DISPLAY, ARG_DXML, ARG_FIXEDTIME, ARG_HELP, ARG_IMAGE, ARG_IMAGESERVER, ARG_INSTALLPLUGIN, ARG_ISLFILE, ARG_ISLINTERACTIVE, ARG_LISTRESOURCES, ARG_MAINCLASS, ARG_MOVIE, ARG_MSG_DEBUG, ARG_MSG_RECORD, ARG_NODEFAULT, ARG_NOGUI, ARG_NOONEINSTANCE, ARG_NOPLUGINS, ARG_NOPREF, ARG_ONEINSTANCEPORT, ARG_PLUGIN, ARG_PORT, ARG_PRINTJNLP, ARG_PROPERTIES, ARG_SCRIPT, ARG_SERVER, ARG_SETFILES, ARG_SITEPATH, ARG_TEMPLATE, ARG_TEST, ARG_TESTEVAL, ARG_TRACE, ARG_TRACEONLY, ARG_USERPATH, DEFAULT_DATE_FORMAT, DEFAULT_DOCPATH, DEFAULT_TIMEZONE, FILE_VMSTATE, FILTER_CPT, FILTER_ISL, FILTER_JNLP, FILTER_XIDV, FILTER_XIDVZIDV, FILTER_XML, FILTER_ZIDV, ID_COMMANDSTORUN, ID_DATASOURCES, ID_DISPLAYCONTROLS, ID_IDV, ID_JYTHON, ID_MESSAGE, ID_MISCHASHTABLE, ID_VERSION, ID_VIEWMANAGERS, ID_WINDOWS, INITIAL_PROBE_EARTHLOCATION, NULL_DATA_SELECTION, NULL_STRING, PREF_ARCHIVEDIR, PREF_ARCHIVENAME, PREF_AUTODISPLAYS_ENABLE, PREF_AUTODISPLAYS_SHOWGUI, PREF_AUTOSELECTDATA, PREF_CACHESIZE, PREF_CONTROLSINTABS, PREF_DATAPREFIX, PREF_DATE_FORMAT, PREF_DISTANCEUNIT, PREF_DOCACHE, PREF_EMBEDDATACHOOSERINDASHBOARD, PREF_EMBEDFIELDSELECTORINDASHBOARD, PREF_EMBEDLEGENDINDASHBOARD, PREF_EMBEDQUICKLINKSINDASHBOARD, PREF_EVENT_KEYBOARDMAP, PREF_EVENT_MOUSEMAP, PREF_EVENT_WHEELMAP, PREF_FAST_RENDER, PREF_FIELD_CACHETHRESHOLD, PREF_FILEREADDIR, PREF_FILEWRITEDIR, PREF_HISTORY, PREF_LASTVERSION, PREF_LATLON_FORMAT, PREF_LOCALE, PREF_LOOKANDFEEL, PREF_MAXIMAGESIZE, PREF_OPEN_ASK, PREF_OPEN_MERGE, PREF_OPEN_REMOVE, PREF_PROJ_LIST, PREF_SAMPLINGMODE, PREF_SHOWCONTROLWINDOW, PREF_SHOWDASHBOARD, PREF_SHOWDECODEDIALOG, PREF_SHOWHIDDENFILES, PREF_SHOWQUITCONFIRM, PREF_SITEPATH, PREF_TIMEZONE, PREF_VERTICALCS, PREF_VERTICALUNIT, PREF_ZIDV_ASK, PREF_ZIDV_DIRECTORY, PREF_ZIDV_SAVETOTMP, PROP_3DMODE, PROP_ABOUTTEXT, PROP_APPRESOURCEPATH, PROP_CHOOSERS, PROP_CHOOSERS_ALL, PROP_CONTROLDESCRIPTORS, PROP_CONTROLDESCRIPTORS_ALL, PROP_DATAHOLDERBOUNDS, PROP_DEFAULTLOCATIONS, PROP_JNLPCODEBASE, PROP_JNLPTEMPLATE, PROP_JNLPTITLE, PROP_LOADINGXML, PROP_OLDCONTROLDESCRIPTORS, PROP_ONEINSTANCEPORT, PROP_PREFERENCES, PROP_PROJ_NAME, PROP_RESOURCEFILES, PROP_SHOWDASHBOARD, PROP_SHOWDATATREE, PROP_SHOWFORMULAS, PROP_SHOWSPLASH, PROP_SPLASHICON, PROP_UI_DESKTOP, PROP_VERSIONFILE, PROP_WINDOW_SCREENSIZEOFFSET, PROP_WINDOW_SIZEHEIGHT, PROP_WINDOW_SIZEWIDTH, PROP_WINDOW_USESCREENSIZE, SUFFIX_BAT, SUFFIX_CPT, SUFFIX_ISL, SUFFIX_JNLP, SUFFIX_RBI, SUFFIX_SH, SUFFIX_XIDV, SUFFIX_XML, SUFFIX_ZIDV
 
Constructor Summary
IdvUIManager(IntegratedDataViewer idv)
          Create me with the IDV
 
Method Summary
 void about()
          Popup the about dialog.
 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.
 void addDataHolderState(Hashtable data)
          Add any UI state concerning the data holders (e.g., window size) to the bundle.
 void addDataSource(DataSource dataSource)
          Tell the data source holders of the change.
 void addDataSourceHolder(DataSourceHolder holder)
          Add the given data source holder to the list of data source holders
 DataControlDialog addDCD(DataControlDialog dcd)
          Adds the given DataControlDialog to the dcdWindows list.
 void addDisplayControl(DisplayControl control)
          Notify the data source holders of a new display control.
 void addStateToBundle(Hashtable data)
          Add any UI state to the bundle.
 void addStationDisplay(NamedStationTable stationTable, ControlDescriptor cd)
          Create the station table display for the given station table
 void addToolbarPreferences(IdvPreferenceManager preferenceManager)
          Create the toolbar preference panel
 void addViewMenuItems(DisplayControl control, List items)
          Gets called by the display controls.
 void applyDataHolderState(Hashtable misc)
          misc contains state that was from a bundle.
 void captureImage(String filename)
          Deprecated. Use ImageGenerator.captureImage
 void captureMovie(String filename)
          Deprecated. Use ImageGenerator.captureMovie
 void changeState(DataSource dataSource)
          _more_
 boolean checkHaiku(String action)
          Just some haiku stuff
 void clearWaitCursor()
          Helper method to clear any outstanding wait cursor calls.
 void closeCurrentWindow()
          Close the currently active window.
 void closeHelpTips()
          If created, close the HelpTipDialog window.
 void createDataChoiceMenuItem(DataChoice choice, JMenu parentMenu, JMenu dataMenu)
          Create the menu items for dealing with the given data choice
 DataSelector createDataSelector()
          Create a DataSelector window.
 DataSelector createDataSelector(boolean inOwnWindow)
          Create a DataSelector window.
 DataSelector createDataSelector(boolean horizontalOrientation, boolean inOwnWindow)
          Create the data selector
 DataTree createDataTree()
          Create a DataTree object that is not in its own window
 DataTree createDataTree(boolean inOwnWindow)
          Create a DataTree object.
 DataTree createDataTreeWindow()
          Create a DataTree object that is in its own window
 void createInitialDataSelector()
          Deprecated. not used
 IdvWindow createNewWindow()
          Create a new window containing a new MapViewManager
 IdvWindow createNewWindow(List viewManagers)
          Create a new IdvWindow for the given viewManager.
 IdvWindow createNewWindow(List viewManagers, boolean notifyCollab)
          Create a new IdvWindow for the given viewManager.
 IdvWindow createNewWindow(List viewManagers, boolean notifyCollab, String skinPath, Element skinRoot)
          Create a new IdvWindow
 IdvWindow createNewWindow(List viewManagers, boolean notifyCollab, String title, String skinPath, Element root)
          _more_
 IdvWindow createNewWindow(List viewManagers, boolean notifyCollab, String title, String skinPath, Element skinRoot, boolean show, WindowInfo windowInfo)
          Create a new window
 IdvWindow createNewWindow(List viewManagers, String skinPath)
          Create a new IdvWindow with the lsit of ViewManager-s and the xml skin.
 IdvWindow createNewWindow(List viewManagers, String skinPath, String windowTitle, WindowInfo windowInfo)
          Create a new IdvWindow with the lsit of ViewManager-s and the xml skin.
 boolean dataSelectorToFront()
          If there is a data selector window around then show it.
 void dataSelectorToFrontIfOk()
          Deprecated. Moving away from hard-coded windows
 void dataSourceChanged(DataSource source)
          Tell the data source holders of the change.
 void dataSourceTimeChanged(DataSource source)
          Tell the data source holders of the change.
 void dataTreeClick(DataTree dataTree, MouseEvent event)
          The data tree was clicked.
 void deleteHistoryMenuSelected(JMenu fileMenu)
          Fill in the delete history menu
 void deleteKeyPressed(DataTree dataTree)
          Handle when the delete key is pressed in the data tree
 void displayControlChanged(DisplayControl displayControl)
          The display changed
 void displayControlsChanged()
          Called by the IDV when there has been a change to the display controls.
 void displayTemplatesChanged()
          Use this to notify when any of the display templates changed.
 void disposeAllWindows()
           
 void doBasicInitialization()
          Do basic initialization
 void doMakeBasicWindows()
          Create the basic windows.
 JPanel doMakeControlButtons(boolean vertical)
          Creates the icon buttons for creating display controls
 JMenu doMakeDataChoiceMenu(DataChoice dataChoice)
          Make the menu for the given data choice
 List doMakeDataChoiceMenuItems(DataChoice dataChoice, boolean isUserFormula, boolean showAll)
          Make the menu items for the given data choice
 List doMakeDataChoiceMenus(DataChoice dataChoice)
          Make the menu items for the given data choice
 List doMakeDataSourceMenuItems(DataSource dataSource, Component src)
          Return the list of menu items to use when the user has clicked on a DataSource.
 JComponent doMakeDefaultContents(IdvWindow window, ViewManager viewManager)
          If we don't have a UI skin then this method is called to create the window contents
protected  IdvXmlUi doMakeIdvXmlUi(IdvWindow window, List viewManagers, Element skinRoot)
          Factory method to create an xmlui
 void doMakeInitialGui()
          Create the first display window
 JMenuBar doMakeMenuBar()
          Make the menu bar and menus for the given IdvWindow.
static JTextField doMakeParamField(String delimiter, boolean includeAliases)
          Make a JTextField that is for entering a parameter name.
 RovingProgress doMakeRovingProgressBar()
          Make the roving progress bar
 JPanel doMakeStatusBar(IdvWindow window)
          Make the status bar for the window.
protected  JComponent doMakeToolbar()
          Make the toolbar
protected  ViewPanel doMakeViewPanel()
          Factory method for making the ViewPanel
 void editDisplaySettings()
          Show the modal display settings dialog
 void editFormulasMenuSelected(JMenu menu)
          Add in the dynamic menu for editing formulas
 boolean embedDataChooserInDashboard()
          Should we embed the chooser in the dashboard
 boolean embedFieldSelectorInDashboard()
          Should we embed the selector in the dashboard
 boolean embedLegendInDashboard()
          Should we embed the legends in the dashboard
 boolean embedQuickLinksInDashboard()
          Should we embed the quick links in the dashboard
 void favoriteBundlesChanged()
          Use this to notify when any of the favorite bundles changed.
 Object findComponent(String id)
          Find the component that is in an IdvWindow with the id
protected  IdvWindow findWindowThatMatches(List currentWindows, WindowInfo windowInfo)
          Find the window that matches the window info
 String getAction(String id)
          Get the action action for the given action id
 String getActionAttr(String id, String attr)
          Get the given named attribute from the xml element that represents the action id
 String getActionDescription(String id)
          Get the description for the given action
 String getActionImage(String id)
          Get the image for the given action
 Element getActionNode(String id)
          Find the xml element for the given action
 List getActions()
          Get the list of (String) action ids.
 void getComponentGroupMenuItems(IdvComponentGroup group, List items)
           
 List getComponentGroups()
          _more_
 List getComponents()
          Get all components in all windows
 List getDataSourceHolders()
          Get the list of DataSource holders
 JFrame getFrame()
          If there is a lastActiveFrame then return that.
 List getMapLocations()
          _more_
 Hashtable getMenuIds()
          Get the map of menu ids
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.
 GraphicsDevice getScreen(Point p)
          return the screen containing the point, null if none do
protected  boolean getShowControlsInTab()
          Do we do control tabs
 String getSkinHtml()
          Get the skin's HTML
 List getStandAloneControlDescriptors()
          Add the stand alone displays into the display menu
 Border getStatusBorder()
          Get the border used for the status bar
 Element getToolbarRoot()
          Get the root of the toolbar xml
 JComponent getToolbarUI()
          Create a gui component of the toolbar
protected  String getViewManagerTabLabel(ViewManager viewManager, JTabbedPane tabs)
          Create the tab label for the embedded legend tabs
 ViewPanel getViewPanel()
          get the view panel, the one that holds the displays.
 int getWaitCursorCount()
          Return the number of open wait cursor calls
 List getWindowGroup(Object group)
          This gets all of the objects that are associated with the given group for all active windows.
 List getWindowsToPersist()
          Get the list of IdvWindows that should be saved in a bundle
protected  void handleMenuDeSelected(String id, JMenu menu)
          DeInitialize the given menu before it is shown
protected  void handleMenuSelected(String id, JMenu menu)
          Initialize the given menu before it is shown
 boolean handleSideLegend(ViewManager viewManager, JComponent sideLegend)
          noop
 void handleWindowActivated(IdvWindow window)
          Handle when the window is activated.
 boolean haveBasicWindow()
          Do we have a basic window
 void historyMenuSelected(JMenu fileMenu)
          User just clicked on the file-history menu.
 void init()
          Called by the IDV when its initialization is done.
 void initDataSourceHolder(DataSourceHolder holder, boolean inWindow)
          Add the set of data sources to the given holder.
 void initDataTree(DataTree dataTree)
          When a new DataTree is created this method is called.
 void initDone()
          Called by the IDV when its initialization is done.
 void initHelpTips(boolean checkPrefs)
          Create (if null) and show the HelpTipDialog.
protected  void initializeDisplayMenu(JMenu displayMenu)
          Add in the menu items for the given display menu
protected  void initializeViewMenu(JMenu viewMenu)
          Add in the menu items for the given view menu
 void initSplash()
          Create the splash screen if needed
 boolean isAction(String id)
          Is the given id an action.
 void loadLookAndFeel()
          Load in the look and feel
 void loadSkinByIndex(int skinIndex)
          Load the skin by index
 List makeActionMenu(Object object, String method, boolean makeCall)
          Make the menu of actions
 List makeCenterMenus(ActionListener listener)
          Make menus for centering
 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.
 List makeSkinMenuItems(ActionListener listener, boolean onlyUI, boolean onlyEmbedded)
           
 void makeViewStateMenu(JMenu menu)
          This adds to the given menu a set of MenuItems, one for each saved viewmanager in the vmState list.
 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.
protected  void makeWindowMenu(IdvWindow window, JMenu menu)
           
 void makeWindowsMenu(JMenu menu)
          Make the windows menu.
 void popupCenterMenu(JComponent near, LatLonWidget latLonWidget)
          Popup a centering menu
 void processBundle(SavedBundle bundle)
          Pass through to the idv to load in the given bundle
protected  void processBundleMenu(JMenu displayMenu, int bundleType)
          Create the bundle menu for the given list of bundles
 void processDialog(DataControlDialog dcd)
          Handle (polymorphically) the DataControlDialog.
protected  void processInstanceMenu(JMenu displayMenu)
          Add the instances into the display menu
protected  void processMapMenu(JMenu displayMenu, boolean makeNew)
          Add the map menu into the display menu
protected  void processStandAloneMenu(JMenu displayMenu, boo