Package ucar.unidata.idv.chooser
Class IdvChooserManager
java.lang.Object
ucar.unidata.ui.WindowHolder
ucar.unidata.idv.IdvManager
ucar.unidata.idv.chooser.IdvChooserManager
- All Implemented Interfaces:
ActionListener,EventListener,IdvConstants
This creates and manages the set of choosers.
It makes the chooser GUI from an xml specification
e.g.: /ucar/unidata/idv/resources/choosers.xml
It uses the
XmlUi to process
the xml.
This class also processes the end-user created choosers. This piece has always been a bit flaky
- Version:
- $Revision: 1.98 $Date: 2007/07/30 19:38:22 $
- Author:
- IDV development team
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringXml attribute to identify different choosersstatic final StringClass attribute in choosers.xmlstatic final StringData source tagstatic final StringXml dopolling attribute name.static final StringXml attribute for the help pathstatic final StringXml label attribute name.static final StringXml menu title attribute name.static final StringXml path attribute name.static final StringXml pattern attribute name.static final StringXml pollinterval attribute name.static final StringXml attribute to see if this chooser should go in the data menustatic final StringXml title attribute name.static final String_more_static final String_more_static final String_more_static final StringXml tag name for directory tags.static final StringXml tag name for the label tags.static final StringXml tag name for the tab tags.Fields inherited from class ucar.unidata.ui.WindowHolder
contents, dialog, frame, windowFields inherited from interface ucar.unidata.idv.IdvConstants
ARG_B64BUNDLE, ARG_B64ISL, ARG_BUNDLE, ARG_CATALOG, ARG_CHOOSER, ARG_CLEARDEFAULT, ARG_CODE, ARG_CONNECT, ARG_CURRENTTIME, ARG_DATA, ARG_DEBUG, ARG_DEFAULT, ARG_DISPLAY, ARG_DXML, ARG_FIXEDTIME, ARG_HELP, ARG_IMAGE, ARG_IMAGESERVER, ARG_INSTALLPLUGIN, ARG_ISLFILE, ARG_ISLINTERACTIVE, ARG_LISTRESOURCES, ARG_MAINCLASS, ARG_MOVIE, ARG_MSG_DEBUG, ARG_MSG_RECORD, ARG_NODEFAULT, ARG_NOERRORSINGUI, ARG_NOGUI, ARG_NOONEINSTANCE, ARG_NOPLUGINS, ARG_NOPREF, ARG_ONEINSTANCEPORT, ARG_PLUGIN, ARG_PORT, ARG_PRINTJNLP, ARG_PROPERTIES, ARG_SCRIPT, ARG_SERVER, ARG_SETFILES, ARG_SITEPATH, ARG_TEMPLATE, ARG_TEST, ARG_TESTEVAL, ARG_TRACE, ARG_TRACEONLY, ARG_USERPATH, DEFAULT_DATE_FORMAT, DEFAULT_DOCPATH, DEFAULT_TIMEZONE, FILTER_CPT, FILTER_ISL, FILTER_JNLP, FILTER_XIDV, FILTER_XIDVZIDV, FILTER_XML, FILTER_ZIDV, ID_COMMANDSTORUN, ID_DATASOURCES, ID_DISPLAYCONTROLS, ID_IDV, ID_JYTHON, ID_MESSAGE, ID_MISCHASHTABLE, ID_NCIDV_VERSION, ID_VERSION, ID_VIEWMANAGERS, ID_WINDOWS, INITIAL_PROBE_EARTHLOCATION, NULL_DATA_SELECTION, NULL_STRING, PREF_APPEARANCEMODE, PREF_ARCHIVEDIR, PREF_ARCHIVENAME, PREF_AUTODISPLAYS_ENABLE, PREF_AUTODISPLAYS_SHOWGUI, PREF_AUTOSELECTDATA, PREF_CACHESIZE, PREF_CONTROLSINTABS, PREF_DATAPREFIX, PREF_DATE_FORMAT, PREF_DISTANCEUNIT, PREF_DOCACHE, PREF_EMBEDDATACHOOSERINDASHBOARD, PREF_EMBEDFIELDSELECTORINDASHBOARD, PREF_EMBEDLEGENDINDASHBOARD, PREF_EMBEDQUICKLINKSINDASHBOARD, PREF_EVENT_KEYBOARDMAP, PREF_EVENT_MOUSEMAP, PREF_EVENT_WHEELMAP, PREF_FAST_RENDER, PREF_FIELD_CACHETHRESHOLD, PREF_FILEREADDIR, PREF_FILEWRITEDIR, PREF_GEOMETRY_BY_REF, PREF_HISTORY, PREF_IMAGE_BY_REF, PREF_LARGE_REMOTE_DATA_WARN, PREF_LASTVERSION, PREF_LATLON_FORMAT, PREF_LEGEND_SHOWICONS, PREF_LOCALE, PREF_LOOKANDFEEL, PREF_MAXIMAGESIZE, PREF_MEMORY, PREF_NPOT_IMAGE, PREF_OPEN_ASK, PREF_OPEN_MERGE, PREF_OPEN_REMOVE, PREF_PROJ_LIST, PREF_SAMPLINGMODE, PREF_SHOWCONTROLWINDOW, PREF_SHOWDASHBOARD, PREF_SHOWDECODEDIALOG, PREF_SHOWHIDDENFILES, PREF_SHOWQUITCONFIRM, PREF_SITEPATH, PREF_THREADS_DATA, PREF_THREADS_RENDER, PREF_TIMEZONE, PREF_VERTICALCS, PREF_VERTICALUNIT, PREF_WINDOW_SHOWTOOLBAR, PREF_ZIDV_ASK, PREF_ZIDV_DIRECTORY, PREF_ZIDV_SAVETOTMP, PROP_3DMODE, PROP_ABOUTTEXT, PROP_APPRESOURCEPATH, PROP_CHOOSERS, PROP_CHOOSERS_ALL, PROP_CONTROLDESCRIPTORS, PROP_CONTROLDESCRIPTORS_ALL, PROP_DATAHOLDERBOUNDS, PROP_DEFAULTLOCATIONS, PROP_DISPLAYLIST_GROUP, PROP_FIXFILELOCKUP, PROP_JNLPCODEBASE, PROP_JNLPTEMPLATE, PROP_JNLPTITLE, PROP_LOADINGXML, PROP_MAP_GLOBE_LEVEL, PROP_MAP_MAP_LEVEL, PROP_MINIMUMFRAMECYCLETIME, PROP_MONITORPORT, PROP_OLDCONTROLDESCRIPTORS, PROP_ONEINSTANCEPORT, PROP_PREFERENCES, PROP_PROJ_NAME, PROP_RESOURCEFILES, PROP_SHOWCLOCK_DASH, PROP_SHOWCLOCK_VIEW, PROP_SHOWDASHBOARD, PROP_SHOWDATATREE, PROP_SHOWFORMULAS, PROP_SHOWSPLASH, PROP_SPLASHICON, PROP_UI_DESKTOP, PROP_USE_DISPLAYAREA, PROP_USE_TIMEDRIVER, PROP_VERSIONFILE, PROP_WINDOW_SCREENSIZEOFFSET, PROP_WINDOW_SIZEHEIGHT, PROP_WINDOW_SIZEWIDTH, PROP_WINDOW_USESCREENSIZE, SUFFIX_BAT, SUFFIX_CPT, SUFFIX_ISL, SUFFIX_JNLP, SUFFIX_RBI, SUFFIX_SH, SUFFIX_XIDV, SUFFIX_XML, SUFFIX_ZIDV -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivateAddeServerGroup(AddeServer server, AddeServer.Group group) Make the group activeaddAddeServer(String name) Create a new AddeServer or find an existing one with the given name.addAddeServerGroup(AddeServer server, String groupName, String type) Add the given AddeServer.Group into the list of servers.addUserChooserToMenu(JMenu menu, JMenu pullRight) Inserts menu items into the given menu for creating the data sources that are defined by the user chooservoidClose mecreateChooser(Node chooserNode) Overwrite the component factory method inXmlUito handler chooser xml nodes.createChoosers(boolean inTabs) Create the Choosers component from the choosers.xml resourcescreateChoosers(boolean inTabs, List theseChoosers, Element choosersNode) Create the Choosers component from the choosers.xml resourcesprotected XmlUicreateXmlUi(Element root) Factory method to create the IdvXmlUi to be used for the given chooser xml nodevoid_more_getAddeServers(String groupType) Get AddeServers to usegetAddeServers(String groupType, boolean onlyActive) Get AddeServers to useGet the chooser contents deprecated no longer in usestatic StringgetChooserId(Element node) This tries to find some identifier for the chooser defied by the given xml node.Return a list of the (String) chooser ids that have been processed by this manager.getChooserName(String chooserId) Get the name of the given chooserGet the list of current choosers.getDataSourcesComponent(boolean justFileSources, DataManager dataManager) Return the component that holds the dataSources combo boxgetDataSourcesComponent(boolean justFileSources, DataManager dataManager, boolean addLucky) Get the component for listing data source typesprotected StringWindow titlevoidinit()Initialize the set of choosers.makeChooserMenus(List items) Make the chooser menu itemsvoidmakeDataSourceFromXml(Element theNode) Create the data source from the given user chooser xmlprotected voidpopupXmlChooserDialog(Element tabNode, Element dirNode) Show the dialog for editing the user chooser entryvoidProcess the user chooser resourcesvoidprocessChooserXml(boolean writable, Element root) Process the user chooser xml rootvoidremoveAddeServer(AddeServer server, boolean markAsInactive) Remove the given adde server.voidremoveAddeServerGroup(AddeServer server, AddeServer.Group group, boolean markAsInactive) Remove the group held by the server.protected booleanShould we make a dialogvoidshowCatalogUrl(String url) Show the given catalog URL in the XmlChooservoidshowFileChooser(String path) show the file chooser in the chooser GUI with the given file pathsortDataSourceIds(List ids) _more_voidWrite out the addeservers.xml fileprotected voidWrite out the user chooser xml documentMethods inherited from class ucar.unidata.idv.IdvManager
getArgsManager, getCollabManager, getColorTableManager, getDataManager, getIdv, getIdvChooserManager, getIdvClass, getIdvProjectionManager, getIdvUIManager, getImageGenerator, getInstallManager, getJythonManager, getPersistenceManager, getPreferenceManager, getProperty, getProperty, getProperty, getPublishManager, getResourceManager, getStateManager, getStationModelManager, getStore, getVMManager, logException, showNormalCursor, showWaitCursor, waitUntilDisplaysAreDone, waitUntilDisplaysAreDoneMethods inherited from class ucar.unidata.ui.WindowHolder
actionPerformed, close, doMakeContents, getContents, getDialog, getFrame, getWindow, isShowing, removeAll, setMenuBar, setWindowTitle, show, show, showModal, toFront, windowIsClosing
-
Field Details
-
PROP_CHOOSER_TREEVIEW
_more_- See Also:
-
PROP_CHOOSER_TREEVIEW_WIDTH
_more_- See Also:
-
PROP_CHOOSER_TREEVIEW_USESPLITPANE
_more_- See Also:
-
ATTR_CLASS
Class attribute in choosers.xml- See Also:
-
ATTR_LABEL
Xml label attribute name. For user chooser- See Also:
-
ATTR_HELPPATH
Xml attribute for the help path- See Also:
-
ATTR_CHOOSERID
Xml attribute to identify different choosers- See Also:
-
TAG_DIRECTORY
Xml tag name for directory tags. Used for the user chooser- See Also:
-
TAG_TAB
Xml tag name for the tab tags. Used for the user chooser- See Also:
-
TAG_LABEL
Xml tag name for the label tags. Used for the user chooser- See Also:
-
ATTR_DATASOURCE
Data source tag- See Also:
-
ATTR_PATH
Xml path attribute name. For user chooser- See Also:
-
ATTR_PATTERN
Xml pattern attribute name. For user chooser- See Also:
-
ATTR_DOPOLLING
Xml dopolling attribute name. For user chooser- See Also:
-
ATTR_POLLINTERVAL
Xml pollinterval attribute name. For user chooser- See Also:
-
ATTR_TITLE
Xml title attribute name.- See Also:
-
ATTR_MENUTITLE
Xml menu title attribute name.- See Also:
-
ATTR_SHOWINMENU
Xml attribute to see if this chooser should go in the data menu- See Also:
-
-
Constructor Details
-
IdvChooserManager
Create a new IdvChooserManager.- Parameters:
idv- The singleton IDV
-
-
Method Details
-
removeAddeServerGroup
public void removeAddeServerGroup(AddeServer server, AddeServer.Group group, boolean markAsInactive) Remove the group held by the server. Write out the addeservers.xml file- Parameters:
server- The servergroup- The group to removemarkAsInactive- If true then don't really remove the group, just mark it as inactive
-
activateAddeServerGroup
Make the group active- Parameters:
server- The servergroup- The group to remove
-
addAddeServerGroup
Add the given AddeServer.Group into the list of servers. Write out the addeserver.xml file- Parameters:
server- Server to addgroupName- The new group nametype- Its type- Returns:
- The new Group
-
writeAddeServers
public void writeAddeServers()Write out the addeservers.xml file -
addAddeServer
Create a new AddeServer or find an existing one with the given name. If a new one is created then also write out the addeservers.xml file- Parameters:
name- new server name- Returns:
- The server
-
removeAddeServer
Remove the given adde server. Write out the addeservers.xml file- Parameters:
server- The server to removemarkAsInactive- If true then don't really remove the server, just mark it as inactive
-
getAddeServers
Get AddeServers to use- Parameters:
groupType- If null return all, else return the servers that have groups of the given type- Returns:
- List of AddeServers
-
getAddeServers
Get AddeServers to use- Parameters:
groupType- If null return all, else return the servers that have groups of the given typeonlyActive- If true then only fetch the active servers- Returns:
- List of AddeServers
-
getChoosers
Get the list of current choosers. This looks at all of the IdvWindows in existence and checks for their component group 'choosers'.- Returns:
- List of current choosers
-
getChooserContents
Get the chooser contents deprecated no longer in use- Returns:
- null
-
init
public void init()Initialize the set of choosers. Go through the chooser resources and create the chooser gui. -
createChoosers
Create the Choosers component from the choosers.xml resources- Parameters:
inTabs- Do we use the buttontabbedpane or the treepanel- Returns:
- choosers gui
-
createChoosers
Create the Choosers component from the choosers.xml resources- Parameters:
inTabs- Do we use the buttontabbedpane or the treepaneltheseChoosers- List to add the created choosers intochoosersNode- The xml node of the chooser skin- Returns:
- choosers gui
-
createXmlUi
Factory method to create the IdvXmlUi to be used for the given chooser xml node- Parameters:
root- The chooser xml node- Returns:
- _more_
-
createChooser
Overwrite the component factory method inXmlUito handler chooser xml nodes.- Parameters:
chooserNode- The chooser node- Returns:
- The chooser's gui
-
showCatalogUrl
Show the given catalog URL in the XmlChooser- Parameters:
url- The URL to show
-
showFileChooser
show the file chooser in the chooser GUI with the given file path -
makeChooserMenus
Make the chooser menu items- Parameters:
items- List to put the menu items in- Returns:
- List of chooser menu items
-
getChooserId
This tries to find some identifier for the chooser defied by the given xml node. This is used when the end user can define what choosers they want to see in the chooser GUI.- Parameters:
node- The chooser node- Returns:
- Some (hopefully) unique identifier
-
getChooserIds
Return a list of the (String) chooser ids that have been processed by this manager. We have this here for the end user to define what choosers they want to see- Returns:
- The list of (String) chooser ids.
-
getChooserName
Get the name of the given chooser- Parameters:
chooserId- The id of the chooser- Returns:
- Its name
-
addUserChooserToMenu
Inserts menu items into the given menu for creating the data sources that are defined by the user chooser- Parameters:
menu- The menupullRight- Will end up being the sub menu- Returns:
- The pullRight menu
-
sortDataSourceIds
_more_- Parameters:
ids- _more_- Returns:
- _more_
-
dataSourceIdSelected
_more_- Parameters:
id- _more_
-
makeDataSourceFromXml
Create the data source from the given user chooser xml- Parameters:
theNode- User chooser xml node that defines a data source
-
closeDataChooser
public void closeDataChooser()Close me -
shouldMakeDialog
protected boolean shouldMakeDialog()Should we make a dialog- Overrides:
shouldMakeDialogin classWindowHolder- Returns:
- true
-
getWindowTitle
Window title- Overrides:
getWindowTitlein classWindowHolder- Returns:
- window title
-
popupXmlChooserDialog
Show the dialog for editing the user chooser entry- Parameters:
tabNode- What tab the entry is indirNode- What entry
-
processChooserXml
public void processChooserXml()Process the user chooser resources -
processChooserXml
Process the user chooser xml root- Parameters:
writable- Is this the writable resourceroot- The xml document root
-
writeChooserXml
protected void writeChooserXml()Write out the user chooser xml document -
getDataSourcesComponent
Return the component that holds the dataSources combo box- Parameters:
justFileSources- If true then just use data sources that access filesdataManager- The data manager- Returns:
- The GUI for the data sources selector
-
getDataSourcesComponent
public JComboBox getDataSourcesComponent(boolean justFileSources, DataManager dataManager, boolean addLucky) Get the component for listing data source types- Parameters:
justFileSources- true for just filesdataManager- the data manageraddLucky- true to add the "I'm Feeiling Lucky" option- Returns:
- the component
-