Class ncsa.horizon.modules.DatasetChooserPanel
All Packages Class Hierarchy This Package Previous Next Index
Class ncsa.horizon.modules.DatasetChooserPanel
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----ncsa.horizon.modules.DatasetChooserPanel
- public class DatasetChooserPanel
- extends Panel
-
browse
-
-
browserFrame
-
-
current
-
-
currentName
-
-
defChoice
-
-
dsurls
-
-
editChoice
- the string that tells user to edit the test in the URL TextField
-
fileBrowser
-
-
getIt
-
-
loadAlerter
- the delegate Observerable
-
reset
-
-
store
-
-
urlField
-
-
wdir
-
-
DatasetChooserPanel()
- Create a blank DatasetChooserPanel
-
DatasetChooserPanel(int)
- Create a blank DatasetChooserPanel
-
DatasetChooserPanel(String)
- Create a DatasetChooserPanel with default string in URL TextField
-
DatasetChooserPanel(String, Frame)
- Create a DatasetChooserPanel with default string in URL TextField
-
DatasetChooserPanel(String, int)
- Create a DatasetChooserPanel with default string in URL TextField
-
DatasetChooserPanel(String, int, Frame)
- Create a DatasetChooserPanel with default string in URL TextField
-
action(Event, Object)
-
-
addDatasetURL(String, String)
- add predefined dataset URL to the choice menu
-
addObserver(Observer)
- add an Observer that wants to be alerted when there has been a
request to load a dataset.
-
canBrowse()
- return whether a FileDialog window can be opened.
-
doSelectDataset(String)
- respond to a change in the dataset Choice menu
-
getBrowseButton()
- return a reference to the "Browse..." Button
-
getDataChoice()
- return a reference to the data Choice menu
-
getLoadButton()
- return a reference to the "Load" button
-
getObservable()
- return a reference to the actual Observable object used by this
Panel.
-
getReloadCurrentButton()
- return a reference to the "Reload Current" Button
-
getRequestedDataset()
- return the URL string for the last dataset for which there was a
load request, or null if a request has not yet been made.
-
getURLString()
- return the URL string currently in the URL TextField
-
getURLTextField()
- return a reference to the url TextField
-
layoutComponents()
- layout the components.
-
loadData()
- request that the dataset given by the string appearing in the
URL TextField be loaded.
-
main(String[])
-
-
openFileBrowser()
- open a FileDialog window for the selection of a file from the
local filesystem.
-
reloadCurrentData()
- reload the last dataset that was loaded either via the "Load" button
or an explicit call to the loadData() method.
-
rememberURL()
-
-
selectDataset(String)
- select the dataset with the given name.
-
setAutoFileLoad(boolean)
- set whether a dataset will automatically be loaded when the File
browser window is closed.
-
setBrowsing(boolean)
- set whether a FileDialog window can be opened.
-
setURLText(String)
- set the String appearing in the URL TextField.
-
setWorkingDirectory(String)
- the default working directory for the file browser window
-
willAutoLoadFile()
- return whether a dataset will automatically be loaded when the File
browser window is closed.
getIt
protected Button getIt
urlField
protected TextField urlField
defChoice
protected Choice defChoice
store
protected Button store
browse
protected Button browse
reset
protected Button reset
fileBrowser
protected FileDialog fileBrowser
browserFrame
protected Frame browserFrame
current
protected String current
currentName
protected String currentName
wdir
protected String wdir
dsurls
protected Properties dsurls
editChoice
protected String editChoice
- the string that tells user to edit the test in the URL TextField
loadAlerter
protected Observable loadAlerter
- the delegate Observerable
DatasetChooserPanel
public DatasetChooserPanel()
- Create a blank DatasetChooserPanel
DatasetChooserPanel
public DatasetChooserPanel(int cols)
- Create a blank DatasetChooserPanel
DatasetChooserPanel
public DatasetChooserPanel(String defURL)
- Create a DatasetChooserPanel with default string in URL TextField
DatasetChooserPanel
public DatasetChooserPanel(String defURL,
Frame parent)
- Create a DatasetChooserPanel with default string in URL TextField
DatasetChooserPanel
public DatasetChooserPanel(String defURL,
int cols)
- Create a DatasetChooserPanel with default string in URL TextField
- Parameters:
- defURL - the string to appear in the URL TextField
- cols - the default number of columns in the URL TextField;
the actual width may be larger depending on the layout
of this Component in its Container.
DatasetChooserPanel
public DatasetChooserPanel(String defURL,
int cols,
Frame parent)
- Create a DatasetChooserPanel with default string in URL TextField
- Parameters:
- defURL - the string to appear in the URL TextField (can be null).
- cols - the default number of columns in the URL TextField;
the actual width may be larger depending on the layout
of this Component in its Container.
- parent - the Frame that will hold this Panel; this is needed if
browsing of the local filesystem is desired.
layoutComponents
protected void layoutComponents()
- layout the components.
addObserver
public void addObserver(Observer o)
- add an Observer that wants to be alerted when there has been a
request to load a dataset.
getObservable
public Observable getObservable()
- return a reference to the actual Observable object used by this
Panel.
getLoadButton
public Button getLoadButton()
- return a reference to the "Load" button
getURLTextField
public TextField getURLTextField()
- return a reference to the url TextField
getDataChoice
public Choice getDataChoice()
- return a reference to the data Choice menu
getBrowseButton
public Button getBrowseButton()
- return a reference to the "Browse..." Button
getReloadCurrentButton
public Button getReloadCurrentButton()
- return a reference to the "Reload Current" Button
getURLString
public String getURLString()
- return the URL string currently in the URL TextField
addDatasetURL
public synchronized void addDatasetURL(String datasetName,
String datasetURL)
- add predefined dataset URL to the choice menu
- Parameters:
- datasetName - the name that will appear on the Choice menu
- datasetURL - the URL string that will return that dataset
action
public boolean action(Event e,
Object what)
- Overrides:
- action in class Component
setAutoFileLoad
public void setAutoFileLoad(boolean doIt)
- set whether a dataset will automatically be loaded when the File
browser window is closed.
willAutoLoadFile
public boolean willAutoLoadFile()
- return whether a dataset will automatically be loaded when the File
browser window is closed. This method will always return false if
a call to canBrowse() would return false.
canBrowse
public boolean canBrowse()
- return whether a FileDialog window can be opened.
setBrowsing
public boolean setBrowsing(boolean allow)
- set whether a FileDialog window can be opened.
- Returns:
- s false if this state cannot be change; to enable browsing,
a Frame must have been passed to this class's constructor.
setWorkingDirectory
public boolean setWorkingDirectory(String dirname)
- the default working directory for the file browser window
- Returns:
- s false if this directory cannot be set (because a Frame was
not passed to this object's constructor
openFileBrowser
public void openFileBrowser()
- open a FileDialog window for the selection of a file from the
local filesystem. This method does nothing if a call to canBrowse()
would return false.
getRequestedDataset
public String getRequestedDataset()
- return the URL string for the last dataset for which there was a
load request, or null if a request has not yet been made.
loadData
public synchronized void loadData()
- request that the dataset given by the string appearing in the
URL TextField be loaded. All observers will be alerted and given
the dataset's URL string as an argument.
setURLText
public synchronized void setURLText(String url)
- set the String appearing in the URL TextField. This method will
cause the TextField to become editable, and the dataset Choice menu
will be set to the "Enter URL above" choice.
reloadCurrentData
public synchronized void reloadCurrentData()
- reload the last dataset that was loaded either via the "Load" button
or an explicit call to the loadData() method. Nothing happens if
no data has yet been loaded. This method is called when the
"Reload Current" button is pressed.
selectDataset
public synchronized void selectDataset(String name)
- select the dataset with the given name. This equivalent to making
a choice via the GUI.
- Parameters:
- name - one of the Strings that appears in the dataset Choice
menu
doSelectDataset
protected synchronized void doSelectDataset(String name)
- respond to a change in the dataset Choice menu
rememberURL
public synchronized void rememberURL()
main
public static void main(String args[])
All Packages Class Hierarchy This Package Previous Next Index