Merge branch 'develop' of https://source.jalview.org/git/jalview into develop
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Wed, 1 Jul 2015 14:23:19 +0000 (15:23 +0100)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Wed, 1 Jul 2015 14:23:19 +0000 (15:23 +0100)
src/jalview/datamodel/Sequence.java
src/jalview/gui/AlignFrame.java
src/jalview/gui/AlignViewport.java
src/jalview/gui/AlignmentPanel.java
src/jalview/util/Platform.java
src/jalview/util/StringUtils.java

index 37bb7a9..c78ec22 100755 (executable)
@@ -20,6 +20,9 @@
  */
 package jalview.datamodel;
 
+import jalview.analysis.AlignSeq;
+import jalview.util.StringUtils;
+
 import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.List;
@@ -27,9 +30,6 @@ import java.util.Vector;
 
 import fr.orsay.lri.varna.models.rna.RNA;
 
-import jalview.analysis.AlignSeq;
-import jalview.util.StringUtils;
-
 /**
  * 
  * Implements the SequenceI interface for a char[] based sequence object.
@@ -768,7 +768,7 @@ public class Sequence extends ASequence implements SequenceI
   public void deleteChars(int i, int j)
   {
     int newstart = start, newend = end;
-    if (i >= sequence.length)
+    if (i >= sequence.length || i < 0)
     {
       return;
     }
index d2e247f..cc900e0 100644 (file)
@@ -1822,9 +1822,14 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
               viewport.getSelectionGroup().getEndRes() + groupAdjustment);
     }
 
+    /*
+     * just extend the last slide command if compatible; but not if in
+     * SplitFrame mode (to ensure all edits are broadcast - JAL-1802)
+     */
     boolean appendHistoryItem = false;
     Deque<CommandI> historyList = viewport.getHistoryList();
-    if (historyList != null
+    boolean inSplitFrame = getSplitViewContainer() != null;
+    if (!inSplitFrame && historyList != null
             && historyList.size() > 0
             && historyList.peek() instanceof SlideSequencesCommand)
     {
index cf82bfe..9eaee20 100644 (file)
@@ -909,6 +909,7 @@ public class AlignViewport extends AlignmentViewport implements
 
     if (openSplitPane)
     {
+      al.alignAs(thisAlignment);
       protein = openSplitFrame(newAlignFrame, thisAlignment,
               protein.getCodonFrames());
     }
index 7228e1b..ad7e75c 100644 (file)
@@ -34,6 +34,7 @@ import jalview.math.AlignmentDimension;
 import jalview.schemes.ResidueProperties;
 import jalview.structure.StructureSelectionManager;
 import jalview.util.MessageManager;
+import jalview.util.Platform;
 
 import java.awt.BorderLayout;
 import java.awt.Color;
@@ -531,12 +532,13 @@ public class AlignmentPanel extends GAlignmentPanel implements
 
       /*
        * Estimate available height in the AlignFrame for alignment +
-       * annotations. Deduct an estimate of 75 for menu bar, scale panel,
+       * annotations. Deduct an estimate for title bar, menu bar, scale panel,
        * hscroll, status bar (as these are not laid out we can't inspect their
-       * actual heights). Insets gives borders including title bar.
+       * actual heights). Insets gives frame borders.
        */
+      int stuff = Platform.isAMac() ? 80 : 100;
       Insets insets = alignFrame.getInsets();
-      int availableHeight = alignFrame.getHeight() - 75 - insets.top
+      int availableHeight = alignFrame.getHeight() - stuff - insets.top
               - insets.bottom;
 
       /*
index 333aff4..b812feb 100644 (file)
@@ -32,13 +32,13 @@ public class Platform
    * 
    * @return true if we do things in a special way.
    */
-  public boolean isAMac()
+  public static boolean isAMac()
   {
     return java.lang.System.getProperty("os.name").indexOf("Mac") > -1;
 
   }
 
-  public boolean isHeadless()
+  public static boolean isHeadless()
   {
     String hdls = java.lang.System.getProperty("java.awt.headless");
 
index 1325ce5..c55d467 100644 (file)
@@ -66,7 +66,7 @@ public class StringUtils
    */
   public static final char[] deleteChars(char[] in, int from, int to)
   {
-    if (from >= in.length)
+    if (from >= in.length || from < 0)
     {
       return in;
     }