|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
ucar.unidata.ui.ChooserPanel
ucar.unidata.idv.chooser.IdvChooser
ucar.unidata.idv.chooser.XmlChooser
public class XmlChooser
This handles a variety of flavors of xml documents (e.g., thredds
query capability, thredds catalogs, idv menus) to create data
choosers from. It provides a combobox to enter urls to xml
documents. It retrieves the xml and creates a XmlHandler
based on the type of xml. Currently this class handles two
types of xml: Thredds catalog and Web Map Server (WMS)
capability documents. The XmlHandler does most of the work.
This class maintains the different xml docs the user has gone to coupled with the XmlHandler for each doc. It uses this list to support navigating back and forth through the history of documents.
| Nested Class Summary | |
|---|---|
static class |
XmlChooser.PropertiedAction
A holder of a String action and a properties table. |
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static String |
ATTR_URL
The xml attr name for any initial url from the choosers.xml segment that created this chooser |
static String |
PROP_CHOOSER_URL
_more_ |
static String |
TAG_ERROR
If there was some error in loading the xml we construct and xml document with the error tag and popup the message in the GUI |
protected int |
timestamp
Keeps track of the outstanding url request |
| Fields inherited from class ucar.unidata.idv.chooser.IdvChooser |
|---|
ATTR_ID, ATTR_SHOWDETAILS, dirHistoryCbx, ignoreDirHistory, NULL_PROPERTIES, NULL_STRING, PREF_ADDESERVERS, PREF_CATALOGLIST, PREF_DEFAULTDIR, PREF_IMAGEDESCLIST, PREF_POLLINGINFO, PREF_RADARDESCLIST, PREF_TDSPOINTOBSERVER, PREF_TDSRADARSERVER, PROP_CHOOSER_MAPS, PROP_CHOOSER_PROJECTION_BOUNDS, PROP_CHOOSERCLASSNAME, PROP_STATUS_BACKGROUND, PROP_STATUS_FOREGROUND, PROP_STATUS_TEMPLATE, stationMap |
| Fields inherited from class ucar.unidata.ui.ChooserPanel |
|---|
cancelButton, CMD_LOAD, contents, GRID_INSETS, GRID_SPACING, GRID_SPACING_H, GRID_SPACING_V, haveData, helpPath, loadButton, MAP_COLOR, simpleMode, statusLabel |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
XmlChooser(IdvChooserManager mgr,
Element root)
Create the XmlChooser |
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent ae)
Handle any Gui actions. |
void |
doLoadInThread()
Load the currently selected xml element. |
protected JComponent |
doMakeContents()
Create and return the Gui contents. |
void |
doUpdate()
Reload the current xml and update the display. |
void |
doUpdateInner()
Reload the current xml and update the display. |
Document |
getDocument()
Get the xml doc |
String |
getXml()
Get the xml |
void |
goBack()
Go back and display the previous document. |
void |
goForward()
Go forward and display the next document in the history list. |
protected void |
handleAction(String action)
A wrapper around @see{handleAction}, passing in an empty properties table. |
protected void |
handleAction(String action,
Hashtable properties)
Process the given action (e.g., url, idv command) with the given properties. |
protected void |
handleActions(List actions)
Process the given list of XmlChooser.PropertiedActions. |
protected void |
handleActionsInThread(List actions)
Actually does the work of handling the actions |
void |
initSubProperties(Hashtable properties)
_more_ |
protected boolean |
makeDataSource(Object definingObject,
String dataType,
Hashtable properties)
_more_ |
protected void |
makeUi(Document doc,
Element xmlRoot,
String path)
Generate a user interface from the given xml document (derived from the given path). |
boolean |
makeUiFromPath(String xmlPath)
Load the xml defined by the given xmlPath. |
boolean |
makeUiFromPath(String xmlPath,
int myTimestamp)
Load the xml defined by the given xmlPath. |
void |
setDataSource(DataSource dataSource)
_more_ |
void |
setHaveData(boolean have)
_more_ |
protected boolean |
shouldDoUpdateOnFirstDisplay()
Overwrite base class method to do the update on first display. |
protected void |
updateStatus()
_more_ |
| Methods inherited from class ucar.unidata.ui.ChooserPanel |
|---|
addPropertyChangeListener, canDoUpdate, clearWaitCursor, doHelp, doLoad, firePropertyChange, getButtonLabels, getDefaultButtons, getHaveData, getLoadCommandName, getLoadToolTip, getMessageTemplate, getSimpleMode, getStatusComponent, getUpdateToolTip, padLabel, registerStatusComp, revalidate, setHelpPath, setMessageTemplate, setStatus, setStatus, showNormalCursor, showWaitCursor |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String PROP_CHOOSER_URL
public static final String TAG_ERROR
public static final String ATTR_URL
protected int timestamp
| Constructor Detail |
|---|
public XmlChooser(IdvChooserManager mgr,
Element root)
XmlChooser
mgr - The IdvChooserManagerroot - The xml root that defines this chooser| Method Detail |
|---|
public void setDataSource(DataSource dataSource)
setDataSource in class IdvChooserdataSource - _more_protected void updateStatus()
updateStatus in class IdvChooserpublic void setHaveData(boolean have)
setHaveData in class ChooserPanelhave - _more_protected boolean shouldDoUpdateOnFirstDisplay()
shouldDoUpdateOnFirstDisplay in class IdvChooserpublic void actionPerformed(ActionEvent ae)
actionPerformed in interface ActionListeneractionPerformed in class ChooserPanelae - The ActionEvent.public void initSubProperties(Hashtable properties)
properties - _more_
protected boolean makeDataSource(Object definingObject,
String dataType,
Hashtable properties)
makeDataSource in class IdvChooserdefiningObject - _more_dataType - _more_properties - _more_
protected JComponent doMakeContents()
doMakeContents in class ChooserPanelpublic boolean makeUiFromPath(String xmlPath)
xmlPath - The url pointing to the xml to display.
public boolean makeUiFromPath(String xmlPath,
int myTimestamp)
xmlPath - The url pointing to the xml to display.myTimestamp - Keeps track of which request this is.
protected void makeUi(Document doc,
Element xmlRoot,
String path)
doc - the xml documentxmlRoot - The root of the xml document to create a display for.path - The url path we got the xml from.public void goBack()
public void goForward()
protected void handleAction(String action)
action - The String action (Url, Idv command, etc.) to handle.
protected void handleAction(String action,
Hashtable properties)
action - The String action (Url, Idv command, etc.) to handle.properties - The properties for this action.protected void handleActions(List actions)
XmlChooser.PropertiedActions.
actions - The list of actions to processprotected void handleActionsInThread(List actions)
actions - List of PropertiedActionspublic void doUpdate()
doUpdate in class ChooserPanelpublic void doUpdateInner()
public void doLoadInThread()
doLoadInThread in class ChooserPanelpublic String getXml()
public Document getDocument()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||