Skip to content
Snippets Groups Projects
Commit b0eb1ef7 authored by Tobias Pietzsch's avatar Tobias Pietzsch
Browse files

BigDataViewerPlugIn remembers the previously opened file to avoid file-browsing orgies in Fiji

parent 7bbece3d
No related branches found
No related tags found
No related merge requests found
...@@ -16,6 +16,8 @@ import bdv.ij.util.ProgressWriterIJ; ...@@ -16,6 +16,8 @@ import bdv.ij.util.ProgressWriterIJ;
public class BigDataViewerPlugIn implements PlugIn public class BigDataViewerPlugIn implements PlugIn
{ {
static String lastDatasetPath = "./export.xml";
@Override @Override
public void run( final String arg ) public void run( final String arg )
{ {
...@@ -24,6 +26,7 @@ public class BigDataViewerPlugIn implements PlugIn ...@@ -24,6 +26,7 @@ public class BigDataViewerPlugIn implements PlugIn
if ( Prefs.useJFileChooser ) if ( Prefs.useJFileChooser )
{ {
final JFileChooser fileChooser = new JFileChooser(); final JFileChooser fileChooser = new JFileChooser();
fileChooser.setSelectedFile( new File( lastDatasetPath ) );
fileChooser.setFileFilter( new FileFilter() fileChooser.setFileFilter( new FileFilter()
{ {
@Override @Override
...@@ -57,6 +60,8 @@ public class BigDataViewerPlugIn implements PlugIn ...@@ -57,6 +60,8 @@ public class BigDataViewerPlugIn implements PlugIn
else // use FileDialog else // use FileDialog
{ {
final FileDialog fd = new FileDialog( ( Frame ) null, "Open", FileDialog.LOAD ); final FileDialog fd = new FileDialog( ( Frame ) null, "Open", FileDialog.LOAD );
fd.setDirectory( new File( lastDatasetPath ).getParent() );
fd.setFile( new File( lastDatasetPath ).getName() );
fd.setFilenameFilter( new FilenameFilter() fd.setFilenameFilter( new FilenameFilter()
{ {
@Override @Override
...@@ -83,6 +88,7 @@ public class BigDataViewerPlugIn implements PlugIn ...@@ -83,6 +88,7 @@ public class BigDataViewerPlugIn implements PlugIn
{ {
try try
{ {
lastDatasetPath = file.getAbsolutePath();
BigDataViewer.view( file.getAbsolutePath(), new ProgressWriterIJ() ); BigDataViewer.view( file.getAbsolutePath(), new ProgressWriterIJ() );
} }
catch ( final Exception e ) catch ( final Exception e )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment