diva.gui
Class AbstractStoragePolicy
java.lang.Object
diva.gui.AbstractStoragePolicy
- All Implemented Interfaces:
- StoragePolicy
- Direct Known Subclasses:
- BasicStoragePolicy, DefaultStoragePolicy
public abstract class AbstractStoragePolicy
- extends java.lang.Object
- implements StoragePolicy
It is nice if storage policies suggest good pathnames. Usually the
file they last opened. This abstract class provides such functionality.
- Version:
- $Id: AbstractStoragePolicy.java 38798 2005-07-08 20:00:01Z cxh $
- Author:
- Steve Neuendorffer
Method Summary |
java.lang.String |
getDirectory()
Return a reasonable directory for file choosers to use. |
void |
setDirectory(java.io.File file)
Set the current browsed directory to that given in the file. |
void |
setDirectory(java.lang.String directory)
Set the current browsed directory to that given directory. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_directory
private java.lang.String _directory
AbstractStoragePolicy
public AbstractStoragePolicy()
getDirectory
public java.lang.String getDirectory()
- Return a reasonable directory for file choosers to use. If a
directory has been set using setDirectory, then use that.
Otherwise use the user's current working directory.
If all else fails, then use user's home directory. If THAT
fails, then just dump them into the root of the file system.
setDirectory
public void setDirectory(java.io.File file)
- Set the current browsed directory to that given in the file.
setDirectory
public void setDirectory(java.lang.String directory)
- Set the current browsed directory to that given directory. The
directory is assumed to exist.