diva.gui
Class AbstractStoragePolicy
java.lang.Object
diva.gui.AbstractStoragePolicy
- All Implemented Interfaces:
- StoragePolicy
- Direct Known Subclasses:
- BasicStoragePolicy, DefaultStoragePolicy
public abstract class AbstractStoragePolicy
- extends 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:
- $Revision: 1.3 $
- Author:
- Steve Neuendorffer (neuendor@eecs.berkeley.edu)
Method Summary |
String |
getDirectory()
Return a reasonable directory for file choosers to use. |
void |
setDirectory(File file)
Set the current browsed directory to that given in the file. |
void |
setDirectory(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 |
AbstractStoragePolicy
public AbstractStoragePolicy()
getDirectory
public 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(File file)
- Set the current browsed directory to that given in the file.
setDirectory
public void setDirectory(String directory)
- Set the current browsed directory to that given directory. The
directory is assumed to exist.
Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.