public class UIManager extends IdvUIManager implements ActionListener
Derive our own UI manager to do some specific things:
Modifier and Type | Class and Description |
---|---|
protected static class |
UIManager.ActionAttribute
Represents what McIDAS-V "knows" about IDV actions.
|
private class |
UIManager.BundleTreeNode
Represents a SavedBundle as a tree.
|
private static class |
UIManager.FormEntry
A type of
HttpFormEntry that supports line wrapping for
text area entries. |
static class |
UIManager.IdvAction
Represents an individual IDV action.
|
static class |
UIManager.IdvActions
Represents the set of known
IdvActions in an idiom
that can be easily used by both the IDV and McIDAS-V. |
private class |
UIManager.NextDisplayAction |
private class |
UIManager.PopupListener
Handle mouse clicks that occur within the toolbar.
|
private class |
UIManager.PrevDisplayAction |
private class |
UIManager.ShowDisplayAction |
static class |
UIManager.ToolbarStyle
A
ToolbarStyle is a representation of the way icons associated
with current toolbar actions should be displayed. |
Modifier and Type | Field and Description |
---|---|
private static String |
ACT_ICON_TYPE
Action command for manipulating the size of the toolbar icons.
|
private static String |
ACT_REMOVE_DISPLAYS
Action command for removing all displays
|
private static String |
ACT_SHOW_DASHBOARD
Action command for showing the dashboard
|
private static String |
ACT_SHOW_DATASELECTOR
Action command for showing the dashboard
|
private static String |
ACT_SHOW_DISPLAYCONTROLLER
Action command for showing the dashboard
|
private static String |
ACT_SHOW_PREF
Action command for displaying the toolbar preference tab.
|
private static String |
BAD_ACTION_MSG
Message shown when an unknown action is in the toolbar.
|
private List<String> |
cachedButtons
The currently "displayed" actions.
|
private int |
componentGroupCount |
private int |
componentHolderCount |
private UIManager.ToolbarStyle |
currentToolbarStyle
Current representation of toolbar actions.
|
protected IdvWindow |
dashboard
Keep the dashboard around so we don't have to re-create it each time.
|
private boolean |
didInitActions
Whether or not the list of available actions has been initialized.
|
private boolean |
didNewWindow |
private boolean |
didTabs |
private McvHelpTipDialog |
helpTipDialog
THe help tip dialog
|
private int |
holderCount |
private IntegratedDataViewer |
idv
IDV instantiation--nice to keep around to reduce getIdv() calls.
|
private UIManager.IdvActions |
idvActions
Stores all available actions.
|
protected boolean |
initDone
False until
initDone() . |
private static String |
LBL_TB_EDITOR
Label for the "link" to the toolbar customization preference tab.
|
private static org.slf4j.Logger |
logger |
static String |
MENU_NEWDISPLAY_TAB
Id of the "New Display Tab" menu item for the file menu
|
static String |
MENU_NEWVIEWS
Menu ID for the "Restore Saved Views" submenu.
|
private Hashtable<String,JMenuItem> |
menuIds
Maps menu IDs to
JMenu s. |
private UIManager.NextDisplayAction |
nextDisplayAction
Key combo for moving to the next display relative to the current.
|
private Map |
operandCache
A cache of the operand name to value for the user choices
|
private UIManager.PrevDisplayAction |
prevDisplayAction
Key combo for moving to the previous display relative to the current.
|
private static String |
PROP_ICON_SIZE
The IDV property that reflects the size of the icons.
|
private static String |
PROP_KB_DISPLAY_NEXT
Key for moving to the next display.
|
private static String |
PROP_KB_DISPLAY_PREV
Key for moving to the previous display.
|
private static String |
PROP_KB_MODIFIER
Modifier key, like "control" or "shift".
|
private static String |
PROP_KB_SELECT_DISPLAY
Key that pops up the list of displays.
|
private static String |
PROP_KB_SHOW_DASHBOARD
Key for showing the dashboard.
|
static String |
PROP_WRAP_SUPPORT_DESC
Property name for whether or not the description field of the support
form should perform line wrapping.
|
static HashMap<String,ViewManager> |
savedViewManagers
Used to keep track of ViewManagers inside a bundle.
|
private UIManager.ShowDisplayAction |
showDisplayAction
Key combo for the popup with list of displays.
|
private Map<String,Integer> |
skinIds
Map of skin ids to their skin resource index.
|
private Map<Integer,String> |
skinToTitle
Cache for the results of
getWindowTitleFromSkin(int) . |
private McvSplash |
splash
The splash screen (minus easter egg).
|
private static String |
SUPPORT_REQ_URL
The URL of the script that processes McIDAS-V support requests.
|
static String |
TAG_EXAMPLECHOOSER
The tag in the xml ui for creating the special example chooser
|
protected static String |
TITLE_SEPARATOR
Separator to use between window title components.
|
private MouseListener |
toolbarMenu
Keeping the reference to the toolbar menu mouse listener allows us to
avoid constantly rebuilding the menu.
|
private List<JToolBar> |
toolbars
A list of the toolbars that the IDV is playing with.
|
private Map<ViewManager,ComponentHolder> |
viewManagers
An easy way to figure out who is holding a given ViewManager.
|
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_DATA, MENU_DELETEHISTORY, MENU_DELETEVIEWS, MENU_DISPLAYS, MENU_EDITFORMULAS, MENU_HELP, MENU_HISTORY, 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
contents, dialog, frame, window
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_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 and Description |
---|
UIManager(IntegratedDataViewer idv)
Hands off our IDV instantiation to IdvUiManager.
|
Modifier and Type | Method and Description |
---|---|
void |
about() |
private static Map<UIManager.ActionAttribute,String> |
actionElementToMap(Element element)
|
void |
actionPerformed(ActionEvent e)
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 buffer
|
UIManager.BundleTreeNode |
buildBundleTree(int bundleType)
Builds a tree out of the bundles that should appear within the McV
toolbar.
|
IdvWindow |
buildDefaultSkin()
Create the display window described by McIDAS-V's default display skin
|
IdvWindow |
buildEmptyWindow()
Create 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 |
closeHelpTips()
If created, close the HelpTipDialog window.
|
private MouseListener |
constructToolbarMenu()
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.
|
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.
|
void |
displayTemplatesChanged() |
protected IdvXmlUi |
doMakeIdvXmlUi(IdvWindow window,
List viewManagers,
Element skinRoot) |
JMenuBar |
doMakeMenuBar(IdvWindow idvWindow) |
protected JMenuItem |
doMakeNewDisplayMenu(JMenuItem newDisplayMenu,
boolean inWindow)
Populate a "new display" menu from the available skin list.
|
RovingProgress |
doMakeRovingProgressBar()
Make the roving progress bar
|
JPanel |
doMakeStatusBar(IdvWindow window) |
protected JComponent |
doMakeToolbar()
Return a McV-style toolbar to the IDV.
|
protected ViewPanel |
doMakeViewPanel()
Creates the
McIDASVViewPanel component that shows up in the
dashboard. |
void |
favoriteBundlesChanged()
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 of
TwoFacedObject s that are known to be
compatible with vm . |
private String |
fixSkinPath(String skinPath)
A hack because Unidata moved the skins (taken from
IdvPersistenceManager ). |
String |
getActionAttr(String actionId,
String attr)
Searches for an action identified by a given
actionId , and
returns the value associated with its attr . |
protected Icon |
getActionIcon(String actionId,
UIManager.ToolbarStyle style)
Returns the icon associated with
actionId . |
Element |
getActionNode(String actionId)
Looks for the XML
Element representation of the action
associated with actionId . |
List<String> |
getActions()
Returns the collection of action identifiers.
|
UIManager.IdvActions |
getCachedActions()
Returns the known
UIManager.IdvAction s in the form of UIManager.IdvActions . |
List<String> |
getCachedButtons()
Returns the actions that currently make up the McIDAS-V toolbar.
|
int |
getComponentGroupCount() |
int |
getComponentHolderCount() |
Set<ComponentHolder> |
getComponentHolders() |
JComponent |
getDisplaySelectorComponent() |
protected int |
getEstimatedMegabytes(DataControlDialog dcd)
Estimate the number of megabytes that will be used by this data selection
|
Hashtable |
getMenuIds() |
private UIManager.ToolbarStyle |
getToolbarStylePref(UIManager.ToolbarStyle defaultStyle)
Queries the stored preferences to determine the preferred
UIManager.ToolbarStyle . |
JComponent |
getToolbarUI()
Overrides the IDV's getToolbarUI so that McV can return its own toolbar
and not deal with the way the IDV handles toolbars.
|
ComponentHolder |
getViewManagerHolder(ViewManager vm)
Returns the ComponentHolder containing the given ViewManager.
|
private String |
getWindowTitleFromSkin(int index)
Get the window title from the skin
|
protected void |
handleMenuDeSelected(String id,
JMenu menu,
IdvWindow idvWindow)
DeInitialize the given menu before it is shown
|
protected void |
handleMenuSelected(String id,
JMenu menu,
IdvWindow idvWindow)
Initialize the given menu before it is shown
|
void |
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 |
initSplash()
Create the splash screen if needed
|
private void |
initTabNavActions() |
boolean |
isMac()
Deprecated.
Use
McIDASV.isMac() instead. |
private static boolean |
isValidIdvAction(Element element)
Attempts to verify that
element 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 |
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.
|
List<JMenu> |
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 of
info to rebuild a display that has been
bundled. |
void |
makeBundleMenu(JMenu inBundleMenu)
Populate a menu with bundles known to the
PersistenceManager . |
private JMenuItem |
makeControlDescriptorItem(ControlDescriptor cd) |
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 formulas
|
static JMenu |
makeMenu(String name,
List menuItems) |
private ActionListener |
makeMenuBarActionListener() |
private 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 navigation
JMenuItems to the given
menu . |
protected static String |
makeTitle(String win,
String doc)
Make a window title.
|
protected static String |
makeTitle(String window,
String document,
String other)
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 given
SavedBundle . |
void |
processDialog(DataControlDialog dcd)
Handle (polymorphically) the
DataControlDialog . |
private Map<String,Integer> |
readSkinIds()
Build a mapping of "skin" IDs to their indicies within skin
resources.
|
List<String> |
readToolbar()
Read the contents of the toolbar XML into a List.
|
ComponentHolder |
removeViewManagerHolder(ViewManager vm)
Disassociate a given
ViewManager from its
ComponentHolder . |
List |
selectUserChoices(String msg,
List userOperands) |
void |
setCurrentToolbars(McvToolbarEditor tbe)
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)
Sets
dashboard to window . |
void |
setViewManagerHolder(ViewManager vm,
ComponentHolder holder)
Associates a given ViewManager with a given ComponentHolder.
|
void |
showDashboard()
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 |
showDashboardComponent(String id)
Attempts to locate and display a dashboard component using an ID.
|
protected void |
showDisplaySelector()
Show Bruce's display selector widget.
|
void |
showHelpTips()
Create (if null) and show the HelpTipDialog
|
void |
showSupportForm(String description,
String stackTrace,
JDialog dialog)
Show the support request form
|
private void |
showSupportFormInThread(String description,
String stackTrace,
JDialog dialog)
Show the support request form in a non-swing thread.
|
void |
splashClose()
Close and dispose of the splash window (if it has been created).
|
void |
splashMsg(String m)
Show a message in the splash screen (if it exists)
|
protected static String[] |
splitTitle(String title)
Split window title using
TITLE_SEPARATOR . |
boolean |
unpersistComponentGroups(WindowInfo info,
McvComponentGroup group)
Attempts to add all component holders in
info to
group . |
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 |
writeToolbar()
Writes the currently displayed toolbar buttons to the toolbar XML.
|
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, init, initDataSourceHolder, initDataTree, 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
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
close, doMakeContents, getContents, getDialog, getWindow, getWindowTitle, isShowing, removeAll, setMenuBar, setWindowTitle, shouldMakeDialog, show, show, showModal, toFront, windowIsClosing
private static final org.slf4j.Logger logger
public static final String MENU_NEWDISPLAY_TAB
public static final String TAG_EXAMPLECHOOSER
public static final HashMap<String,ViewManager> savedViewManagers
public static final String PROP_WRAP_SUPPORT_DESC
private static final String ACT_ICON_TYPE
private static final String ACT_REMOVE_DISPLAYS
private static final String ACT_SHOW_DASHBOARD
private static final String ACT_SHOW_DATASELECTOR
private static final String ACT_SHOW_DISPLAYCONTROLLER
private static final String ACT_SHOW_PREF
private static final String BAD_ACTION_MSG
public static final String MENU_NEWVIEWS
private static final String LBL_TB_EDITOR
private UIManager.ToolbarStyle currentToolbarStyle
private static final String PROP_ICON_SIZE
private static final String SUPPORT_REQ_URL
protected static final String TITLE_SEPARATOR
private List<String> cachedButtons
private final UIManager.IdvActions idvActions
private Map<ViewManager,ComponentHolder> viewManagers
private int componentHolderCount
private int componentGroupCount
private final Map<Integer,String> skinToTitle
getWindowTitleFromSkin(int)
.private List<JToolBar> toolbars
private MouseListener toolbarMenu
protected IdvWindow dashboard
protected boolean initDone
initDone()
.private IntegratedDataViewer idv
private McvHelpTipDialog helpTipDialog
private boolean didInitActions
private UIManager.ShowDisplayAction showDisplayAction
private UIManager.PrevDisplayAction prevDisplayAction
private UIManager.NextDisplayAction nextDisplayAction
private static final String PROP_KB_MODIFIER
private static final String PROP_KB_SELECT_DISPLAY
PROP_KB_MODIFIER
.private static final String PROP_KB_DISPLAY_PREV
PROP_KB_MODIFIER
.private static final String PROP_KB_DISPLAY_NEXT
PROP_KB_MODIFIER
.private static final String PROP_KB_SHOW_DASHBOARD
PROP_KB_MODIFIER
.private int holderCount
private Map operandCache
private boolean didTabs
private boolean didNewWindow
public UIManager(IntegratedDataViewer idv)
idv
- The idvpublic IdvWindow createNewWindow(List viewManagers, boolean notifyCollab, String title, String skinPath, Element skinRoot, boolean show, WindowInfo windowInfo)
createNewWindow
in class IdvUIManager
public IdvWindow buildDefaultSkin()
IdvWindow
that was created.public IdvWindow buildEmptyWindow()
private void setDashboard(IdvWindow window)
dashboard
to window
. This method also adds some
listeners to window
so that the state of the dashboard is
automatically saved.window
- The dashboard. Nothing happens if dashboard
has
already been set, or this parameter is null
.public boolean unpersistComponentGroups(WindowInfo info, McvComponentGroup group)
info
to
group
. Especially useful when unpersisting a bundle and
attempting to deal with its component groups.info
- The window we want to process.group
- Receives the holders in info
.info
.public void loadLookAndFeel()
loadLookAndFeel
in class IdvUIManager
public void handleWindowActivated(IdvWindow window)
handleWindowActivated
in class IdvUIManager
public void unpersistWindowInfo(List windows, List newViewManagers, boolean okToMerge, boolean fromCollab, boolean didRemoveAll)
unpersistWindowInfo
in class IdvUIManager
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?IdvUIManager.unpersistWindowInfo(List, List, boolean, boolean,
boolean)
public void killOldDisplays(List<IdvComponentHolder> oldHolders, List<IdvWindow> oldWindows, boolean merge)
oldHolders
- Component holders around before loading.oldWindows
- Windows around before loading.merge
- Were the bundle contents merged into an existing window?private String fixSkinPath(String skinPath)
IdvPersistenceManager
).skinPath
- original pathpublic void makeBundledDisplays(WindowInfo info, boolean merge, boolean mergeLayers, boolean fromCollab)
Uses the contents of info
to rebuild a display that has been
bundled. If merge
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.
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.private void mergeLayers(WindowInfo info, IdvWindow window, boolean fromCollab)
protected static String makeTitle(String win, String doc)
win
- Window title.doc
- Document or window sub-content.protected static String makeTitle(String window, String document, String other)
<window>TITLE_SEPARATOR<document>TITLE_SEPARATOR<other>
window
- Window title.document
- Document or window sub content.other
- Other content to include.protected static String[] splitTitle(String title)
TITLE_SEPARATOR
.title
- The window title to splitpublic boolean isMac()
McIDASV.isMac()
instead.StateManager
instantiation of MacBridge
.
McIDAS-V uses different approaches for OS X compatibility.isMac
in class IdvUIManager
false
.public void about()
about
in class IdvUIManager
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
actionPerformed
in class WindowHolder
e
- The event that triggered the call to this method.public JComponent getDisplaySelectorComponent()
private MouseListener constructToolbarMenu()
private UIManager.ToolbarStyle getToolbarStylePref(UIManager.ToolbarStyle defaultStyle)
UIManager.ToolbarStyle
. If there was no preference, defaultStyle
is used.defaultStyle
- ToolbarStyle
to use if there was no value
associated with the toolbar style preference.ToolbarStyle
or defaultStyle
.AssertionError
- if PROP_ICON_SIZE
had returned an integer
value that did not correspond to a valid ToolbarStyle
.private JButton buildToolbarButton(String action)
action
- The action whose corresponding icon we want.public JPanel doMakeStatusBar(IdvWindow window)
doMakeStatusBar
in class IdvUIManager
public RovingProgress doMakeRovingProgressBar()
doMakeRovingProgressBar
in class IdvUIManager
public JComponent getToolbarUI()
Not that the IDV code is bad of course--I just can't handle that pause while the toolbar is rebuilt!
getToolbarUI
in class IdvUIManager
protected JComponent doMakeToolbar()
doMakeToolbar
in class IdvUIManager
private void populateToolbar(JToolBar toolbar)
toolbar
- A reference to the toolbar that needs buttons and stuff.private void addBundle(JToolBar toolbar, UIManager.BundleTreeNode node)
toolbar
- Toolbar to which we add the bundle.node
- Node within the bundle tree that contains our bundle.public void processBundle(SavedBundle bundle)
SavedBundle
.
Overridden in McIDAS-V to allow "default" bundles to show the same bundle loading dialog as a "favorite" bundle.
processBundle
in class IdvUIManager
bundle
- Bundle to process. Cannot be null
.private void addBundleTree(JToolBar toolbar, UIManager.BundleTreeNode node)
"First-level" means the given node is a child of the root node.
toolbar
- Toolbar to which we add the bundle tree.node
- Node we want to add.public void writeToolbar()
public List<String> readToolbar()
null
, this element represents a "space"
that should appear in both the Toolbar and the Toolbar Preferences.protected Icon getActionIcon(String actionId, UIManager.ToolbarStyle style)
actionId
. Note that associating
the "missing icon" icon with an action is allowable.actionId
- Action ID whose associated icon is to be returned.style
- Returned icon's size will be the size associated with the
specified ToolbarStyle
.actionId
or the default
"missing icon" icon.NullPointerException
- if actionId
is null.public UIManager.IdvActions getCachedActions()
UIManager.IdvAction
s in the form of UIManager.IdvActions
.idvActions
public List<String> getCachedButtons()
List
of UIManager.ActionAttribute.ID
s that make up the
current toolbar buttons.public List<JMenu> makeActionMenu(Object obj, String method, boolean makeCall)
Overridden in McIDAS-V so that we can fool the IDV into working with our icons that allow for multiple "styles".
makeActionMenu
in class IdvUIManager
obj
- Object to call.method
- Method to call.makeCall
- if true
, call
IntegratedDataViewer.handleAction(String)
.JMenu
s that represent our action menus.public static JMenuItem makeMenuItem(String label, Object obj, String method, Object arg)
public List<String> getActions()
Overridden in McIDAS-V so that we can fool the IDV into working with our icons that allow for multiple "styles".
getActions
in class IdvUIManager
List
of String
s that correspond to
IdvActions
.public Element getActionNode(String actionId)
Element
representation of the action
associated with actionId
.
Overridden in McIDAS-V so that we can fool the IDV into working with our icons that allow for multiple "styles".
getActionNode
in class IdvUIManager
actionId
- ID of the action whose "action node" is desired. Cannot be null
.actionId
.NullPointerException
- if actionId
is null
.public String getActionAttr(String actionId, String attr)
actionId
, and
returns the value associated with its attr
.
Overridden in McIDAS-V so that we can fool the IDV into working with our icons that allow for multiple "styles".
getActionAttr
in class IdvUIManager
actionId
- ID of the action whose attribute value is desired. Cannot be null
.attr
- The attribute whose value is desired. Cannot be null
.NullPointerException
- if actionId
or attr
is null
.private static boolean isValidIdvAction(Element element)
element
represents a "valid"
IDV action.element
- Element
to check. null
values permitted,
but they return false
.true
if element
had all required
UIManager.ActionAttribute
s. false
otherwise, or if
element
is null
.private static Map<UIManager.ActionAttribute,String> actionElementToMap(Element element)
Map
of UIManager.ActionAttribute
s to values for a given
Element
. If element
does not contain an optional attribute,
use the attribute's default value.element
- "Action node" of interest. null
permitted, but results in an empty Map
.ActionAttribute
s to values, or an empty
Map
if element
is null
.public UIManager.BundleTreeNode buildBundleTree(int bundleType)
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.
bundleType
- One of SavedBundle.TYPE_FAVORITE
,
SavedBundle.TYPE_DISPLAY
,
SavedBundle.TYPE_DATA
or
SavedBundle.TYPE_SYSTEM
.private void buildPopupMenu(UIManager.BundleTreeNode node, JComponent comp)
node
- The node that we're trying to use to build the contents.comp
- The component to which we add node contents.public void initDone()
initDone
in class IdvUIManager
public void initSplash()
initSplash
in class IdvUIManager
public void initHelpTips(boolean checkPrefs)
initHelpTips
in class IdvUIManager
public void closeHelpTips()
closeHelpTips
in class IdvUIManager
public void showHelpTips()
showHelpTips
in class IdvUIManager
public void makeBundleMenu(JMenu inBundleMenu)
PersistenceManager
.inBundleMenu
- The menu to populatepublic void makeWindowsMenu(JMenu windowMenu, IdvWindow idvWindow)
makeWindowsMenu
in class IdvUIManager
IdvUIManager.makeWindowsMenu(JMenu, IdvWindow)
private void makeTabNavigationMenu(JMenu menu)
JMenuItems
to the given
menu
.menu
- Menu to which tab navigation menu items should be added.
Cannot be null
.public void makeFormulasMenu(JMenu menu)
menu
- edit menu to add toprivate void initTabNavActions()
private void initDisplayShortcuts(IdvWindow window)
window
- IdvWindow that requires keyboard shortcut capability.protected void showDisplaySelector()
protected JMenuItem doMakeNewDisplayMenu(JMenuItem newDisplayMenu, boolean inWindow)
newDisplayMenu
- menu to populate.inWindow
- Is the skinned display to be created in a window?IdvResourceManager.RSC_SKIN
public void setViewManagerHolder(ViewManager vm, ComponentHolder holder)
vm
- The ViewManager that is inside holder
.holder
- The ComponentHolder that contains vm
.public Set<ComponentHolder> getComponentHolders()
public int getComponentHolderCount()
public int getComponentGroupCount()
public ComponentHolder getViewManagerHolder(ViewManager vm)
vm
- The ViewManager whose ComponentHolder is needed.null
or the ComponentHolder
.public ComponentHolder removeViewManagerHolder(ViewManager vm)
ViewManager
from its
ComponentHolder
.vm
- ViewManager
to disassociate.ComponentHolder
.public void showDashboard()
showDashboard
in class IdvUIManager
IdvUIManager.showDashboard()
protected ViewPanel doMakeViewPanel()
McIDASVViewPanel
component that shows up in the
dashboard.doMakeViewPanel
in class IdvUIManager
private Map<String,Integer> readSkinIds()
public void createNewTab(String skinId)
skinId
- The value of the skin's skinid attribute.public void showDashboard(String tabName)
tabName
- Name of the tab that should be made active.
Cannot be null
, but empty String
values
will not change the active tab.public void showSupportForm(String description, String stackTrace, JDialog dialog)
showSupportForm
in class IdvUIManager
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.public boolean showDashboardComponent(String id)
id
- ID of the desired component.id
corresponds to a component. False otherwise.public void splashClose()
splashClose
in class IdvUIManager
public void splashMsg(String m)
splashMsg
in class IdvUIManager
m
- The message to showpublic void setCurrentToolbars(McvToolbarEditor tbe)
tbe
- The toolbar editor that contains the actions the user wants.private void append(StringBuffer sb, String name, Object value)
sb
- StringBuffer to append toname
- Name of the objectvalue
- the object valueprivate JMenuItem makeControlDescriptorItem(ControlDescriptor cd)
public void displayTemplatesChanged()
displayTemplatesChanged
in class IdvUIManager
public void favoriteBundlesChanged()
favoriteBundlesChanged
in class IdvUIManager
private void showSupportFormInThread(String description, String stackTrace, JDialog dialog)
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.protected IdvXmlUi doMakeIdvXmlUi(IdvWindow window, List viewManagers, Element skinRoot)
doMakeIdvXmlUi
in class IdvUIManager
protected void handleMenuDeSelected(String id, JMenu menu, IdvWindow idvWindow)
handleMenuDeSelected
in class IdvUIManager
IdvUIManager.historyMenuSelected(JMenu)
protected void handleMenuSelected(String id, JMenu menu, IdvWindow idvWindow)
handleMenuSelected
in class IdvUIManager
IdvUIManager.historyMenuSelected(JMenu)
public List selectUserChoices(String msg, List userOperands)
selectUserChoices
in class IdvUIManager
public void makeDefaultLayoutMenu(JMenu menu)
public void makeViewStateMenu(JMenu menu, ViewManager vm)
ViewManager
states into
JMenuItem
and adds said menu items to menu
.
Incompatible states are ignored.
Each JMenuItem
(except those under the "Delete"
menu--apologies) associates a "view state" and an
ObjectListener
. The ObjectListener
uses this associated
view state to attempt reinitialization of vm
.
Override reasoning:
filterVMMStatesWithVM(ViewManager, Collection)
to
properly detect the "no saved views" case.
makeViewStateMenu
in class IdvUIManager
menu
- Menu to populate. Should not be null
.vm
- ViewManager
that might get reinitialized.
Should not be null
.ViewManager.initWith(ViewManager, boolean)
,
ViewManager.initWith(ViewState)
public void makeDeleteViewsMenu(JMenu menu)
makeDeleteViewsMenu
in class IdvUIManager
menu
- "Delete" submenu.public static List<TwoFacedObject> filterVMMStatesWithVM(ViewManager vm, Collection<?> states)
TwoFacedObject
s that are known to be
compatible with vm
.
This method is currently capable of dealing with
TwoFacedObjects
and
ViewStates
within states
. Any other types are
ignored.
vm
- ViewManager
to use for compatibility tests.
null
is allowed.states
- Collection of objects to test against vm
.
null
is allowed.List
of compatible "view states"
or an empty List
.ViewManager.isCompatibleWith(ViewManager)
,
ViewManager.isCompatibleWith(ViewState)
,
makeViewStateMenu(JMenu, ViewManager)
protected void initializeDisplayMenu(JMenu displayMenu)
initializeDisplayMenu
in class IdvUIManager
IdvUIManager.initializeDisplayMenu(JMenu)
private String getWindowTitleFromSkin(int index)
index
- the skin indexpublic Hashtable getMenuIds()
getMenuIds
in class IdvUIManager
public JMenuBar doMakeMenuBar(IdvWindow idvWindow)
doMakeMenuBar
in class IdvUIManager
private final ActionListener makeMenuBarActionListener()
private final MenuListener makeMenuBarListener(String id, JMenu menu, IdvWindow idvWindow)
public void processDialog(DataControlDialog dcd)
DataControlDialog
.
This dialog is used to either select a display control to create
or is used to set the timers used for a DataSource
.processDialog
in class IdvUIManager
dcd
- The dialogprotected int getEstimatedMegabytes(DataControlDialog dcd)
dcd
- Data control dialog containing the data selection whose size
we'd like to estimate. Cannot be null
.DataSelection
within dcd
.