|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectucar.unidata.ui.WindowHolder
ucar.unidata.idv.IdvManager
ucar.unidata.idv.ui.IdvUIManager
edu.wisc.ssec.mcidasv.ui.UIManager
public class UIManager
Derive our own UI manager to do some specific things:
Nested Class Summary | |
---|---|
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 UIManager.IdvAction s 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. |
Field Summary | |
---|---|
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 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. |
Fields inherited from class ucar.unidata.ui.WindowHolder |
---|
contents, dialog, frame, window |
Constructor Summary | |
---|---|
UIManager(IntegratedDataViewer idv)
Hands off our IDV instantiation to IdvUiManager. |
Method Summary | |
---|---|
void |
about()
|
private static Map<UIManager.ActionAttribute,String> |
actionElementToMap(Element element)
Builds a Map of UIManager.ActionAttribute s to values for a given
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()
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 McVViewPanel component that shows up in the dashboard. |
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 |
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)
|
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)
Bundles any compatible ViewManager states into JMenuItem s
and adds said JMenuItem s to menu . |
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 |
processDialog(DataControlDialog dcd)
Handle (polymorphically) the DataControlDialog . |
private Map<String,Integer> |
readSkinIds()
|
List<String> |
readToolbar()
Read the contents of the toolbar XML into a List. |
ComponentHolder |
removeViewManagerHolder(ViewManager vm)
Disassociate a given ViewManager from its ComponentHolder. |
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. |
Methods inherited from class ucar.unidata.ui.WindowHolder |
---|
close, doMakeContents, getContents, getDialog, getWindow, getWindowTitle, isShowing, removeAll, setMenuBar, setWindowTitle, shouldMakeDialog, show, show, showModal, toFront, windowIsClosing |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
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.
private final UIManager.IdvActions idvActions
private Map<String,Integer> skinIds
private Map<ViewManager,ComponentHolder> viewManagers
private int componentHolderCount
private int componentGroupCount
private final Map<Integer,String> skinToTitle
getWindowTitleFromSkin(int)
.
private Hashtable<String,JMenuItem> menuIds
JMenu
s.
private McvSplash splash
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 boolean didTabs
private boolean didNewWindow
Constructor Detail |
---|
public UIManager(IntegratedDataViewer idv)
idv
- The idvMethod Detail |
---|
public 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)
Attempts to add all component holders in 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)
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.
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)
Removes data and displays that existed prior to loading a bundle.
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 path
public 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?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 split
public 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()
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!
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
- The toolbar to which we add the bundle.node
- The node within the bundle tree that contains our bundle.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. The button is then added to the given toolbar.
"First-level" means the given node is a child of the root node.
toolbar
- The toolbar to which we add the bundle tree.node
- The node we want to add! OMG like duh!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)
MenuUtil.makeMenuItem(String, Object, String, Object)
public static JMenu makeMenu(String name, List menuItems)
MenuUtil.makeMenu(String, List)
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
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()
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.
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)
inBundleMenu
- The menu to populatepublic void makeWindowsMenu(JMenu windowMenu, IdvWindow idvWindow)
makeWindowsMenu
in class IdvUIManager
IdvUIManager.makeWindowsMenu(JMenu, IdvWindow)
private void makeTabNavigationMenu(JMenu menu)
menu
- 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.
public ComponentHolder removeViewManagerHolder(ViewManager vm)
public void showDashboard()
showDashboard
in class IdvUIManager
IdvUIManager.showDashboard()
protected ViewPanel doMakeViewPanel()
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)
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)
Uses a given toolbar editor to repopulate all toolbars so that they correspond to the user's choice of actions.
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
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 void makeDefaultLayoutMenu(JMenu menu)
public void makeViewStateMenu(JMenu menu, ViewManager vm)
ViewManager
states into JMenuItem
s
and adds said JMenuItem
s 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)
,
IdvUIManager.makeViewStateMenu(JMenu, ViewManager)
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 TwoFacedObject
s and
ViewState
s 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 index
public 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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |