edu.wisc.ssec.mcidasv.ui
Class McIDASVXmlUi

java.lang.Object
  extended by ucar.unidata.ui.XmlUi
      extended by ucar.unidata.idv.ui.IdvXmlUi
          extended by edu.wisc.ssec.mcidasv.ui.McIDASVXmlUi
All Implemented Interfaces:
ActionListener, ItemListener, EventListener

public class McIDASVXmlUi
extends IdvXmlUi

McIDAS-V mostly extends this class to preempt the IDV. McIDAS-V needs to control some HTML processing, ensure that McvComponentGroups and McvComponentHolders are created, and handle some special problems that occur when attempting to load bundles that do not contain component groups.


Nested Class Summary
 
Nested classes/interfaces inherited from class ucar.unidata.ui.XmlUi
XmlUi.ActionHandler, XmlUi.CardPanel
 
Field Summary
private  Map<String,Element> idToElement
          Maps an ID to an Element.
private  IntegratedDataViewer idv
          Avoids unneeded getIdv() calls.
private  IdvWindow window
          Keep around a reference to the window we were built for, useful for associated component groups with the appropriate window.
 
Fields inherited from class ucar.unidata.ui.XmlUi
ACTION_MENUPOPUP, ACTION_SETBORDER, ACTION_SETTEXT, ACTION_UI_FLIP, ACTION_UI_FOCUS, ACTION_UI_GROUP_NEXT, ACTION_UI_GROUP_PREV, ALIGN_NAMES, ALIGN_VALUES, ANCHOR_NAMES, ANCHOR_VALUES, ATTR_ACTION, ATTR_ACTIONTEMPLATE, ATTR_ALIGN, ATTR_ANCHOR, ATTR_BGCOLOR, ATTR_BORDER, ATTR_BORDER_BOTTOM, ATTR_BORDER_COLOR, ATTR_BORDER_HINSET, ATTR_BORDER_INSET, ATTR_BORDER_LEFT, ATTR_BORDER_RIGHT, ATTR_BORDER_THICKNESS, ATTR_BORDER_TITLE, ATTR_BORDER_TOP, ATTR_BORDER_VINSET, ATTR_BSPACE, ATTR_CATEGORY, ATTR_CATEGORYCOMPONENT, ATTR_CLASS, ATTR_COLS, ATTR_COLWIDTHS, ATTR_CONTINUOUS, ATTR_DEFAULT, ATTR_DIVIDER, ATTR_DOWNIMAGE, ATTR_EDITABLE, ATTR_EVENT, ATTR_FGCOLOR, ATTR_FILL, ATTR_FLOAT, ATTR_FONTFACE, ATTR_FONTSIZE, ATTR_FONTSTYLE, ATTR_GROUP, ATTR_HEIGHT, ATTR_HPOSITION, ATTR_HSCROLL, ATTR_HSPACE, ATTR_ICON, ATTR_ID, ATTR_IDREF, ATTR_IMAGE, ATTR_IMAGEHEIGHT, ATTR_IMAGEWIDTH, ATTR_KEYPRESS, ATTR_LABEL, ATTR_LAYOUT, ATTR_LSPACE, ATTR_MARGIN, ATTR_MNEMONIC, ATTR_MOUSE_CLICK, ATTR_MOUSE_ENTER, ATTR_MOUSE_EXIT, ATTR_NAME, ATTR_ONETOUCHEXPANDABLE, ATTR_ORIENTATION, ATTR_OVERIMAGE, ATTR_PLACE, ATTR_PREF_HEIGHT, ATTR_PREF_WIDTH, ATTR_RESIZEWEIGHT, ATTR_ROWHEIGHTS, ATTR_ROWS, ATTR_RSPACE, ATTR_SELECTIMAGE, ATTR_SPACE, ATTR_TABBORDERBOTTOM, ATTR_TABBORDERLEFT, ATTR_TABBORDERRIGHT, ATTR_TABBORDERTOP, ATTR_TABINSETS, ATTR_TABNESTED, ATTR_TABPAD, ATTR_TABPLACE, ATTR_TABTOOLTIP, ATTR_TAGCLASS, ATTR_TEMPLATE, ATTR_TEXT, ATTR_TITLE, ATTR_TOOLTIP, ATTR_TREEWIDTH, ATTR_TSPACE, ATTR_URL, ATTR_USESPLITPANE, ATTR_VALUE, ATTR_VPOSITION, ATTR_VSCROLL, ATTR_VSPACE, ATTR_WIDTH, ATTR_X, ATTR_Y, BORDER_BEVEL, BORDER_BEVEL_LOWERED, BORDER_BEVEL_RAISED, BORDER_BUTTON, BORDER_EMPTY, BORDER_ETCHED, BORDER_ETCHED_LOWERED, BORDER_ETCHED_RAISED, BORDER_LINE, BORDER_MATTE, BORDER_TITLED, FILL_NAMES, FILL_VALUES, FLOWLAYOUT_NAMES, FLOWLAYOUT_VALUES, HPOS_NAMES, HPOS_VALUES, HSCROLL_VALUES, LAYOUT_BORDER, LAYOUT_CARD, LAYOUT_FLOW, LAYOUT_GRAPHPAPER, LAYOUT_GRID, LAYOUT_GRIDBAG, LAYOUT_INSET, LAYOUT_WRAP, NOVALUE, NULLSTRING, properties, SCROLL_NAMES, SPLITPANE_NAMES, SPLITPANE_VALUES, TABPLACE_NAMES, TABPLACE_VALUES, TAG_BUTTON, TAG_BUTTONTABBEDPANE, TAG_CARDPANEL, TAG_CHECKBOX, TAG_COMBOBOX, TAG_COMPONENT, TAG_COMPONENTS, TAG_FILLER, TAG_HTML, TAG_IMAGE, TAG_IMPORT, TAG_ITEM, TAG_LABEL, TAG_MENU, TAG_MENUBAR, TAG_MENUITEM, TAG_MENUPOPUP, TAG_PANEL, TAG_PROPERTIES, TAG_PROPERTY, TAG_RADIO, TAG_SCROLLER, TAG_SEPARATOR, TAG_SKIN, TAG_SPLITPANE, TAG_STYLE, TAG_STYLES, TAG_TABBEDPANE, TAG_TEXTINPUT, TAG_TOGGLEBUTTON, TAG_TOOLBAR, TAG_TREEPANEL, TAG_UI, TOOLBAR_NAMES, TOOLBAR_VALUES, VPOS_NAMES, VPOS_VALUES, VSCROLL_VALUES
 
Constructor Summary
McIDASVXmlUi(IdvWindow window, List viewManagers, IntegratedDataViewer idv, Element root)
           
McIDASVXmlUi(IntegratedDataViewer idv, Element root)
           
 
Method Summary
 void addComponent(String id, Element component)
          Add the component
 Component createComponent(Element node, String id)
           McIDAS-V overrides this so that it can seize control of some HTML processing in addition to attempting to associate newly-created ViewManagers with ViewManagers found in a bundle.
private  TreePanel createTreePanel(Element node, String id)
           
private  ViewManager createViewManager(Element node)
           Attempts to build a ViewManager based upon node.
private static String decodeHtml(String text)
          Convert the &gt; and &lt; entities to > and <.
private  Element getReffedNode(Element node)
          The xml nodes can contain an idref field.
protected  IdvComponentGroup makeComponentGroup(Element node)
           Overridden so that any attempts to generate IdvComponentGroups or IdvComponentHolders will return the respective McIDAS-V equivalents.
 
Methods inherited from class ucar.unidata.idv.ui.IdvXmlUi
dispose, getBorder, getViewManager, getViewManagers, processToolbarXml
 
Methods inherited from class ucar.unidata.ui.XmlUi
actionPerformed, addComponent, extractOneArg, extractTwoArgs, getAlign, getAttr, getAttr, getAttr, getAttr, getAttr, getAttr, getAttr, getComponent, getComponents, getContents, getImage, getImageAttr, getProperty, hasComponent, inheritName, inheritNameOldWay, initializeComponents, itemStateChanged, main, makeButton, setRoot, setStartNode, xmlToUi
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

idToElement

private Map<String,Element> idToElement
Maps an ID to an Element.


idv

private IntegratedDataViewer idv
Avoids unneeded getIdv() calls.


window

private IdvWindow window
Keep around a reference to the window we were built for, useful for associated component groups with the appropriate window.

Constructor Detail

McIDASVXmlUi

public McIDASVXmlUi(IntegratedDataViewer idv,
                    Element root)

McIDASVXmlUi

public McIDASVXmlUi(IdvWindow window,
                    List viewManagers,
                    IntegratedDataViewer idv,
                    Element root)
Method Detail

decodeHtml

private static String decodeHtml(String text)
Convert the &gt; and &lt; entities to > and <.

Parameters:
text - The text you'd like to convert.
Returns:
The converted text!

addComponent

public void addComponent(String id,
                         Element component)
Add the component

Overrides:
addComponent in class XmlUi
Parameters:
id - id
component - component

makeComponentGroup

protected IdvComponentGroup makeComponentGroup(Element node)

Overridden so that any attempts to generate IdvComponentGroups or IdvComponentHolders will return the respective McIDAS-V equivalents.

It makes things like the draggable tabs possible.

Overrides:
makeComponentGroup in class IdvXmlUi
Parameters:
node - The XML representation of the desired component group.
Returns:
An honest-to-goodness McIDASVComponentGroup based upon the contents of node.
See Also:
IdvXmlUi.makeComponentGroup(Element)

createComponent

public Component createComponent(Element node,
                                 String id)

McIDAS-V overrides this so that it can seize control of some HTML processing in addition to attempting to associate newly-created ViewManagers with ViewManagers found in a bundle.

The latter is done so that McIDAS-V can load bundles that do not use component groups. A "dynamic skin" is built with ViewManagers for each ViewManager in the bundle. The "viewid" attribute of the dynamic skin ViewManager is the name of the ViewDescriptor from the bundled ViewManager. createViewManager() is used to actually associate the new ViewManager with its bundled ViewManager.

Overrides:
createComponent in class IdvXmlUi
Parameters:
node - The XML describing the component to be created.
id - node's ID.
Returns:
The Component described by node.
See Also:
IdvXmlUi.createComponent(Element, String), createViewManager(Element)

createViewManager

private ViewManager createViewManager(Element node)

Attempts to build a ViewManager based upon node. If the XML has a "viewid" attribute, the value will be used to search for a ViewManager that has been cached by the McIDAS-V UIManager. If the UIManager has a matching ViewManager, we'll use the cached ViewManager to initialize a "blank" ViewManager. The cached ViewManager is then removed from the cache and deleted. This method will return null if no cached ViewManager was found.

The ViewManager "cache" will only contain bundled ViewManagers that were not held in a component holder. This means that any ViewManager returned was created for a dynamic skin, but initialized with the contents of the corresponding bundled ViewManager.

Parameters:
node - The XML description of the ViewManager that needs building.
Returns:
Null if there was no cached ViewManager, otherwise a ViewManager that has been initialized with a bundled ViewManager.

createTreePanel

private TreePanel createTreePanel(Element node,
                                  String id)

getReffedNode

private Element getReffedNode(Element node)
The xml nodes can contain an idref field. If so this returns the node that that id defines

Parameters:
node - node
Returns:
The node or the referenced node