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 enum
Represents what McIDAS-V "knows" about IDV actions.private class
Represents a SavedBundle as a tree.private static class
A type ofHttpFormEntry
that supports line wrapping for text area entries.static final class
Represents an individual IDV action.static final class
Represents the set of knownIdvActions
in an idiom that can be easily used by both the IDV and McIDAS-V.private class
private class
Handle mouse clicks that occur within the toolbar.private class
private class
static enum
AToolbarStyle
is a representation of the way icons associated with current toolbar actions should be displayed. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
Action command for manipulating the size of the toolbar icons.private static final String
Action command for removing all displaysprivate static final String
Action command for showing the dashboardprivate static final String
Action command for showing the dashboardprivate static final String
Action command for showing the dashboardprivate static final String
Action command for displaying the toolbar preference tab.private static final String
Message shown when an unknown action is in the toolbar.The currently "displayed" actions.private int
private int
private UIManager.ToolbarStyle
Current representation of toolbar actions.protected IdvWindow
Keep the dashboard around so we don't have to re-create it each time.private boolean
Whether or not the list of available actions has been initialized.private boolean
private boolean
private McvHelpTipDialog
THe help tip dialogprivate int
private IntegratedDataViewer
IDV instantiation--nice to keep around to reduce getIdv() calls.private final UIManager.IdvActions
Stores all available actions.protected boolean
False untilinitDone()
.private static final String
Label for the "link" to the toolbar customization preference tab.private static final org.slf4j.Logger
static final String
Id of the "New Display Tab" menu item for the file menustatic final String
Menu ID for the "Restore Saved Views" submenu.Maps menu IDs toJMenu
s.private UIManager.NextDisplayAction
Key combo for moving to the next display relative to the current.private Map
A cache of the operand name to value for the user choicesprivate UIManager.PrevDisplayAction
Key combo for moving to the previous display relative to the current.private static final String
The IDV property that reflects the size of the icons.private static final String
Key for moving to the next display.private static final String
Key for moving to the previous display.private static final String
Modifier key, like "control" or "shift".private static final String
Key that pops up the list of displays.private static final String
Key for showing the dashboard.private static final String
Key for showing the Jython Library (modifier is "alt" key).private static final String
Key for showing the Jython Shell.static final String
Property 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.ShowDisplayAction
Key combo for the popup with list of displays.Map of skin ids to their skin resource index.Cache for the results ofgetWindowTitleFromSkin(int)
.private McvSplash
The splash screen (minus easter egg).private static final String
The URL of the script that processes McIDAS-V support requests.static final String
The tag in the xml ui for creating the special example chooserprotected static final String
Separator to use between window title components.private MouseListener
Keeping 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, timeSinceLastWait
Fields inherited from class ucar.unidata.ui.WindowHolder
contents, dialog, frame, window
Fields 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 TypeMethodDescriptionvoid
about()
private static Map
<UIManager.ActionAttribute, String> actionElementToMap
(Element element) void
Handles all the ActionEvents that occur for widgets contained within this class.private void
addBundle
(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 void
addBundleTree
(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 void
append
(StringBuffer sb, String name, Object value) Append a string and object to the bufferstatic void
applyTextTheme
(Class<?> clazz, org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea, String themePath) Apply a specified RSyntaxTextArea theme to a given text area.private void
Checks 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 void
buildPopupMenu
(UIManager.BundleTreeNode node, JComponent comp) Recursively builds the contents of the (first call) JPopupMenu.private JButton
buildToolbarButton
(String action) Given a valid action and icon size, build a JButton for the toolbar.void
If created, close the HelpTipDialog window.private MouseListener
Builds the JPopupMenu that appears when a user right-clicks in the toolbar.void
createNewTab
(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.void
protected IdvXmlUi
doMakeIdvXmlUi
(IdvWindow window, List viewManagers, Element skinRoot) doMakeMenuBar
(IdvWindow idvWindow) protected JMenuItem
doMakeNewDisplayMenu
(JMenuItem newDisplayMenu, boolean inWindow) Populate a "new display" menu from the available skin list.Make the roving progress bardoMakeStatusBar
(IdvWindow window) protected JComponent
Return a McV-style toolbar to the IDV.protected ViewPanel
Creates theMcIDASVViewPanel
component that shows up in the dashboard.void
Called 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 ofTwoFacedObject
s that are known to be compatible withvm
.private String
fixSkinPath
(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 Icon
getActionIcon
(String actionId, UIManager.ToolbarStyle style) Returns the icon associated withactionId
.getActionNode
(String actionId) Looks for the XMLElement
representation of the action associated withactionId
.Returns the collection of action identifiers.Returns the knownUIManager.IdvAction
s in the form ofUIManager.IdvActions
.Returns the actions that currently make up the McIDAS-V toolbar.int
int
Search through list ofIdvWindows
and return the "Data Explorer", if it exists.protected int
Estimate the number of megabytes that will be used by this data selectionprivate UIManager.ToolbarStyle
getToolbarStylePref
(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 String
getWindowTitleFromSkin
(int index) Get the window title from the skinprotected void
handleMenuDeSelected
(String id, JMenu menu, IdvWindow idvWindow) DeInitialize the given menu before it is shownprotected void
handleMenuSelected
(String id, JMenu menu, IdvWindow idvWindow) Initialize the given menu before it is shownvoid
handleWindowActivated
(IdvWindow window) private void
initDisplayShortcuts
(IdvWindow window) Add all the show window keyboard shortcuts.void
initDone()
void
initHelpTips
(boolean checkPrefs) protected void
initializeDisplayMenu
(JMenu displayMenu) Overridden to build a custom Display menu.void
Create the splash screen if neededprivate void
boolean
isMac()
Deprecated.private static boolean
isValidIdvAction
(Element element) Attempts to verify thatelement
represents a "valid" IDV action.void
killOldDisplays
(List<IdvComponentHolder> oldHolders, List<IdvWindow> oldWindows, boolean merge) Removes data and displays that existed prior to loading a bundle.void
Override 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.void
makeBundledDisplays
(WindowInfo info, boolean merge, boolean mergeLayers, boolean fromCollab) Uses the contents ofinfo
to rebuild a display that has been bundled.void
makeBundleMenu
(JMenu inBundleMenu) Populate a menu with bundles known to thePersistenceManager
.private JMenuItem
void
makeDefaultLayoutMenu
(JMenu menu) void
makeDeleteViewsMenu
(JMenu menu) Overridden by McIDAS-V to add menu scrolling functionality to the "delete" submenu.void
makeFormulasMenu
(JMenu menu) Add in the dynamic menu for displaying formulasstatic JMenu
private final ActionListener
private final MenuListener
makeMenuBarListener
(String id, JMenu menu, IdvWindow idvWindow) static JMenuItem
makeMenuItem
(String label, Object obj, String method, Object arg) private void
makeTabNavigationMenu
(JMenu menu) Add tab navigationJMenuItems
to the givenmenu
.protected static String
Make a window title.protected static String
Make a window title.void
makeViewStateMenu
(JMenu menu, ViewManager vm) void
makeWindowsMenu
(JMenu windowMenu, IdvWindow idvWindow) Overridden to build a custom Window menu.private void
mergeLayers
(WindowInfo info, IdvWindow window, boolean fromCollab) private void
populateToolbar
(JToolBar toolbar) Uses the cached XML to create a toolbar.void
processBundle
(SavedBundle bundle) Handle loading the givenSavedBundle
.void
Handle (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 givenViewManager
from itsComponentHolder
.selectUserChoices
(String msg, List userOperands) void
Uses a given toolbar editor to repopulate all toolbars so that they correspond to the user's choice of actions.private void
setDashboard
(IdvWindow window) Setsdashboard
towindow
.void
setViewManagerHolder
(ViewManager vm, ComponentHolder holder) Associates a given ViewManager with a given ComponentHolder.void
Overridden to keep the dashboard around after it's initially created.void
showDashboard
(String tabName) Method to do the work of showing the Data Explorer (nee Dashboard).boolean
Attempts to locate and display a dashboard component using an ID.protected void
Show Bruce's display selector widget.void
Create (if null) and show the HelpTipDialogvoid
showSupportForm
(String description, String stackTrace, JDialog dialog) Show the support request formprivate void
showSupportFormInThread
(String description, String stackTrace, JDialog dialog) Show the support request form in a non-swing thread.void
Close and dispose of the splash window (if it has been created).void
Show a message in the splash screen (if it exists)protected static String[]
splitTitle
(String title) Split window title usingTITLE_SEPARATOR
.boolean
unpersistComponentGroups
(WindowInfo info, McvComponentGroup group) Attempts to add all component holders ininfo
togroup
.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.void
Writes 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, doMakeBasicWindows, 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, 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, viewManagerDestroyed
Methods 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, waitUntilDisplaysAreDone
Methods 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:
createNewWindow
in classIdvUIManager
-
buildDefaultSkin
Create the display window described by McIDAS-V's default display skin- Returns:
IdvWindow
that 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
Setsdashboard
towindow
. This method also adds some listeners towindow
so that the state of the dashboard is automatically saved.- Parameters:
window
- The dashboard. Nothing happens ifdashboard
has already been set, or this parameter isnull
.
-
unpersistComponentGroups
Attempts to add all component holders ininfo
togroup
. 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:
loadLookAndFeel
in 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:
handleWindowActivated
in 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:
unpersistWindowInfo
in 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
info
to rebuild a display that has been bundled. Ifmerge
is 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'sStateManager
instantiation ofMacBridge
. McIDAS-V uses different approaches for OS X compatibility.- Overrides:
isMac
in classIdvUIManager
- Returns:
- Always returns
false
.
-
about
- Overrides:
about
in 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:
actionPerformed
in interfaceActionListener
- Overrides:
actionPerformed
in 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,defaultStyle
is used.- Parameters:
defaultStyle
-ToolbarStyle
to use if there was no value associated with the toolbar style preference.- Returns:
- The preferred
ToolbarStyle
ordefaultStyle
. - Throws:
AssertionError
- ifPROP_ICON_SIZE
had 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:
doMakeStatusBar
in classIdvUIManager
-
doMakeRovingProgressBar
Make the roving progress bar- Overrides:
doMakeRovingProgressBar
in 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:
getToolbarUI
in classIdvUIManager
- Returns:
- A new toolbar based on the contents of toolbar.xml.
-
doMakeToolbar
Return a McV-style toolbar to the IDV.- Overrides:
doMakeToolbar
in 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:
processBundle
in 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
actionId
or the default "missing icon" icon. - Throws:
NullPointerException
- ifactionId
is null.
-
getCachedActions
Returns the knownUIManager.IdvAction
s in the form ofUIManager.IdvActions
.- Returns:
idvActions
-
getCachedButtons
Returns the actions that currently make up the McIDAS-V toolbar.- Returns:
List
ofUIManager.ActionAttribute.ID
s 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:
makeActionMenu
in classIdvUIManager
- Parameters:
obj
- Object to call.method
- Method to call.makeCall
- iftrue
, callIntegratedDataViewer.handleAction(String)
.- Returns:
- List of
JMenu
s 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:
getActions
in classIdvUIManager
- Returns:
List
ofString
s that correspond toIdvActions
.
-
getActionNode
Looks for the XMLElement
representation 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:
getActionNode
in classIdvUIManager
- Parameters:
actionId
- ID of the action whose "action node" is desired. Cannot benull
.- Returns:
- "action node" associated with
actionId
. - Throws:
NullPointerException
- ifactionId
isnull
.
-
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:
getActionAttr
in 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
- ifactionId
orattr
isnull
.
-
isValidIdvAction
Attempts to verify thatelement
represents a "valid" IDV action.- Parameters:
element
-Element
to check.null
values permitted, but they returnfalse
.- Returns:
true
ifelement
had all requiredUIManager.ActionAttribute
s.false
otherwise, or ifelement
isnull
.
-
actionElementToMap
Builds aMap
ofUIManager.ActionAttribute
s to values for a givenElement
. Ifelement
does not contain an optional attribute, use the attribute's default value.- Parameters:
element
- "Action node" of interest.null
permitted, but results in an emptyMap
.- Returns:
- Mapping of
ActionAttribute
s to values, or an emptyMap
ifelement
isnull
.
-
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
,invalid @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:
initDone
in classIdvUIManager
-
asyncStateCheck
Checks for newest version asynchronously Issue #2740 -
initSplash
Create the splash screen if needed- Overrides:
initSplash
in classIdvUIManager
-
initHelpTips
- Overrides:
initHelpTips
in classIdvUIManager
-
closeHelpTips
If created, close the HelpTipDialog window.- Overrides:
closeHelpTips
in classIdvUIManager
-
showHelpTips
Create (if null) and show the HelpTipDialog- Overrides:
showHelpTips
in 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:
makeWindowsMenu
in 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
null
or theComponentHolder
.
-
removeViewManagerHolder
Disassociate a givenViewManager
from itsComponentHolder
.- Parameters:
vm
-ViewManager
to 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:
showDashboard
in classIdvUIManager
- See Also:
-
doMakeViewPanel
Creates theMcIDASVViewPanel
component that shows up in the dashboard.- Overrides:
doMakeViewPanel
in 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.
-
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 emptyString
values will not change the active tab.
-
getDashboardWindow
Search through list ofIdvWindows
and return the "Data Explorer", if it exists.- Returns:
- "Data Explorer" window or
null
if it does not exist.
-
showSupportForm
Show the support request form- Overrides:
showSupportForm
in 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
id
corresponds to a component. False otherwise.
-
splashClose
Close and dispose of the splash window (if it has been created).- Overrides:
splashClose
in classIdvUIManager
-
splashMsg
Show a message in the splash screen (if it exists)- Overrides:
splashMsg
in 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:
displayTemplatesChanged
in 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:
favoriteBundlesChanged
in 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:
doMakeIdvXmlUi
in classIdvUIManager
-
handleMenuDeSelected
DeInitialize the given menu before it is shown- Overrides:
handleMenuDeSelected
in classIdvUIManager
- See Also:
-
handleMenuSelected
Initialize the given menu before it is shown- Overrides:
handleMenuSelected
in classIdvUIManager
- See Also:
-
selectUserChoices
- Overrides:
selectUserChoices
in classIdvUIManager
-
makeDefaultLayoutMenu
-
makeViewStateMenu
Bundles any compatibleViewManager
states intoJMenuItem
and adds said menu items tomenu
. Incompatible states are ignored.Each
JMenuItem
(except those under the "Delete" menu--apologies) associates a "view state" and anObjectListener
. TheObjectListener
uses 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:
makeViewStateMenu
in classIdvUIManager
- Parameters:
menu
- Menu to populate. Should not benull
.vm
-ViewManager
that might get reinitialized. Should not benull
.- See Also:
-
makeDeleteViewsMenu
Overridden by McIDAS-V to add menu scrolling functionality to the "delete" submenu.- Overrides:
makeDeleteViewsMenu
in classIdvUIManager
- Parameters:
menu
- "Delete" submenu.
-
filterVMMStatesWithVM
Returns a list ofTwoFacedObject
s that are known to be compatible withvm
.This method is currently capable of dealing with
TwoFacedObjects
andViewStates
withinstates
. Any other types are ignored.- Parameters:
vm
-ViewManager
to use for compatibility tests.null
is allowed.states
- Collection of objects to test againstvm
.null
is allowed.- Returns:
- Either a
List
of compatible "view states" or an emptyList
. - See Also:
-
initializeDisplayMenu
Overridden to build a custom Display menu.- Overrides:
initializeDisplayMenu
in classIdvUIManager
- See Also:
-
getWindowTitleFromSkin
Get the window title from the skin- Parameters:
index
- the skin index- Returns:
- the title
-
getMenuIds
- Overrides:
getMenuIds
in classIdvUIManager
-
doMakeMenuBar
- Overrides:
doMakeMenuBar
in 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:
processDialog
in 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
DataSelection
withindcd
.
-
McIDASV.isMac()
instead.