X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FFileLoader.java;h=3ad74c71ff2bed320f08579b9f1081459f15751f;hb=3a83e3b795ee674956d0ce18b9a89a825f7b5a8e;hp=bbc753b5487cb809ceacd71447cf68512ac2bd85;hpb=ee198b3ca3687f18a2ee186f4e7c7330f4ea30f0;p=jalview.git diff --git a/src/jalview/io/FileLoader.java b/src/jalview/io/FileLoader.java index bbc753b..3ad74c7 100755 --- a/src/jalview/io/FileLoader.java +++ b/src/jalview/io/FileLoader.java @@ -34,6 +34,7 @@ import jalview.gui.AlignFrame; import jalview.gui.AlignViewport; import jalview.gui.Desktop; import jalview.gui.Jalview2XML; +import jalview.gui.JvOptionPane; import jalview.json.binding.biojson.v1.ColourSchemeMapper; import jalview.schemes.ColourSchemeI; import jalview.structure.StructureSelectionManager; @@ -42,7 +43,6 @@ import jalview.util.MessageManager; import java.util.StringTokenizer; import java.util.Vector; -import javax.swing.JOptionPane; import javax.swing.SwingUtilities; public class FileLoader implements Runnable @@ -258,10 +258,8 @@ public class FileLoader implements Runnable // just in case the caller didn't identify the file for us if (source != null) { - format = new IdentifyFile().identify(source, false); // identify - // stream and - // rewind rather - // than close + format = new IdentifyFile().identify(source, false); + // identify stream and rewind rather than close } else { @@ -277,13 +275,13 @@ public class FileLoader implements Runnable + "\" has null or unidentifiable data content!"); if (!Jalview.isHeadlessMode()) { - javax.swing.JOptionPane.showInternalMessageDialog( + JvOptionPane.showInternalMessageDialog( Desktop.desktop, MessageManager.getString("label.couldnt_read_data") + " in " + file + "\n" + AppletFormatAdapter.SUPPORTED_FORMATS, MessageManager.getString("label.couldnt_read_data"), - JOptionPane.WARNING_MESSAGE); + JvOptionPane.WARNING_MESSAGE); } return; } @@ -300,7 +298,7 @@ public class FileLoader implements Runnable loadtime = -System.currentTimeMillis(); AlignmentI al = null; - if (format == FileFormat.Jalview) + if (FileFormat.Jalview.equals(format)) { if (source != null) { @@ -319,7 +317,7 @@ public class FileLoader implements Runnable if (source != null) { // read from the provided source - al = new FormatAdapter().readFromFile(source, format); + al = new FormatAdapter().readFromFile(source, format); } else { @@ -457,10 +455,10 @@ public class FileLoader implements Runnable @Override public void run() { - JOptionPane.showInternalMessageDialog(Desktop.desktop, + JvOptionPane.showInternalMessageDialog(Desktop.desktop, errorMessage, MessageManager .getString("label.error_loading_file"), - JOptionPane.WARNING_MESSAGE); + JvOptionPane.WARNING_MESSAGE); } }); } @@ -484,12 +482,12 @@ public class FileLoader implements Runnable @Override public void run() { - javax.swing.JOptionPane.showInternalMessageDialog( + JvOptionPane.showInternalMessageDialog( Desktop.desktop, MessageManager.formatMessage( "label.problems_opening_file", new String[] { file }), MessageManager .getString("label.file_open_error"), - javax.swing.JOptionPane.WARNING_MESSAGE); + JvOptionPane.WARNING_MESSAGE); } }); } @@ -506,12 +504,12 @@ public class FileLoader implements Runnable @Override public void run() { - javax.swing.JOptionPane.showInternalMessageDialog( + JvOptionPane.showInternalMessageDialog( Desktop.desktop, MessageManager.formatMessage( "warn.out_of_memory_loading_file", new String[] { file }), MessageManager .getString("label.out_of_memory"), - javax.swing.JOptionPane.WARNING_MESSAGE); + JvOptionPane.WARNING_MESSAGE); } }); }