git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-2418 source formatting
[jalview.git]
/
src
/
jalview
/
io
/
JalviewFileChooser.java
diff --git
a/src/jalview/io/JalviewFileChooser.java
b/src/jalview/io/JalviewFileChooser.java
index
7ccdaa9
..
c49e34f
100755
(executable)
--- a/
src/jalview/io/JalviewFileChooser.java
+++ b/
src/jalview/io/JalviewFileChooser.java
@@
-21,6
+21,7
@@
//////////////////////////////////////////////////////////////////
package jalview.io;
//////////////////////////////////////////////////////////////////
package jalview.io;
+import jalview.bin.Cache;
import jalview.gui.JvOptionPane;
import jalview.util.MessageManager;
import jalview.util.Platform;
import jalview.gui.JvOptionPane;
import jalview.util.MessageManager;
import jalview.util.Platform;
@@
-64,16
+65,17
@@
public class JalviewFileChooser extends JFileChooser
* @param selected
* @return
*/
* @param selected
* @return
*/
- public static JalviewFileChooser forRead(String directory, String selected)
+ public static JalviewFileChooser forRead(String directory,
+ String selected)
{
List<String> extensions = new ArrayList<String>();
List<String> descs = new ArrayList<String>();
{
List<String> extensions = new ArrayList<String>();
List<String> descs = new ArrayList<String>();
- for (FileFormatI format : FileFormat.values())
+ for (FileFormatI format : FileFormats.getInstance().getFormats())
{
if (format.isReadable())
{
extensions.add(format.getExtensions());
{
if (format.isReadable())
{
extensions.add(format.getExtensions());
- descs.add(format.toString());
+ descs.add(format.getName());
}
}
return new JalviewFileChooser(directory,
}
}
return new JalviewFileChooser(directory,
@@
-96,12
+98,12
@@
public class JalviewFileChooser extends JFileChooser
// with a lambda expression parameter for isReadable/isWritable
List<String> extensions = new ArrayList<String>();
List<String> descs = new ArrayList<String>();
// with a lambda expression parameter for isReadable/isWritable
List<String> extensions = new ArrayList<String>();
List<String> descs = new ArrayList<String>();
- for (FileFormatI format : FileFormat.values())
+ for (FileFormatI format : FileFormats.getInstance().getFormats())
{
if (format.isWritable())
{
extensions.add(format.getExtensions());
{
if (format.isWritable())
{
extensions.add(format.getExtensions());
- descs.add(format.toString());
+ descs.add(format.getName());
}
}
return new JalviewFileChooser(directory,
}
}
return new JalviewFileChooser(directory,
@@
-124,16
+126,14
@@
public class JalviewFileChooser extends JFileChooser
/**
* Constructor for a single choice of file extension and description
*
/**
* Constructor for a single choice of file extension and description
*
- * @param dir
* @param extension
* @param desc
*/
* @param extension
* @param desc
*/
- public JalviewFileChooser(String dir, String extension, String desc)
+ public JalviewFileChooser(String extension, String desc)
{
{
- // TODO inline dir as Cache.getProperty("LAST_DIRECTORY") ? if applet
- // builds ok
- this(dir, new String[] { extension }, new String[] { desc }, desc,
- true);
+ this(Cache.getProperty("LAST_DIRECTORY"), new String[] { extension },
+ new String[]
+ { desc }, desc, true);
}
JalviewFileChooser(String dir, String[] extensions, String[] descs,
}
JalviewFileChooser(String dir, String[] extensions, String[] descs,
@@
-269,7
+269,7
@@
public class JalviewFileChooser extends JFileChooser
format = format.substring(0, parenPos).trim();
try
{
format = format.substring(0, parenPos).trim();
try
{
- return FileFormat.valueOf(format);
+ return FileFormats.getInstance().forName(format);
} catch (IllegalArgumentException e)
{
System.err.println("Unexpected format: " + format);
} catch (IllegalArgumentException e)
{
System.err.println("Unexpected format: " + format);
@@
-373,8
+373,8
@@
public class JalviewFileChooser extends JFileChooser
}
});
}
});
- this.setBorder(new javax.swing.border.TitledBorder(MessageManager
- .getString("label.recently_opened")));
+ this.setBorder(new javax.swing.border.TitledBorder(
+ MessageManager.getString("label.recently_opened")));
final JScrollPane scroller = new JScrollPane(list);
final JScrollPane scroller = new JScrollPane(list);
@@
-400,8
+400,8
@@
public class JalviewFileChooser extends JFileChooser
@Override
public void run()
{
@Override
public void run()
{
- scroller.getHorizontalScrollBar().setValue(
- scroller.getHorizontalScrollBar().getMaximum());
+ scroller.getHorizontalScrollBar()
+ .setValue(scroller.getHorizontalScrollBar().getMaximum());
}
});
}
});