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.
XmlUi.ActionHandler, XmlUi.CardPanel
Modifier and Type | Field and Description |
---|---|
private Map<String,Element> |
idToElement
Maps a
String 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.
|
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 and Description |
---|
McIDASVXmlUi(IdvWindow window,
List viewManagers,
IntegratedDataViewer idv,
Element root) |
McIDASVXmlUi(IntegratedDataViewer idv,
Element root) |
Modifier and Type | Method and Description |
---|---|
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 > and < 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. |
dispose, getBorder, getViewManager, getViewManagers, processToolbarXml
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
private Map<String,Element> idToElement
String
ID to an Element
.private IntegratedDataViewer idv
public McIDASVXmlUi(IntegratedDataViewer idv, Element root)
public McIDASVXmlUi(IdvWindow window, List viewManagers, IntegratedDataViewer idv, Element root)
private static String decodeHtml(String text)
text
- The text you'd like to convert.public void addComponent(String id, Element component)
addComponent
in class XmlUi
id
- idcomponent
- componentprotected IdvComponentGroup makeComponentGroup(Element node)
IdvComponentGroups
or
IdvComponentHolders
will return the
respective McIDAS-V equivalents.
It makes things like the draggable tabs possible.
makeComponentGroup
in class IdvXmlUi
node
- XML representation of the desired component group.McvComponentGroup
based upon the contents of node
.public Component createComponent(Element node, String id)
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.
createComponent
in class IdvXmlUi
node
- The XML describing the component to be created.id
- ID of node
.Component
described by node
.createViewManager(Element)
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.
node
- XML description of the ViewManager that needs building.null
if there was no cached ViewManager, otherwise a
ViewManager
that has been initialized with a bundled ViewManager.private TreePanel createTreePanel(Element node, String id)
private Element getReffedNode(Element node)
node
- node