*/
package jalview.datamodel;
+import jalview.analysis.AlignSeq;
+import jalview.util.StringUtils;
+
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
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.
public void deleteChars(int i, int j)
{
int newstart = start, newend = end;
- if (i >= sequence.length)
+ if (i >= sequence.length || i < 0)
{
return;
}
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)
{
if (openSplitPane)
{
+ al.alignAs(thisAlignment);
protein = openSplitFrame(newAlignFrame, thisAlignment,
protein.getCodonFrames());
}
import jalview.schemes.ResidueProperties;
import jalview.structure.StructureSelectionManager;
import jalview.util.MessageManager;
+import jalview.util.Platform;
import java.awt.BorderLayout;
import java.awt.Color;
/*
* 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;
/*
*
* @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");
*/
public static final char[] deleteChars(char[] in, int from, int to)
{
- if (from >= in.length)
+ if (from >= in.length || from < 0)
{
return in;
}