|
||||||||||
| 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.FileChooser
public class FileChooser
This provides a JFileChooser for choosing data sets from the file system. It can be instantiated from the chooser.xml with the attributes:
path="initial file system path"
filters="File filters to use" (Define file filters)
datasourceid="The data source id (from datasource.xml, force the file to
be passed to the data source)
For information on the filters attribute see
PatternFileFilter.createFilters(String)
| Nested Class Summary | |
|---|---|
class |
FileChooser.MyFileChooser
An extension of JFileChooser |
| 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 | |
|---|---|
protected JCheckBox |
allowDirectorySelectionCbx
allow directory selection checkbox |
static String |
ATTR_DATASOURCEID
Pre-defined data source id to use |
static String |
ATTR_DSCOMP
Should we show the polling cbx |
static String |
ATTR_FILECOUNT
The most recent attribute |
static String |
ATTR_FILEPATTERN
Default pattern |
static String |
ATTR_FILTERS
Any filter filters to use |
static String |
ATTR_PATH
Any initial file system path to start with |
static String |
ATTR_POLLON
Default polling value |
static String |
ATTR_SHOWPATTERNFIELD
Should we show the file pattern field |
protected JTextField |
patternFld
Holds the file pattern |
protected JComboBox |
recentFilesCbx
Como box for choosing relative files |
| 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 | |
|---|---|
FileChooser(IdvChooserManager mgr,
Element root)
Create the FileChooser, passing in the manager and the xml element from choosers.xml |
|
| Method Summary | |
|---|---|
protected void |
checkRecentPatternWidgetsEnable()
Disable or enable the file pattern widget and label |
void |
doLoadInThread()
Override the base class method to catch the do load |
protected JComponent |
doMakeContents()
Construct a JFileChooser to put into the IdvChooserManager. |
protected JFileChooser |
doMakeFileChooser(String path)
Make the file chooser |
void |
doUpdate()
Override the base class method to catch the do update |
protected JComponent |
getAccessory()
Get the accessory component |
protected JCheckBox |
getAllowDirectorySelectionCbx()
Get the checkbox for allowing directory selection |
protected String[] |
getButtonLabels()
_more_ |
protected JFileChooser |
getFileChooser()
Get the file chooser |
protected int |
getFileCount()
Get the count of recent files |
protected String[] |
getFileNames(File[] files)
Convert the given array of File objects to an array of String file names. |
protected String |
getFilePattern()
Get the file pattern |
protected String |
getLoadToolTip()
Get the tooltip for the load button |
protected JComponent |
getRecentFilesComponent()
Get the recent file component |
protected JComponent |
getRecentFilesComponent(int[] values,
int value,
boolean addPatternField)
Get the recent files component with the appropriate params |
protected void |
getTopComponents(List comps)
Get the top components for the chooser |
protected String |
getUpdateToolTip()
Get the tooltip for the update button |
protected void |
selectFiles(File[] files,
File directory)
Handle the selection of the set of files |
protected boolean |
selectFilesInner(File[] files,
File directory)
Handle the selection of the set of files |
void |
setHaveData(boolean haveData)
_more_ |
protected boolean |
shouldShowRecentComponent()
Should show the recent (time relative) component |
| Methods inherited from class ucar.unidata.ui.ChooserPanel |
|---|
actionPerformed, addPropertyChangeListener, canDoUpdate, clearWaitCursor, doHelp, doLoad, firePropertyChange, getDefaultButtons, getHaveData, getLoadCommandName, getMessageTemplate, getSimpleMode, getStatusComponent, 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 ATTR_PATH
public static final String ATTR_FILECOUNT
public static final String ATTR_POLLON
public static final String ATTR_DSCOMP
public static final String ATTR_SHOWPATTERNFIELD
public static final String ATTR_FILEPATTERN
public static final String ATTR_FILTERS
public static final String ATTR_DATASOURCEID
protected JComboBox recentFilesCbx
protected JCheckBox allowDirectorySelectionCbx
protected JTextField patternFld
| Constructor Detail |
|---|
public FileChooser(IdvChooserManager mgr,
Element root)
mgr - The managerroot - The xml root| Method Detail |
|---|
protected String[] getButtonLabels()
getButtonLabels in class ChooserPanelprotected String getLoadToolTip()
getLoadToolTip in class ChooserPanelprotected String getUpdateToolTip()
getUpdateToolTip in class ChooserPanelprotected JComponent getRecentFilesComponent()
protected JComponent getRecentFilesComponent(int[] values,
int value,
boolean addPatternField)
values - valuesvalue - selected valueaddPatternField - the pattern field
protected int getFileCount()
protected void checkRecentPatternWidgetsEnable()
protected String getFilePattern()
protected JComponent doMakeContents()
doMakeContents in class ChooserPanelprotected JCheckBox getAllowDirectorySelectionCbx()
protected void getTopComponents(List comps)
comps - the top componentprotected JFileChooser doMakeFileChooser(String path)
path - the initial path
public void setHaveData(boolean haveData)
setHaveData in class ChooserPanelhaveData - _more_protected boolean shouldShowRecentComponent()
protected JComponent getAccessory()
protected final void selectFiles(File[] files,
File directory)
files - The files the user chosedirectory - The directory they chose them fromprotected JFileChooser getFileChooser()
public void doLoadInThread()
doLoadInThread in class ChooserPanelpublic void doUpdate()
doUpdate in class ChooserPanel
protected boolean selectFilesInner(File[] files,
File directory)
throws Exception
files - The files the user chosedirectory - The directory they chose them from
Exceptionprotected String[] getFileNames(File[] files)
files - Selected files
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||