|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--flatscape.util.DataSource
The DataSource class contains static utility methods related to opening data for applications and applets from local files, jar files, files on the same web site as an applet, and other fully specified URL's. For the class to work properly for applets, the setApplet method must be called before any other methods are used.
Copyright (c) 2001 Rutgers, The State University of New Jersey
| Method Summary | |
static java.lang.String |
getFile(java.awt.Component parent,
java.lang.String current,
javax.swing.filechooser.FileFilter filter)
|
static java.lang.String |
getFile(java.awt.Component parent,
java.lang.String current,
javax.swing.filechooser.FileFilter filter,
java.lang.String source)
Displays a dialog to specify a file to open, and returns the appropriate source String. |
static java.lang.String |
getSaveFile(java.awt.Component parent,
java.lang.String current,
javax.swing.filechooser.FileFilter filter)
Opens file chooser dialog and returns the filename selected or typed by the user |
static java.net.URL |
getURL(java.lang.String source)
Returns a fully specified URL based on the source String. |
static boolean |
isApplet()
Returns true if setApplet has been called. |
static java.io.InputStream |
openStream(java.lang.String source)
Returns an open input stream to the specified source. |
static void |
setApplet(java.applet.Applet applet)
Sets this class to attempt to resove URL's in the specified applet's code base context. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static boolean isApplet()
public static void setApplet(java.applet.Applet applet)
public static java.net.URL getURL(java.lang.String source)
public static java.io.InputStream openStream(java.lang.String source)
throws java.io.IOException
java.io.IOException - Thrown if the source string is invalid, or a stream could not be opened.
public static java.lang.String getFile(java.awt.Component parent,
java.lang.String current,
javax.swing.filechooser.FileFilter filter)
public static java.lang.String getFile(java.awt.Component parent,
java.lang.String current,
javax.swing.filechooser.FileFilter filter,
java.lang.String source)
public static java.lang.String getSaveFile(java.awt.Component parent,
java.lang.String current,
javax.swing.filechooser.FileFilter filter)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||