Class UIManager
- All Implemented Interfaces:
ActionListener,EventListener,IdvConstants
Derive our own UI manager to do some specific things:
- Removing displays
- Showing the dashboard
- Adding toolbar customization options
- Implement the McIDAS-V toolbar as a JToolbar.
- Deal with bundles without component groups.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static enumRepresents what McIDAS-V "knows" about IDV actions.private classRepresents a SavedBundle as a tree.private static classA type ofHttpFormEntrythat supports line wrapping for text area entries.static final classRepresents an individual IDV action.static final classRepresents the set of knownIdvActionsin an idiom that can be easily used by both the IDV and McIDAS-V.private classprivate classHandle mouse clicks that occur within the toolbar.private classprivate classstatic enumAToolbarStyleis a representation of the way icons associated with current toolbar actions should be displayed.Nested classes/interfaces inherited from class ucar.unidata.idv.ui.IdvUIManager
IdvUIManager.EmailAttachment -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final StringAction command for manipulating the size of the toolbar icons.private static final StringAction command for removing all displaysprivate static final StringAction command for showing the dashboardprivate static final StringAction command for showing the dashboardprivate static final StringAction command for showing the dashboardprivate static final StringAction command for displaying the toolbar preference tab.private static final StringMessage shown when an unknown action is in the toolbar.The currently "displayed" actions.private intprivate intprivate UIManager.ToolbarStyleCurrent representation of toolbar actions.protected IdvWindowKeep the dashboard around so we don't have to re-create it each time.private booleanWhether or not the list of available actions has been initialized.private booleanprivate booleanprivate McvHelpTipDialogTHe help tip dialogprivate intprivate IntegratedDataViewerIDV instantiation--nice to keep around to reduce getIdv() calls.private final UIManager.IdvActionsStores all available actions.protected booleanFalse untilinitDone().private static final StringLabel for the "link" to the toolbar customization preference tab.private static final org.slf4j.Loggerstatic final StringId of the "New Display Tab" menu item for the file menustatic final StringMenu ID for the "Restore Saved Views" submenu.Maps menu IDs toJMenus.private UIManager.NextDisplayActionKey combo for moving to the next display relative to the current.private MapA cache of the operand name to value for the user choicesprivate UIManager.PrevDisplayActionKey combo for moving to the previous display relative to the current.private static final StringThe IDV property that reflects the size of the icons.private static final StringKey for moving to the next display.private static final StringKey for moving to the previous display.private static final StringModifier key, like "control" or "shift".private static final StringKey that pops up the list of displays.private static final StringKey for showing the dashboard.private static final StringKey for showing the Jython Library (modifier is "alt" key).private static final StringKey for showing the Jython Shell.static final StringProperty name for whether or not the description field of the support form should perform line wrapping.static final HashMap<String, ViewManager> Used to keep track of ViewManagers inside a bundle.private UIManager.ShowDisplayActionKey combo for the popup with list of displays.Map of skin ids to their skin resource index.Cache for the results ofgetWindowTitleFromSkin(int).private McvSplashThe splash screen (minus easter egg).private static final StringThe URL of the script that processes McIDAS-V support requests.static final StringThe tag in the xml ui for creating the special example chooserprotected static final StringSeparator to use between window title components.private MouseListenerKeeping the reference to the toolbar menu mouse listener allows us to avoid constantly rebuilding the menu.A list of the toolbars that the IDV is playing with.private Map<ViewManager, ComponentHolder> An easy way to figure out who is holding a given ViewManager.Fields inherited from class ucar.unidata.idv.ui.IdvUIManager
ATTR_ACTION, ATTR_DESCRIPTION, ATTR_GROUP, ATTR_ID, ATTR_IMAGE, ATTR_MAINWINDOW, COMP_CHOOSER, COMP_CHOOSERS, COMP_COMPONENT_CHOOSERS, COMP_COMPONENT_GROUP, COMP_COMPONENT_HTML, COMP_COMPONENT_SKIN, COMP_DATASELECTOR, COMP_DATATREE, COMP_FAVORITESBAR, COMP_GLOBEVIEW, COMP_HELP, COMP_MAPVIEW, COMP_MEMORYMONITOR_DASH, COMP_MEMORYMONITOR_VIEW, COMP_MENUBAR, COMP_MESSAGELABEL, COMP_MESSAGELOGGER, COMP_PROGRESSBAR, COMP_READINGLABEL, COMP_STATUSBAR, COMP_STREAMINGLABEL, COMP_TOOLBAR, COMP_TRANSECTVIEW, COMP_VIEW, COMP_VIEWPANEL, COMP_WAITLABEL, FIELDTYPE_AREA, FIELDTYPE_BOOLEAN, FIELDTYPE_CHOICE, FIELDTYPE_FILE, FIELDTYPE_LOCATION, FIELDTYPE_TEXT, ICON_LOCK, ICON_REMOVE, ICON_UNLOCK, lastActiveFrame, MENU_BUNDLES, MENU_DATA, MENU_DELETEHISTORY, MENU_DELETEVIEWS, MENU_DISPLAYS, MENU_EDITFORMULAS, MENU_HELP, MENU_HISTORY, MENU_HISTORY_BUNDLE, MENU_HISTORY_FILE, MENU_LOCATIONS, MENU_MAPS, MENU_NEWDISPLAY, MENU_PUBLISH, MENU_PUBLISH_CONFIG, MENU_SPECIAL, MENU_VIEW, MENU_WINDOWS, PREF_LightWeightPopupEnabled, PROP_HELP_EMAIL, PROP_HELP_NAME, PROP_HELP_ORG, PROP_SUPPORT_MESSAGE, PROP_SUPPORT_PACKAGE, startTime, TAG_ACTION, timeSinceLastWaitFields inherited from class ucar.unidata.ui.WindowHolder
contents, dialog, frame, windowFields inherited from interface ucar.unidata.idv.IdvConstants
ARG_B64BUNDLE, ARG_B64ISL, 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_NOERRORSINGUI, 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, 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_NCIDV_VERSION, ID_VERSION, ID_VIEWMANAGERS, ID_WINDOWS, INITIAL_PROBE_EARTHLOCATION, NULL_DATA_SELECTION, NULL_STRING, PREF_APPEARANCEMODE, 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_GEOMETRY_BY_REF, PREF_HISTORY, PREF_IMAGE_BY_REF, PREF_LARGE_REMOTE_DATA_WARN, PREF_LASTVERSION, PREF_LATLON_FORMAT, PREF_LEGEND_SHOWICONS, PREF_LOCALE, PREF_LOOKANDFEEL, PREF_MAXIMAGESIZE, PREF_MEMORY, PREF_NPOT_IMAGE, 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_THREADS_DATA, PREF_THREADS_RENDER, PREF_TIMEZONE, PREF_VERTICALCS, PREF_VERTICALUNIT, PREF_WINDOW_SHOWTOOLBAR, 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_DISPLAYLIST_GROUP, PROP_FIXFILELOCKUP, PROP_JNLPCODEBASE, PROP_JNLPTEMPLATE, PROP_JNLPTITLE, PROP_LOADINGXML, PROP_MAP_GLOBE_LEVEL, PROP_MAP_MAP_LEVEL, PROP_MINIMUMFRAMECYCLETIME, PROP_MONITORPORT, PROP_OLDCONTROLDESCRIPTORS, PROP_ONEINSTANCEPORT, PROP_PREFERENCES, PROP_PROJ_NAME, PROP_RESOURCEFILES, PROP_SHOWCLOCK_DASH, PROP_SHOWCLOCK_VIEW, PROP_SHOWDASHBOARD, PROP_SHOWDATATREE, PROP_SHOWFORMULAS, PROP_SHOWSPLASH, PROP_SPLASHICON, PROP_UI_DESKTOP, PROP_USE_DISPLAYAREA, PROP_USE_TIMEDRIVER, 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
ConstructorsConstructorDescriptionHands off our IDV instantiation to IdvUiManager. -
Method Summary
Modifier and TypeMethodDescriptionvoidabout()private static Map<UIManager.ActionAttribute, String> actionElementToMap(Element element) voidHandles all the ActionEvents that occur for widgets contained within this class.private voidaddBundle(JToolBar toolbar, UIManager.BundleTreeNode node) Given a reference to the current toolbar and a bundle tree node, build a button representation of the bundle and add it to the toolbar.private voidaddBundleTree(JToolBar toolbar, UIManager.BundleTreeNode node) Builds two things, given a toolbar and a tree node: a JButton that represents a "first-level" parent node and a JPopupMenu that appears upon clicking the JButton.private voidappend(StringBuffer sb, String name, Object value) Append a string and object to the bufferstatic voidapplyTextTheme(Class<?> clazz, org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea, String themePath) Apply a specified RSyntaxTextArea theme to a given text area.private voidChecks for newest version asynchronously Issue #2740buildBundleTree(int bundleType) Builds a tree out of the bundles that should appear within the McV toolbar.Create the display window described by McIDAS-V's default display skinCreate a new IdvWindow for the given viewManager.private voidbuildPopupMenu(UIManager.BundleTreeNode node, JComponent comp) Recursively builds the contents of the (first call) JPopupMenu.private JButtonbuildToolbarButton(String action) Given a valid action and icon size, build a JButton for the toolbar.voidIf created, close the HelpTipDialog window.private MouseListenerBuilds the JPopupMenu that appears when a user right-clicks in the toolbar.voidcreateNewTab(String skinId) Adds a skinned component holder to the active component group.createNewWindow(List viewManagers, boolean notifyCollab, String title, String skinPath, Element skinRoot, boolean show, WindowInfo windowInfo) Override the IDV method so that we hide component group button.voidvoidCreate the basic windows.protected IdvXmlUidoMakeIdvXmlUi(IdvWindow window, List viewManagers, Element skinRoot) doMakeMenuBar(IdvWindow idvWindow) protected JMenuItemdoMakeNewDisplayMenu(JMenuItem newDisplayMenu, boolean inWindow) Populate a "new display" menu from the available skin list.Make the roving progress bardoMakeStatusBar(IdvWindow window) protected JComponentReturn a McV-style toolbar to the IDV.protected ViewPanelCreates theMcIDASVViewPanelcomponent that shows up in the dashboard.voidCalled when there has been any change to the favorite bundles and is most useful for triggering an update to the "toolbar bundles".static List<TwoFacedObject> filterVMMStatesWithVM(ViewManager vm, Collection<?> states) Returns a list ofTwoFacedObjects that are known to be compatible withvm.private StringfixSkinPath(String skinPath) A hack because Unidata moved the skins (taken fromIdvPersistenceManager).getActionAttr(String actionId, String attr) Searches for an action identified by a givenactionId, and returns the value associated with itsattr.protected IcongetActionIcon(String actionId, UIManager.ToolbarStyle style) Returns the icon associated withactionId.getActionNode(String actionId) Looks for the XMLElementrepresentation of the action associated withactionId.Returns the collection of action identifiers.Returns the knownUIManager.IdvActions in the form ofUIManager.IdvActions.Returns the actions that currently make up the McIDAS-V toolbar.intintSearch through list ofIdvWindowsand return the "Data Explorer", if it exists.protected intEstimate the number of megabytes that will be used by this data selectionGet the list of initial skins to create windows forprivate UIManager.ToolbarStylegetToolbarStylePref(UIManager.ToolbarStyle defaultStyle) Queries the stored preferences to determine the preferredUIManager.ToolbarStyle.Overrides the IDV's getToolbarUI so that McV can return its own toolbar and not deal with the way the IDV handles toolbars.Returns the ComponentHolder containing the given ViewManager.private StringgetWindowTitleFromSkin(int index) Get the window title from the skinprotected voidhandleMenuDeSelected(String id, JMenu menu, IdvWindow idvWindow) DeInitialize the given menu before it is shownprotected voidhandleMenuSelected(String id, JMenu menu, IdvWindow idvWindow) Initialize the given menu before it is shownvoidhandleWindowActivated(IdvWindow window) private voidinitDisplayShortcuts(IdvWindow window) Add all the show window keyboard shortcuts.voidinitDone()voidinitHelpTips(boolean checkPrefs) protected voidinitializeDisplayMenu(JMenu displayMenu) Overridden to build a custom Display menu.voidCreate the splash screen if neededprivate voidbooleanisMac()Deprecated.private static booleanisValidIdvAction(Element element) Attempts to verify thatelementrepresents a "valid" IDV action.voidkillOldDisplays(List<IdvComponentHolder> oldHolders, List<IdvWindow> oldWindows, boolean merge) Removes data and displays that existed prior to loading a bundle.voidOverride IdvUIManager's loadLookAndFeel so that we can force the IDV to load the Aqua look and feel if requested from the command line.makeActionMenu(Object obj, String method, boolean makeCall) Make the menu of actions.voidmakeBundledDisplays(WindowInfo info, boolean merge, boolean mergeLayers, boolean fromCollab) Uses the contents ofinfoto rebuild a display that has been bundled.voidmakeBundleMenu(JMenu inBundleMenu) Populate a menu with bundles known to thePersistenceManager.private JMenuItemvoidmakeDefaultLayoutMenu(JMenu menu) voidmakeDeleteViewsMenu(JMenu menu) Overridden by McIDAS-V to add menu scrolling functionality to the "delete" submenu.voidmakeFormulasMenu(JMenu menu) Add in the dynamic menu for displaying formulasstatic JMenuprivate final ActionListenerprivate final MenuListenermakeMenuBarListener(String id, JMenu menu, IdvWindow idvWindow) static JMenuItemmakeMenuItem(String label, Object obj, String method, Object arg) private voidmakeTabNavigationMenu(JMenu menu) Add tab navigationJMenuItemsto the givenmenu.protected static StringMake a window title.protected static StringMake a window title.voidmakeViewStateMenu(JMenu menu, ViewManager vm) voidmakeWindowsMenu(JMenu windowMenu, IdvWindow idvWindow) Overridden to build a custom Window menu.private voidmergeLayers(WindowInfo info, IdvWindow window, boolean fromCollab) private voidpopulateToolbar(JToolBar toolbar) Uses the cached XML to create a toolbar.voidprocessBundle(SavedBundle bundle) Handle loading the givenSavedBundle.voidHandle (polymorphically) theDataControlDialog.Build a mapping of "skin" IDs to their indicies within skin resources.Read the contents of the toolbar XML into a List.Disassociate a givenViewManagerfrom itsComponentHolder.selectUserChoices(String msg, List userOperands) voidUses a given toolbar editor to repopulate all toolbars so that they correspond to the user's choice of actions.private voidsetDashboard(IdvWindow window) Setsdashboardtowindow.voidsetViewManagerHolder(ViewManager vm, ComponentHolder holder) Associates a given ViewManager with a given ComponentHolder.voidOverridden to keep the dashboard around after it's initially created.voidshowDashboard(String tabName) Method to do the work of showing the Data Explorer (nee Dashboard).booleanAttempts to locate and display a dashboard component using an ID.protected voidShow Bruce's display selector widget.voidCreate (if null) and show the HelpTipDialogvoidshowSupportForm(String description, String stackTrace, JDialog dialog) Show the support request formprivate voidshowSupportFormInThread(String description, String stackTrace, JDialog dialog) Show the support request form in a non-swing thread.voidClose and dispose of the splash window (if it has been created).voidShow a message in the splash screen (if it exists)protected static String[]splitTitle(String title) Split window title usingTITLE_SEPARATOR.booleanunpersistComponentGroups(WindowInfo info, McvComponentGroup group) Attempts to add all component holders ininfotogroup.voidunpersistWindowInfo(List windows, List newViewManagers, boolean okToMerge, boolean fromCollab, boolean didRemoveAll) Handles the windowing portions of bundle loading: wraps things in component groups (if needed), merges things into existing windows or creates new windows, and removes displays and data if asked nicely.voidWrites the currently displayed toolbar buttons to the toolbar XML.Methods inherited from class ucar.unidata.idv.ui.IdvUIManager
addChoicesToMenu, addDataHolderState, addDataSource, addDataSourceHolder, addDCD, addDisplayControl, addStateToBundle, addStationDisplay, addToolbarPreferences, addViewMenuItems, applyDataHolderState, captureImage, captureMovie, changeState, checkHaiku, checkToolbarVisibility, clearWaitCursor, closeCurrentWindow, createDataChoiceMenuItem, createDataSelector, createDataSelector, createDataSelector, createDataTree, createDataTree, createDataTreeWindow, createInitialDataSelector, createNewWindow, createNewWindow, createNewWindow, createNewWindow, createNewWindow, createNewWindow, createNewWindow, dataSelectorToFront, dataSelectorToFrontIfOk, dataSourceChanged, dataSourceTimeChanged, dataTreeClick, deleteHistoryMenuSelected, deleteKeyPressed, displayControlChanged, displayControlsChanged, disposeAllWindows, doBasicInitialization, doMakeControlButtons, doMakeDataChoiceMenu, doMakeDataChoiceMenuItems, doMakeDataChoiceMenus, doMakeDataSourceMenuItems, doMakeDefaultContents, doMakeInitialGui, doMakeMenuBar, doMakeParamField, editDisplaySettings, editFormulasMenuSelected, embedDataChooserInDashboard, embedFieldSelectorInDashboard, embedLegendInDashboard, embedQuickLinksInDashboard, findComponent, findWindowThatMatches, getAction, getActionDescription, getActionImage, getComponentGroupMenuItems, getComponentGroups, getComponents, getDataSourceHolders, getFrame, getMapLocations, getParamsMenuItems, getScreen, getShowControlsInTab, getSkinHtml, getStandAloneControlDescriptors, getStatusBorder, getSystemInfo, getToolbarRoot, getViewManagerTabLabel, getViewPanel, getWaitCursorCount, getWindowGroup, getWindowsToPersist, handleSideLegend, haveBasicWindow, historyMenuSelected, historyMenuSelectedV, init, initDataSourceHolder, initDataTree, initializeBundleMenu, initializeViewMenu, isAction, loadSkinByIndex, makeCenterMenus, makeSkinMenuItems, makeViewStateMenu, makeWindowMenu, popupCenterMenu, processBundleMenu, processInstanceMenu, processMapMenu, processStandAloneMenu, processStationMenu, reloadToolbarResources, removeAllDataSources, removeDataSource, removeDataSourceHolder, removeDCD, removeDisplayControl, removeWindow, resetLastActiveViewManager, selectDataChoice, selectDataChoices, sendEmail, sendSupportEmail, setAlias, setDateFormat, showAllWindows, showBasicWindow, showBundleDialog, showBundleDialog, showControlDialog, showDataSelector, showDataSourceDetails, showDataTreeMenu, showHelp, showHelp, showMenu, showMenuInThread, showNormalCursor, showOrCreateDataSelector, showParamsPopup, showResults, showSupportForm, showSupportForm, showTimeSelection, showWaitCursor, showWindow, startReading, stopReading, stripAction, toFrontMainWindows, updateHistoryLinks, updateIconBar, viewManagerActiveChanged, viewManagerAdded, viewManagerChanged, viewManagerDestroyedMethods inherited from class ucar.unidata.idv.IdvManager
getArgsManager, getCollabManager, getColorTableManager, getDataManager, getIdv, getIdvChooserManager, getIdvClass, getIdvProjectionManager, getIdvUIManager, getImageGenerator, getInstallManager, getJythonManager, getPersistenceManager, getPreferenceManager, getProperty, getProperty, getProperty, getPublishManager, getResourceManager, getStateManager, getStationModelManager, getStore, getVMManager, logException, waitUntilDisplaysAreDone, waitUntilDisplaysAreDoneMethods inherited from class ucar.unidata.ui.WindowHolder
close, doMakeContents, getContents, getDialog, getWindow, getWindowTitle, isShowing, removeAll, setMenuBar, setWindowTitle, shouldMakeDialog, show, show, showModal, toFront, windowIsClosing
-
Field Details
-
logger
-
MENU_NEWDISPLAY_TAB
Id of the "New Display Tab" menu item for the file menu- See Also:
-
TAG_EXAMPLECHOOSER
The tag in the xml ui for creating the special example chooser- See Also:
-
savedViewManagers
Used to keep track of ViewManagers inside a bundle. -
PROP_WRAP_SUPPORT_DESC
Property name for whether or not the description field of the support form should perform line wrapping.- See Also:
-
ACT_ICON_TYPE
Action command for manipulating the size of the toolbar icons.- See Also:
-
ACT_REMOVE_DISPLAYS
Action command for removing all displays- See Also:
-
ACT_SHOW_DASHBOARD
Action command for showing the dashboard- See Also:
-
ACT_SHOW_DATASELECTOR
Action command for showing the dashboard- See Also:
-
ACT_SHOW_DISPLAYCONTROLLER
Action command for showing the dashboard- See Also:
-
ACT_SHOW_PREF
Action command for displaying the toolbar preference tab.- See Also:
-
BAD_ACTION_MSG
Message shown when an unknown action is in the toolbar.- See Also:
-
MENU_NEWVIEWS
Menu ID for the "Restore Saved Views" submenu.- See Also:
-
LBL_TB_EDITOR
Label for the "link" to the toolbar customization preference tab.- See Also:
-
currentToolbarStyle
Current representation of toolbar actions. -
PROP_ICON_SIZE
The IDV property that reflects the size of the icons.- See Also:
-
SUPPORT_REQ_URL
The URL of the script that processes McIDAS-V support requests.- See Also:
-
TITLE_SEPARATOR
Separator to use between window title components.- See Also:
-
cachedButtons
The currently "displayed" actions. Keeping this List allows us to get away with only reading the XML files upon starting the application and only writing the XML files upon exiting the application. This will avoid those redrawing delays. -
idvActions
Stores all available actions. -
skinIds
Map of skin ids to their skin resource index. -
viewManagers
An easy way to figure out who is holding a given ViewManager. -
componentHolderCount
-
componentGroupCount
-
skinToTitle
Cache for the results ofgetWindowTitleFromSkin(int). -
splash
The splash screen (minus easter egg). -
toolbars
A list of the toolbars that the IDV is playing with. Used to apply changes to *all* the toolbars in the application. -
toolbarMenu
Keeping the reference to the toolbar menu mouse listener allows us to avoid constantly rebuilding the menu. -
dashboard
Keep the dashboard around so we don't have to re-create it each time. -
initDone
False untilinitDone(). -
idv
IDV instantiation--nice to keep around to reduce getIdv() calls. -
helpTipDialog
THe help tip dialog -
didInitActions
Whether or not the list of available actions has been initialized. -
showDisplayAction
Key combo for the popup with list of displays. -
prevDisplayAction
Key combo for moving to the previous display relative to the current. For key combos the lists of displays in the current window is circular. -
nextDisplayAction
Key combo for moving to the next display relative to the current. For key combos the lists of displays in the current window is circular. -
PROP_KB_MODIFIER
Modifier key, like "control" or "shift".- See Also:
-
PROP_KB_SELECT_DISPLAY
Key that pops up the list of displays. Used in conjunction withPROP_KB_MODIFIER.- See Also:
-
PROP_KB_DISPLAY_PREV
Key for moving to the previous display. Used in conjunction withPROP_KB_MODIFIER.- See Also:
-
PROP_KB_DISPLAY_NEXT
Key for moving to the next display. Used in conjunction withPROP_KB_MODIFIER.- See Also:
-
PROP_KB_SHOW_DASHBOARD
Key for showing the dashboard. Used in conjunction withPROP_KB_MODIFIER.- See Also:
-
PROP_KB_SHOW_SHELL
Key for showing the Jython Shell. Used in conjunction withPROP_KB_MODIFIER.- See Also:
-
PROP_KB_SHOW_LIBRARY
Key for showing the Jython Library (modifier is "alt" key).- See Also:
-
holderCount
-
operandCache
A cache of the operand name to value for the user choices -
didTabs
-
didNewWindow
-
-
Constructor Details
-
UIManager
Hands off our IDV instantiation to IdvUiManager.- Parameters:
idv- The idv
-
-
Method Details
-
createNewWindow
public IdvWindow createNewWindow(List viewManagers, boolean notifyCollab, String title, String skinPath, Element skinRoot, boolean show, WindowInfo windowInfo) Override the IDV method so that we hide component group button.- Overrides:
createNewWindowin classIdvUIManager
-
buildDefaultSkin
Create the display window described by McIDAS-V's default display skin- Returns:
IdvWindowthat was created.
-
buildEmptyWindow
Create a new IdvWindow for the given viewManager. Put the contents of the viewManager into the window- Returns:
- The new window
-
setDashboard
Setsdashboardtowindow. This method also adds some listeners towindowso that the state of the dashboard is automatically saved.- Parameters:
window- The dashboard. Nothing happens ifdashboardhas already been set, or this parameter isnull.
-
unpersistComponentGroups
Attempts to add all component holders ininfotogroup. Especially useful when unpersisting a bundle and attempting to deal with its component groups.- Parameters:
info- The window we want to process.group- Receives the holders ininfo.- Returns:
- True if there were component groups in
info.
-
loadLookAndFeel
Override IdvUIManager's loadLookAndFeel so that we can force the IDV to load the Aqua look and feel if requested from the command line.- Overrides:
loadLookAndFeelin classIdvUIManager
-
applyTextTheme
public static void applyTextTheme(Class<?> clazz, org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea, String themePath) Apply a specified RSyntaxTextArea theme to a given text area.- Parameters:
clazz- Class used to readthemePath.textArea- Text area to which the theme should be applied.themePath- Path to the RSyntaxTextArea theme to apply.
-
handleWindowActivated
- Overrides:
handleWindowActivatedin classIdvUIManager
-
unpersistWindowInfo
public void unpersistWindowInfo(List windows, List newViewManagers, boolean okToMerge, boolean fromCollab, boolean didRemoveAll) Handles the windowing portions of bundle loading: wraps things in component groups (if needed), merges things into existing windows or creates new windows, and removes displays and data if asked nicely.- Overrides:
unpersistWindowInfoin classIdvUIManager- Parameters:
windows- WindowInfos from the bundle.newViewManagers- ViewManagers stored in the bundle.okToMerge- Put bundled things into an existing window?fromCollab- Did this come from the collab stuff?didRemoveAll- Remove all data and displays?- See Also:
-
killOldDisplays
public void killOldDisplays(List<IdvComponentHolder> oldHolders, List<IdvWindow> oldWindows, boolean merge) Removes data and displays that existed prior to loading a bundle.- Parameters:
oldHolders- Component holders around before loading.oldWindows- Windows around before loading.merge- Were the bundle contents merged into an existing window?
-
fixSkinPath
A hack because Unidata moved the skins (taken fromIdvPersistenceManager).- Parameters:
skinPath- original path- Returns:
- fixed path
-
makeBundledDisplays
public void makeBundledDisplays(WindowInfo info, boolean merge, boolean mergeLayers, boolean fromCollab) Uses the contents of
infoto rebuild a display that has been bundled. Ifmergeis true, the displayable parts of the bundle will be put into the current window. Otherwise a new window is created and the relevant parts of the bundle will occupy that new window.- Parameters:
info- WindowInfo to use with creating the new window.merge- Merge created things into an existing window?mergeLayers- Whether or not layers should be merged.fromCollab- Whether or not this is in response to a "collaboration" event.
-
mergeLayers
-
makeTitle
Make a window title. The format for window titles is: <window>TITLE_SEPARATOR<document>- Parameters:
win- Window title.doc- Document or window sub-content.- Returns:
- Formatted window title.
-
makeTitle
Make a window title. The format for window titles is:<window>TITLE_SEPARATOR<document>TITLE_SEPARATOR<other>
- Parameters:
window- Window title.document- Document or window sub content.other- Other content to include.- Returns:
- Formatted window title.
-
splitTitle
Split window title usingTITLE_SEPARATOR.- Parameters:
title- The window title to split- Returns:
- Parts of the title with the white space trimmed.
-
isMac
Deprecated.UseMcIDASV.isMac()instead.Overridden to prevent the IDV'sStateManagerinstantiation ofMacBridge. McIDAS-V uses different approaches for OS X compatibility.- Overrides:
isMacin classIdvUIManager- Returns:
- Always returns
false.
-
about
- Overrides:
aboutin classIdvUIManager
-
actionPerformed
Handles all the ActionEvents that occur for widgets contained within this class. It's not so pretty, but it isolates the event handling in one place (and reduces the number of action listeners to one).- Specified by:
actionPerformedin interfaceActionListener- Overrides:
actionPerformedin classWindowHolder- Parameters:
e- The event that triggered the call to this method.
-
getDisplaySelectorComponent
-
constructToolbarMenu
Builds the JPopupMenu that appears when a user right-clicks in the toolbar.- Returns:
- MouseListener that listens for right-clicks in the toolbar.
-
getToolbarStylePref
Queries the stored preferences to determine the preferredUIManager.ToolbarStyle. If there was no preference,defaultStyleis used.- Parameters:
defaultStyle-ToolbarStyleto use if there was no value associated with the toolbar style preference.- Returns:
- The preferred
ToolbarStyleordefaultStyle. - Throws:
AssertionError- ifPROP_ICON_SIZEhad returned an integer value that did not correspond to a validToolbarStyle.
-
buildToolbarButton
Given a valid action and icon size, build a JButton for the toolbar.- Parameters:
action- The action whose corresponding icon we want.- Returns:
- A JButton for the given action with an appropriate-sized icon.
-
doMakeStatusBar
- Overrides:
doMakeStatusBarin classIdvUIManager
-
doMakeRovingProgressBar
Make the roving progress bar- Overrides:
doMakeRovingProgressBarin classIdvUIManager- Returns:
- Roving progress bar
-
getToolbarUI
Overrides the IDV's getToolbarUI so that McV can return its own toolbar and not deal with the way the IDV handles toolbars. This method also updates the toolbar data member so that other methods can fool around with whatever the IDV thinks is a toolbar (without having to rely on the IDV window manager code).Not that the IDV code is bad of course--I just can't handle that pause while the toolbar is rebuilt!
- Overrides:
getToolbarUIin classIdvUIManager- Returns:
- A new toolbar based on the contents of toolbar.xml.
-
doMakeToolbar
Return a McV-style toolbar to the IDV.- Overrides:
doMakeToolbarin classIdvUIManager- Returns:
- A fancy-pants toolbar.
-
populateToolbar
Uses the cached XML to create a toolbar. Any updates to the toolbar happen almost instantly using this approach. Do note that if there are any components in the given toolbar they will be removed.- Parameters:
toolbar- A reference to the toolbar that needs buttons and stuff.
-
addBundle
Given a reference to the current toolbar and a bundle tree node, build a button representation of the bundle and add it to the toolbar.- Parameters:
toolbar- Toolbar to which we add the bundle.node- Node within the bundle tree that contains our bundle.
-
processBundle
Handle loading the givenSavedBundle.Overridden in McIDAS-V to allow "default" bundles to show the same bundle loading dialog as a "favorite" bundle.
- Overrides:
processBundlein classIdvUIManager- Parameters:
bundle- Bundle to process. Cannot benull.
-
addBundleTree
Builds two things, given a toolbar and a tree node: a JButton that represents a "first-level" parent node and a JPopupMenu that appears upon clicking the JButton. The button is then added to the given toolbar."First-level" means the given node is a child of the root node.
- Parameters:
toolbar- Toolbar to which we add the bundle tree.node- Node we want to add.
-
writeToolbar
Writes the currently displayed toolbar buttons to the toolbar XML. This has mostly been ripped off from ToolbarEditor. :( -
readToolbar
Read the contents of the toolbar XML into a List. We're essentially just throwing actions into the list.- Returns:
- The actions/buttons that live in the toolbar xml. Note that if
an element is
null, this element represents a "space" that should appear in both the Toolbar and the Toolbar Preferences.
-
getActionIcon
Returns the icon associated withactionId. Note that associating the "missing icon" icon with an action is allowable.- Parameters:
actionId- Action ID whose associated icon is to be returned.style- Returned icon's size will be the size associated with the specifiedToolbarStyle.- Returns:
- Either the icon corresponding to
actionIdor the default "missing icon" icon. - Throws:
NullPointerException- ifactionIdis null.
-
getCachedActions
Returns the knownUIManager.IdvActions in the form ofUIManager.IdvActions.- Returns:
idvActions
-
getCachedButtons
Returns the actions that currently make up the McIDAS-V toolbar.- Returns:
ListofUIManager.ActionAttribute.IDs that make up the current toolbar buttons.
-
makeActionMenu
Make the menu of actions.Overridden in McIDAS-V so that we can fool the IDV into working with our icons that allow for multiple "styles".
- Overrides:
makeActionMenuin classIdvUIManager- Parameters:
obj- Object to call.method- Method to call.makeCall- iftrue, callIntegratedDataViewer.handleAction(String).- Returns:
- List of
JMenus that represent our action menus.
-
makeMenuItem
-
makeMenu
-
getActions
Returns the collection of action identifiers.Overridden in McIDAS-V so that we can fool the IDV into working with our icons that allow for multiple "styles".
- Overrides:
getActionsin classIdvUIManager- Returns:
ListofStrings that correspond toIdvActions.
-
getActionNode
Looks for the XMLElementrepresentation of the action associated withactionId.Overridden in McIDAS-V so that we can fool the IDV into working with our icons that allow for multiple "styles".
- Overrides:
getActionNodein classIdvUIManager- Parameters:
actionId- ID of the action whose "action node" is desired. Cannot benull.- Returns:
- "action node" associated with
actionId. - Throws:
NullPointerException- ifactionIdisnull.
-
getActionAttr
Searches for an action identified by a givenactionId, and returns the value associated with itsattr.Overridden in McIDAS-V so that we can fool the IDV into working with our icons that allow for multiple "styles".
- Overrides:
getActionAttrin classIdvUIManager- Parameters:
actionId- ID of the action whose attribute value is desired. Cannot benull.attr- The attribute whose value is desired. Cannot benull.- Returns:
- Value associated with the given action and given attribute.
- Throws:
NullPointerException- ifactionIdorattrisnull.
-
isValidIdvAction
Attempts to verify thatelementrepresents a "valid" IDV action.- Parameters:
element-Elementto check.nullvalues permitted, but they returnfalse.- Returns:
trueifelementhad all requiredUIManager.ActionAttributes.falseotherwise, or ifelementisnull.
-
actionElementToMap
Builds aMapofUIManager.ActionAttributes to values for a givenElement. Ifelementdoes not contain an optional attribute, use the attribute's default value.- Parameters:
element- "Action node" of interest.nullpermitted, but results in an emptyMap.- Returns:
- Mapping of
ActionAttributes to values, or an emptyMapifelementisnull.
-
buildBundleTree
Builds a tree out of the bundles that should appear within the McV toolbar. A tree is a nice way to store this data, as the default IDV behavior is to act kinda like a file explorer when it displays these bundles.
The tree makes it REALLY easy to replicate the default IDV functionality.
- Parameters:
bundleType- One ofSavedBundle.TYPE_FAVORITE,SavedBundle.TYPE_DISPLAY,orinvalid @link
{@link SavedBundle#TYPE_DATA,SavedBundle.TYPE_SYSTEM.- Returns:
- The root BundleTreeNode for the tree containing toolbar bundles.
-
buildPopupMenu
Recursively builds the contents of the (first call) JPopupMenu. This is where that tree annoyance stuff comes in handy. This is basically a simple tree traversal situation.- Parameters:
node- The node that we're trying to use to build the contents.comp- The component to which we add node contents.
-
initDone
- Overrides:
initDonein classIdvUIManager
-
asyncStateCheck
Checks for newest version asynchronously Issue #2740 -
initSplash
Create the splash screen if needed- Overrides:
initSplashin classIdvUIManager
-
initHelpTips
- Overrides:
initHelpTipsin classIdvUIManager
-
closeHelpTips
If created, close the HelpTipDialog window.- Overrides:
closeHelpTipsin classIdvUIManager
-
showHelpTips
Create (if null) and show the HelpTipDialog- Overrides:
showHelpTipsin classIdvUIManager
-
makeBundleMenu
Populate a menu with bundles known to thePersistenceManager.- Parameters:
inBundleMenu- The menu to populate
-
makeWindowsMenu
Overridden to build a custom Window menu.- Overrides:
makeWindowsMenuin classIdvUIManager- See Also:
-
makeFormulasMenu
Add in the dynamic menu for displaying formulas- Parameters:
menu- edit menu to add to
-
initDisplayShortcuts
Add all the show window keyboard shortcuts. To make keyboard shortcuts global, i.e., available no matter what window is active, the appropriate actions have to be added the the window contents action and input maps. FIXME: This can't be the right way to do this!- Parameters:
window- IdvWindow that requires keyboard shortcut capability.
-
showDisplaySelector
Show Bruce's display selector widget. -
doMakeNewDisplayMenu
Populate a "new display" menu from the available skin list. Many thanks to Bruce for doing this in the venerable TabbedUIManager.- Parameters:
newDisplayMenu- menu to populate.inWindow- Is the skinned display to be created in a window?- Returns:
- Menu item populated with display skins
- See Also:
-
setViewManagerHolder
Associates a given ViewManager with a given ComponentHolder.- Parameters:
vm- The ViewManager that is insideholder.holder- The ComponentHolder that containsvm.
-
getComponentHolders
-
getComponentHolderCount
-
getComponentGroupCount
-
getViewManagerHolder
Returns the ComponentHolder containing the given ViewManager.- Parameters:
vm- The ViewManager whose ComponentHolder is needed.- Returns:
- Either
nullor theComponentHolder.
-
removeViewManagerHolder
Disassociate a givenViewManagerfrom itsComponentHolder.- Parameters:
vm-ViewManagerto disassociate.- Returns:
- The associated
ComponentHolder.
-
showDashboard
Overridden to keep the dashboard around after it's initially created. Also give the user the ability to show a particular tab.- Overrides:
showDashboardin classIdvUIManager- See Also:
-
doMakeViewPanel
Creates theMcIDASVViewPanelcomponent that shows up in the dashboard.- Overrides:
doMakeViewPanelin classIdvUIManager- Returns:
- McIDAS-V specific view panel.
-
readSkinIds
Build a mapping of "skin" IDs to their indicies within skin resources.- Returns:
- Map of skin ids to their index within the skin resource.
-
createNewTab
Adds a skinned component holder to the active component group.- Parameters:
skinId- The value of the skin's skinid attribute.
-
getInitialSkins
Get the list of initial skins to create windows for- Returns:
- List of UI skins to create
-
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- Overrides:
doMakeBasicWindowsin classIdvUIManager
-
showDashboard
Method to do the work of showing the Data Explorer (nee Dashboard).- Parameters:
tabName- Name of the tab that should be made active. Cannot benull, but emptyStringvalues will not change the active tab.
-
getDashboardWindow
Search through list ofIdvWindowsand return the "Data Explorer", if it exists.- Returns:
- "Data Explorer" window or
nullif it does not exist.
-
showSupportForm
Show the support request form- Overrides:
showSupportFormin classIdvUIManager- Parameters:
description- Default value for the description form entrystackTrace- The stack trace that caused this error.dialog- The dialog to put the gui in, if non-null.
-
showDashboardComponent
Attempts to locate and display a dashboard component using an ID.- Parameters:
id- ID of the desired component.- Returns:
- True if
idcorresponds to a component. False otherwise.
-
splashClose
Close and dispose of the splash window (if it has been created).- Overrides:
splashClosein classIdvUIManager
-
splashMsg
Show a message in the splash screen (if it exists)- Overrides:
splashMsgin classIdvUIManager- Parameters:
m- The message to show
-
setCurrentToolbars
Uses a given toolbar editor to repopulate all toolbars so that they correspond to the user's choice of actions.- Parameters:
tbe- The toolbar editor that contains the actions the user wants.
-
append
Append a string and object to the buffer- Parameters:
sb- StringBuffer to append toname- Name of the objectvalue- the object value
-
makeControlDescriptorItem
-
displayTemplatesChanged
- Overrides:
displayTemplatesChangedin classIdvUIManager
-
favoriteBundlesChanged
Called when there has been any change to the favorite bundles and is most useful for triggering an update to the "toolbar bundles".- Overrides:
favoriteBundlesChangedin classIdvUIManager
-
showSupportFormInThread
Show the support request form in a non-swing thread. We do this because we cannot call the HttpFormEntry.showUI from a swing thread- Parameters:
description- Default value for the description form entrystackTrace- The stack trace that caused this error.dialog- The dialog to put the gui in, if non-null.
-
doMakeIdvXmlUi
- Overrides:
doMakeIdvXmlUiin classIdvUIManager
-
handleMenuDeSelected
DeInitialize the given menu before it is shown- Overrides:
handleMenuDeSelectedin classIdvUIManager- See Also:
-
handleMenuSelected
Initialize the given menu before it is shown- Overrides:
handleMenuSelectedin classIdvUIManager- See Also:
-
selectUserChoices
- Overrides:
selectUserChoicesin classIdvUIManager
-
makeDefaultLayoutMenu
-
makeViewStateMenu
Bundles any compatibleViewManagerstates intoJMenuItemand adds said menu items tomenu. Incompatible states are ignored.Each
JMenuItem(except those under the "Delete" menu--apologies) associates a "view state" and anObjectListener. TheObjectListeneruses this associated view state to attempt reinitialization ofvm.Override reasoning:
- terminology ("views" rather than "viewpoints").
-
use of
filterVMMStatesWithVM(ViewManager, Collection)to properly detect the "no saved views" case.
- Overrides:
makeViewStateMenuin classIdvUIManager- Parameters:
menu- Menu to populate. Should not benull.vm-ViewManagerthat might get reinitialized. Should not benull.- See Also:
-
makeDeleteViewsMenu
Overridden by McIDAS-V to add menu scrolling functionality to the "delete" submenu.- Overrides:
makeDeleteViewsMenuin classIdvUIManager- Parameters:
menu- "Delete" submenu.
-
filterVMMStatesWithVM
Returns a list ofTwoFacedObjects that are known to be compatible withvm.This method is currently capable of dealing with
TwoFacedObjectsandViewStateswithinstates. Any other types are ignored.- Parameters:
vm-ViewManagerto use for compatibility tests.nullis allowed.states- Collection of objects to test againstvm.nullis allowed.- Returns:
- Either a
Listof compatible "view states" or an emptyList. - See Also:
-
initializeDisplayMenu
Overridden to build a custom Display menu.- Overrides:
initializeDisplayMenuin classIdvUIManager- See Also:
-
getWindowTitleFromSkin
Get the window title from the skin- Parameters:
index- the skin index- Returns:
- the title
-
getMenuIds
- Overrides:
getMenuIdsin classIdvUIManager
-
doMakeMenuBar
- Overrides:
doMakeMenuBarin classIdvUIManager
-
makeMenuBarActionListener
-
makeMenuBarListener
-
processDialog
Handle (polymorphically) theDataControlDialog. This dialog is used to either select a display control to create or is used to set the timers used for aDataSource.- Overrides:
processDialogin classIdvUIManager- Parameters:
dcd- The dialog
-
getEstimatedMegabytes
Estimate the number of megabytes that will be used by this data selection- Parameters:
dcd- Data control dialog containing the data selection whose size we'd like to estimate. Cannot benull.- Returns:
- Rough estimate of the size (in megabytes) of the
DataSelectionwithindcd.
-
McIDASV.isMac()instead.