JAL-1443 modified exception notifications
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Thu, 30 Jul 2015 10:32:27 +0000 (11:32 +0100)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Thu, 30 Jul 2015 10:32:27 +0000 (11:32 +0100)
resources/lang/Messages.properties
src/jalview/datamodel/Alignment.java
src/jalview/gui/CutAndPasteTransfer.java
src/jalview/gui/StructureChooser.java
src/jalview/io/FileLoader.java

index 822d574..f5e07be 100644 (file)
@@ -1246,7 +1246,4 @@ info.enter_search_text_to_enable = Enter Search Text to Enable
 info.search_in_annotation_label = Search in {0} Label
 info.search_in_annotation_description = Search in {0} Description
 info.change_threshold_mode_to_enable = Change Threshold Mode to Enable
-label.null_or_unidentifiable_data = Null or unidentifiable data content pasted!
-label.unidentifiable_data = Unidentifiable Data
-label.null_or_invalid_alignment = Null or invalid alignment data!
-label.unable_to_create_alignment = Unable to create alignment
+label.couldnt_read_data = Couldn't read data
\ No newline at end of file
index 15df67b..5d1fc60 100755 (executable)
@@ -1741,7 +1741,7 @@ public class Alignment implements AlignmentI
     boolean hasValidSeq = false;
     for (SequenceI seq : getSequences())
     {
-      if (seq.getSequenceAsString().matches("(-*[a-zA-Z]-*){1}[a-zA-Z-]*"))
+      if ((seq.getEnd() - seq.getStart()) > 0)
       {
         hasValidSeq = true;
         break;
index e08bfcd..cd5c792 100644 (file)
@@ -28,6 +28,7 @@ import jalview.bin.Jalview;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.ColumnSelection;
 import jalview.datamodel.SequenceI;
+import jalview.io.AppletFormatAdapter;
 import jalview.io.FileParse;
 import jalview.io.FormatAdapter;
 import jalview.io.IdentifyFile;
@@ -206,14 +207,13 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer
     if (format == null || format.equalsIgnoreCase("EMPTY DATA FILE"))
     {
       System.err.println(MessageManager
-              .getString("label.null_or_unidentifiable_data"));
+              .getString("label.couldnt_read_data"));
       if (!Jalview.isHeadlessMode())
       {
-        JOptionPane.showMessageDialog(null,
- MessageManager
-                .getString("label.null_or_unidentifiable_data"),
-                MessageManager.getString("label.unidentifiable_data"),
-                JOptionPane.ERROR_MESSAGE);
+        javax.swing.JOptionPane.showInternalMessageDialog(Desktop.desktop,
+                AppletFormatAdapter.SUPPORTED_FORMATS,
+                MessageManager.getString("label.couldnt_read_data"),
+                JOptionPane.WARNING_MESSAGE);
       }
       return;
     }
@@ -295,17 +295,13 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer
     else
     {
       System.err.println(MessageManager
-              .getString("label.null_or_invalid_alignment"));
+              .getString("label.couldnt_read_data"));
       if (!Jalview.isHeadlessMode())
       {
-        JOptionPane
-                .showMessageDialog(
-                        null,
-                        MessageManager
-                                .getString("label.null_or_invalid_alignment"),
-                        MessageManager
-                                .getString("label.unable_to_create_alignment"),
-                        JOptionPane.ERROR_MESSAGE);
+        javax.swing.JOptionPane.showInternalMessageDialog(Desktop.desktop,
+                AppletFormatAdapter.SUPPORTED_FORMATS,
+                MessageManager.getString("label.couldnt_read_data"),
+                JOptionPane.WARNING_MESSAGE);
       }
     }
   }
index 7c09266..3540cfc 100644 (file)
@@ -309,7 +309,6 @@ public class StructureChooser extends GStructureChooser
         {
           seqRefs.add(getDBRefId(dbRef));
         }
-        // seqRefs.add(getDBRefId(dbRef));
         ++count;
         if (count > 10)
         {
index 73c10df..0705422 100755 (executable)
@@ -268,10 +268,13 @@ public class FileLoader implements Runnable
                 + "\" has null or unidentifiable data content!");
         if (!Jalview.isHeadlessMode())
         {
-          JOptionPane.showMessageDialog(null, "The input file \"" + file
-                  + "\" has null or unidentifiable data content!",
-                  "Empty data file",
-                  JOptionPane.ERROR_MESSAGE);
+          javax.swing.JOptionPane.showInternalMessageDialog(
+                  Desktop.desktop,
+                  MessageManager.getString("label.couldnt_read_data")
+                          + " in " + file + "\n"
+                          + AppletFormatAdapter.SUPPORTED_FORMATS,
+                  MessageManager.getString("label.couldnt_read_data"),
+                  JOptionPane.WARNING_MESSAGE);
         }
         return;
       }