relaxed ID matching parameter JAL-753 and sortBy JAL-754
authorjprocter <Jim Procter>
Fri, 21 Jan 2011 17:07:31 +0000 (17:07 +0000)
committerjprocter <Jim Procter>
Fri, 21 Jan 2011 17:07:31 +0000 (17:07 +0000)
src/jalview/appletgui/AlignFrame.java
src/jalview/gui/AlignFrame.java

index 1496595..bad7848 100755 (executable)
@@ -17,7 +17,6 @@
  */
 package jalview.appletgui;
 
-import java.io.*;
 import java.net.*;
 import java.util.*;
 
@@ -167,7 +166,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
       featuresFile = new jalview.io.FeaturesFile(file, type)
               .parse(viewport.alignment,
                       alignPanel.seqPanel.seqCanvas.getFeatureRenderer().featureColours,
-                      featureLinks, true);
+                      featureLinks, true, viewport.applet.getDefaultParameter("relaxedidmatch", false));
     } catch (Exception ex)
     {
       ex.printStackTrace();
@@ -2454,7 +2453,22 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
       };
     });
   }
-
+  public boolean sortBy(AlignmentOrder alorder, String undoname)
+  {
+    SequenceI[] oldOrder = viewport.getAlignment()
+    .getSequencesArray();
+    if (viewport.applet.debug)
+    {
+      System.err.println("Sorting "+alorder.getOrder().size()+" in alignment '"+getTitle()+"'");
+    }
+    AlignmentSorter.sortBy(viewport.getAlignment(), alorder);
+    if (undoname!=null)
+    {
+      addHistoryItem(new OrderCommand(undoname, oldOrder, viewport.alignment));
+    }
+    alignPanel.paintAlignment(true);
+    return true;
+  }
   protected void documentation_actionPerformed()
   {
     showURL("http://www.jalview.org/help.html", "HELP");
index f74d05e..f79afca 100755 (executable)
@@ -3723,7 +3723,18 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       sortByTreeMenu.add(item);
     }
   }
-
+  public boolean sortBy(AlignmentOrder alorder, String undoname)
+  {
+    SequenceI[] oldOrder = viewport.getAlignment()
+    .getSequencesArray();
+    AlignmentSorter.sortBy(viewport.getAlignment(), alorder);
+    if (undoname!=null)
+    {
+      addHistoryItem(new OrderCommand(undoname, oldOrder, viewport.alignment));
+    }
+    alignPanel.paintAlignment(true);
+    return true;
+  }
   /**
    * Work out whether the whole set of sequences or just the selected set will
    * be submitted for multiple alignment.
@@ -4377,7 +4388,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       featuresFile = new FeaturesFile(file, type)
               .parse(viewport.alignment.getDataset(),
                       alignPanel.seqPanel.seqCanvas.getFeatureRenderer().featureColours,
-                      false);
+                      false,jalview.bin.Cache.getDefault("RELAXEDSEQIDMATCHING", false));
     } catch (Exception ex)
     {
       ex.printStackTrace();