Class McIDASVXmlUi
- All Implemented Interfaces:
ActionListener
,ItemListener
,EventListener
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
FieldsModifier and TypeFieldDescriptionMaps aString
ID to anElement
.private IntegratedDataViewer
Avoids unneeded getIdv() calls.private static final org.slf4j.Logger
Logging object.private IdvWindow
Keep around a reference to the window we were built for, useful for associated component groups with the appropriate window.SeegetElapsedGuiTime()
.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
ConstructorsConstructorDescriptionMcIDASVXmlUi
(IntegratedDataViewer idv, Element root) McIDASVXmlUi
(IdvWindow window, List viewManagers, IntegratedDataViewer idv, Element root) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addComponent
(String id, Element component) Add the 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-createdViewManagers
with ViewManagers found in a bundle.private TreePanel
createTreePanel
(Element node, String id) private ViewManager
createViewManager
(Element node) Attempts to build aViewManager
based uponnode
.private static String
decodeHtml
(String text) Convert the > and < entities to > and <.long
Return the total amount of time spent increateComponent(Element, String)
.private Element
getReffedNode
(Element node) The xml nodes can contain an idref field.protected IdvComponentGroup
makeComponentGroup
(Element node) Overridden so that any attempts to generateIdvComponentGroups
orIdvComponentHolders
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
-
Field Details
-
logger
Logging object. -
idToElement
Maps aString
ID to anElement
. -
idv
Avoids unneeded getIdv() calls. -
xmlUiTimes
SeegetElapsedGuiTime()
. -
window
Keep around a reference to the window we were built for, useful for associated component groups with the appropriate window.
-
-
Constructor Details
-
McIDASVXmlUi
-
McIDASVXmlUi
-
-
Method Details
-
decodeHtml
Convert the > and < entities to > and <.- Parameters:
text
- The text you'd like to convert.- Returns:
- The converted text!
-
addComponent
Add the component.- Overrides:
addComponent
in classXmlUi
- Parameters:
id
- idcomponent
- component
-
makeComponentGroup
Overridden so that any attempts to generateIdvComponentGroups
orIdvComponentHolders
will return the respective McIDAS-V equivalents.It makes things like the draggable tabs possible.
- Overrides:
makeComponentGroup
in classIdvXmlUi
- Parameters:
node
- XML representation of the desired component group.- Returns:
- An
McvComponentGroup
based upon the contents ofnode
.
-
createComponent
McIDAS-V overrides this so that it can seize control of some HTML processing in addition to attempting to associate newly-createdViewManagers
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 classIdvXmlUi
- Parameters:
node
- The XML describing the component to be created.id
- ID ofnode
.- Returns:
- The
Component
described bynode
. - See Also:
-
getElapsedGuiTime
Return the total amount of time spent increateComponent(Element, String)
.Be aware that each McV
window
should have its ownMcIDASXmlUi
instance, so in order to determine the total time, iterate over the results fromIdvWindow.getWindows()
.The elapsed time is merely a quick estimate. The only way to obtain accurate timing information with the JVM is using JMH.
- Returns:
- Nanoseconds spent creating GUI components in this window.
-
createViewManager
Attempts to build a
ViewManager
based uponnode
. If the XML has a "viewid" attribute, the value will be used to search for a ViewManager that has been cached by the McIDAS-VUIManager
. 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 returnnull
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
- XML description of the ViewManager that needs building.- Returns:
null
if there was no cached ViewManager, otherwise aViewManager
that has been initialized with a bundled ViewManager.
-
createTreePanel
-
getReffedNode
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
-