|
||||||||||
| 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
public abstract class IdvChooser
This is the base class of all Chooser classes.
| Nested Class Summary |
|---|
| 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_ID
Name of the id attribute in the choosers.xml |
static String |
ATTR_SHOWDETAILS
Name of the details attribute in the choosers.xml |
protected JComboBox |
dirHistoryCbx
For the dir history |
protected boolean |
ignoreDirHistory
For the dir history |
static Hashtable |
NULL_PROPERTIES
Can pass in null properties. |
static String |
NULL_STRING
Like above, a handy way to pass in a null string |
static String |
PREF_ADDESERVERS
Used by derived classes to save the list of adde servers |
static String |
PREF_CATALOGLIST
Used by derived classes to save the list of catalogs |
static String |
PREF_DEFAULTDIR
Used by derived classes to save the last directory the user was in |
static String |
PREF_IMAGEDESCLIST
Used by derived classes to save the list of image descriptors |
static String |
PREF_POLLINGINFO
Saves off the pollinginfo_ |
static String |
PREF_RADARDESCLIST
Used by derived classes to save the list of radar descriptors |
static String |
PREF_TDSPOINTOBSERVER
Used by derived classes to save the list of tds point ob servers |
static String |
PREF_TDSRADARSERVER
Used by derived classes to save the list of tds radar servers |
static String |
PROP_CHOOSER_MAPS
Where we get the maps |
static String |
PROP_CHOOSER_PROJECTION_BOUNDS
Where we get the projection bounds |
static String |
PROP_CHOOSERCLASSNAME
_more_ |
static String |
PROP_STATUS_BACKGROUND
status background color |
static String |
PROP_STATUS_FOREGROUND
status foreground color |
static String |
PROP_STATUS_TEMPLATE
status template |
protected StationLocationMap |
stationMap
station location map |
| 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 | |
|---|---|
IdvChooser(IdvChooserManager chooserManager,
Element chooserNode)
Create the chooser |
|
IdvChooser(IntegratedDataViewer idv,
Element chooserNode)
Create the chooser |
|
IdvChooser(IntegratedDataViewer idv,
IdvChooserManager chooserManager,
Element chooserNode)
Create the chooser |
|
| Method Summary | |
|---|---|
protected void |
clearSelectedStations()
Clear any selected stations. |
protected void |
clearStations()
Clear all stations in the station map. |
protected void |
closeChooser()
Close the chooser window |
protected StationLocationMap |
createStationMap()
Create the station map |
JComponent |
decorateButtons(JComponent buttons)
Add extra components to "decorate" the button panel |
void |
doCancel()
Handle a cancel |
void |
doClose()
Close the chooser window |
static void |
errorMessage(String msg)
Helper method to show a user error message |
protected String |
getAttribute(String name,
String dflt)
Utility to get the attribute from the chooser xml node. |
JComponent |
getContents()
Create and return the GUI contents. |
DataManager |
getDataManager()
Return the DataManager |
DataSource |
getDataSource()
Get the DataSource property. |
protected String |
getDataSourceId()
If the dataSources combo box is non-null then return the data source id the user selected. |
protected String |
getDataSourceId(JComboBox dataSourcesCbx)
Get the data source ID for the particular item selected in the box |
protected void |
getDataSourceProperties(Hashtable ht)
Get the properties from the datasource |
protected JComboBox |
getDataSourcesComponent()
Return the component that holds the dataSources combo box |
protected JComboBox |
getDataSourcesComponent(boolean justFileSources)
Return the component that holds the dataSources combo box |
static JComboBox |
getDataSourcesComponent(boolean justFileSources,
DataManager dataManager)
Return the component that holds the dataSources combo box |
static JComboBox |
getDataSourcesComponent(boolean justFileSources,
DataManager dataManager,
boolean addLucky)
Get the component for listing data source types |
JComponent |
getDefaultButtons(ActionListener listener)
Get the default buttons |
protected String |
getDefaultDisplayType()
Get the default display type |
protected String |
getDefaultMap()
Get the default map to be used. |
protected List |
getDefaultMaps()
Get the default map to be used. |
protected ucar.unidata.geoloc.ProjectionImpl |
getDefaultProjection()
Create and return the default projection used for the station map. |
protected ucar.unidata.geoloc.ProjectionRect |
getDefaultProjectionRect()
Create and return the default projection rect used for the station map. |
protected boolean |
getHaveStations()
Do we have stations |
String |
getId()
Return the id |
IntegratedDataViewer |
getIdv()
Getter method to return the IDV |
String |
getMenuTitle()
Get the title to use for menu entries. |
PreferenceList |
getPreferenceList(String listProp)
Find the PreferenceList associated
with the given property. |
PreferenceList |
getPreferenceList(String listProp,
boolean mergeTheIdvProperty)
Find the PreferenceList associated
with the given property. |
PreferenceList |
getPreferenceList(String listProp,
boolean mergeTheIdvProperty,
List butNotThese)
Find the PreferenceList associated
with the given listProp. |
PreferenceList |
getPreferenceList(String listProp,
boolean mergeTheIdvProperty,
String butNotThisOne)
Find the PreferenceList associated
with the given listProp. |
boolean |
getProperty(String name,
boolean dflt)
Utility to get a boolean property |
String |
getProperty(String name,
String dflt)
Utility to get a String property |
List |
getPropList(String property,
boolean mergeTheIdvProperty)
Find the list (of Strings) defined by the property name |
protected String |
getSelectedStation()
Get the first seleted station or null if none selected. |
List |
getSelectedStations()
Get list of selected stations, objects of ucar/unidata/metdata/NamedStationImpl class |
boolean |
getShowInMenu()
Should this chooser entry be shown in the file menu |
protected StationLocationMap |
getStationMap()
Create (if needed) and return the station map |
protected JLabel |
getStatusLabel()
Create (if needed) and return the JLabel that shows the status messages. |
Color |
getStatusLabelBackground()
get the status label background color |
Color |
getStatusLabelForeground()
Get the status label foreground color |
String |
getTitle()
Get the title |
Element |
getXmlNode()
Get the xml node that defined this chooser |
protected boolean |
haveStationSelected()
If there is a station map created then return whether there are any stations selected. |
protected void |
init()
Initialize after creation |
protected void |
initChooserPanel(ChooserPanel chooserPanel)
Initialize the given panel. |
protected void |
initStationMap(StationLocationMap stationMap)
Initialize the stations |
boolean |
isReloadable()
_more_ |
void |
logException(String msg,
Exception exc)
Helper method that calls LogUtil.printException |
protected boolean |
makeDataSource(Object definingObject,
Hashtable properties)
Create the data source defined by the given definingObject (e.g., a string filename, a list of images, etc. |
protected boolean |
makeDataSource(Object definingObject,
String dataType,
Hashtable properties)
Create the data source defined by the given definingObject (ex: a string filename, a list of images). |
List |
makeTimeMenus(ActionListener listener)
Make time menus |
protected void |
newSelectedStations(List stations)
Notify of new selected stations. |
protected void |
resetDataSourceId()
Clear the dataSources combo box |
void |
setDataSource(DataSource value)
Set the DataSource property. |
void |
setDataSourceListener(ActionListener listener)
Set the data source listener |
protected boolean |
shouldDoUpdateOnFirstDisplay()
As the name implies should this chooser do call doUpdate the first time it is painted. |
void |
showNormalCursor()
show regular cursor |
void |
showWaitCursor()
show wait cursor |
protected Object |
startTask()
Start the task |
protected void |
stopTask(Object taskId)
Stop the task |
protected boolean |
stopTaskAndIsOk(Object taskId)
See if we can stop the task and it's okay |
protected boolean |
taskOk(Object taskId)
Is the task ok? |
protected void |
updateStatus()
Update the status |
static void |
userMessage(String msg)
Helper method to show a user message |
protected boolean |
usingStations()
Is this chooser using the station map |
| Methods inherited from class ucar.unidata.ui.ChooserPanel |
|---|
actionPerformed, addPropertyChangeListener, canDoUpdate, clearWaitCursor, doHelp, doLoad, doLoadInThread, doMakeContents, doUpdate, firePropertyChange, getButtonLabels, getDefaultButtons, getHaveData, getLoadCommandName, getLoadToolTip, getMessageTemplate, getSimpleMode, getStatusComponent, getUpdateToolTip, padLabel, registerStatusComp, revalidate, setHaveData, 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_MAPS
public static final String PROP_STATUS_FOREGROUND
public static final String PROP_STATUS_BACKGROUND
public static final String PROP_STATUS_TEMPLATE
public static final String PROP_CHOOSER_PROJECTION_BOUNDS
public static final String PROP_CHOOSERCLASSNAME
public static final Hashtable NULL_PROPERTIES
public static final String NULL_STRING
public static final String PREF_DEFAULTDIR
public static final String PREF_POLLINGINFO
public static final String PREF_CATALOGLIST
public static final String PREF_ADDESERVERS
public static final String PREF_IMAGEDESCLIST
public static final String PREF_RADARDESCLIST
public static final String PREF_TDSRADARSERVER
public static final String PREF_TDSPOINTOBSERVER
public static final String ATTR_ID
public static final String ATTR_SHOWDETAILS
protected boolean ignoreDirHistory
protected JComboBox dirHistoryCbx
protected StationLocationMap stationMap
| Constructor Detail |
|---|
public IdvChooser(IntegratedDataViewer idv,
Element chooserNode)
idv - The IDVchooserNode - The Xml
public IdvChooser(IdvChooserManager chooserManager,
Element chooserNode)
chooserManager - The manager of all of the chooserschooserNode - The Xml
public IdvChooser(IntegratedDataViewer idv,
IdvChooserManager chooserManager,
Element chooserNode)
idv - The IDVchooserManager - The manager of all of the chooserschooserNode - The Xml| Method Detail |
|---|
protected JLabel getStatusLabel()
getStatusLabel in class ChooserPanelpublic JComponent decorateButtons(JComponent buttons)
buttons - button panel
public JComponent getDefaultButtons(ActionListener listener)
getDefaultButtons in class ChooserPanellistener - the listener
protected String getDefaultDisplayType()
protected void getDataSourceProperties(Hashtable ht)
ht - a Hashtable of propertiesprotected String getDefaultMap()
protected List getDefaultMaps()
protected void initStationMap(StationLocationMap stationMap)
stationMap - The station mapprotected StationLocationMap createStationMap()
protected boolean usingStations()
protected boolean haveStationSelected()
protected void newSelectedStations(List stations)
stations - Selected stations.protected StationLocationMap getStationMap()
public List getSelectedStations()
protected String getSelectedStation()
protected void clearSelectedStations()
protected void clearStations()
protected boolean getHaveStations()
protected ucar.unidata.geoloc.ProjectionImpl getDefaultProjection()
protected ucar.unidata.geoloc.ProjectionRect getDefaultProjectionRect()
public List makeTimeMenus(ActionListener listener)
listener - the listener for this
public Element getXmlNode()
protected String getAttribute(String name,
String dflt)
name - attr namedflt - default value
public String getProperty(String name,
String dflt)
name - property namedflt - default value
public boolean getProperty(String name,
boolean dflt)
name - property namedflt - default value
public boolean getShowInMenu()
public String getMenuTitle()
public String getTitle()
protected void initChooserPanel(ChooserPanel chooserPanel)
chooserPanel - The panel to initialize.protected JComboBox getDataSourcesComponent()
protected JComboBox getDataSourcesComponent(boolean justFileSources)
justFileSources - If true then just use data sources that access files
public static JComboBox getDataSourcesComponent(boolean justFileSources,
DataManager dataManager)
justFileSources - If true then just use data sources that access filesdataManager - The data manager
public static JComboBox getDataSourcesComponent(boolean justFileSources,
DataManager dataManager,
boolean addLucky)
justFileSources - true for just filesdataManager - the data manageraddLucky - true to add the "I'm Feeiling Lucky" option
protected String getDataSourceId()
protected String getDataSourceId(JComboBox dataSourcesCbx)
dataSourcesCbx - the list of source descriptions
protected void resetDataSourceId()
protected boolean makeDataSource(Object definingObject,
Hashtable properties)
definingObject - What defines the data sourceproperties - extra properties
public void setDataSourceListener(ActionListener listener)
listener - the listenerpublic boolean isReloadable()
protected boolean makeDataSource(Object definingObject,
String dataType,
Hashtable properties)
Else the creation is done by looking at the string value of the defining object and seeing if it matches any of the patterns that are defined in datasources.xml
One more way to define what data source to create
is to add the id into the properties Hashable
using DataManager.DATATYPE_ID
definingObject - What defines the data sourcedataType - Define the data type to createproperties - extra properties
protected Object startTask()
protected void stopTask(Object taskId)
taskId - the task idprotected boolean stopTaskAndIsOk(Object taskId)
taskId - the task id
protected boolean taskOk(Object taskId)
taskId - the task id
public void showWaitCursor()
showWaitCursor in class ChooserPanelpublic void showNormalCursor()
showNormalCursor in class ChooserPanelpublic void doClose()
doClose in class ChooserPanelpublic void doCancel()
doCancel in class ChooserPanelprotected void closeChooser()
protected void init()
protected boolean shouldDoUpdateOnFirstDisplay()
public final JComponent getContents()
getContents in class ChooserPanelprotected void updateStatus()
updateStatus in class ChooserPanelpublic DataManager getDataManager()
DataManager
public String getId()
public IntegratedDataViewer getIdv()
public void logException(String msg,
Exception exc)
logException in class ChooserPanelmsg - The messageexc - The exceptionpublic static void errorMessage(String msg)
msg - The messagepublic static void userMessage(String msg)
msg - The messagepublic PreferenceList getPreferenceList(String listProp)
PreferenceList associated
with the given property.
listProp - The property name
public PreferenceList getPreferenceList(String listProp,
boolean mergeTheIdvProperty)
PreferenceList associated
with the given property.
listProp - The property namemergeTheIdvProperty - If true, then we also lookup the String
property from the IDV and merge it into
the list.
public PreferenceList getPreferenceList(String listProp,
boolean mergeTheIdvProperty,
String butNotThisOne)
PreferenceList associated
with the given listProp.
listProp - The property keymergeTheIdvProperty - If true, then we also lookup
the String property
from the IDV and merge it into the list.butNotThisOne - If non-null then we don't include this
property. This is used to remove old
catalogs from the XmlChooser's list
public PreferenceList getPreferenceList(String listProp,
boolean mergeTheIdvProperty,
List butNotThese)
PreferenceList associated
with the given listProp.
listProp - The property keymergeTheIdvProperty - If true, then we also lookup
the String property
from the IDV and merge it into the list.butNotThese - If non-null or empty then we don't include
these properties. This is used to remove old
values from the list
public List getPropList(String property,
boolean mergeTheIdvProperty)
property - The property namemergeTheIdvProperty - If true, then we also lookup the String property
from the IDV and merge it into the list.
public Color getStatusLabelBackground()
getStatusLabelBackground in class ChooserPanelpublic Color getStatusLabelForeground()
getStatusLabelForeground in class ChooserPanelpublic void setDataSource(DataSource value)
value - The new value for DataSourcepublic DataSource getDataSource()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||