import jalview.analysis.AlignmentSorter;
import jalview.api.AlignViewControllerGuiI;
import jalview.api.AlignViewControllerI;
+import jalview.api.AlignViewportI;
import jalview.api.FeatureRenderer;
import jalview.api.SequenceStructureBinding;
import jalview.bin.JalviewLite;
import jalview.schemes.ZappoColourScheme;
import jalview.structure.StructureSelectionManager;
import jalview.structures.models.AAStructureBindingModel;
+import jalview.util.MappingUtils;
import jalview.util.MessageManager;
import java.awt.BorderLayout;
return originalSource;
}
+ /**
+ * Move the currently selected sequences up or down one position in the
+ * alignment
+ *
+ * @param up
+ */
public void moveSelectedSequences(boolean up)
{
SequenceGroup sg = viewport.getSelectionGroup();
viewport.getAlignment().moveSelectedSequencesByOne(sg,
up ? null : viewport.getHiddenRepSequences(), up);
alignPanel.paintAlignment(true);
+
+ /*
+ * Also move cDNA/protein complement sequences
+ */
+ AlignViewportI complement = viewport.getCodingComplement();
+ if (complement != null)
+ {
+ SequenceGroup mappedSelection = MappingUtils.mapSequenceGroup(sg,
+ viewport, complement);
+ complement.getAlignment().moveSelectedSequencesByOne(mappedSelection,
+ up ? null : complement.getHiddenRepSequences(), up);
+ // TODO need to trigger a repaint of the complementary panel - how?
+ // would prefer to handle in SplitFrame but it is not overriding key
+ // listener chiz
+ }
}
synchronized void slideSequences(boolean right, int size)
av.setColumnSelection(cs);
av.isColSelChanged(true);
- firePropertyChange("alignment", null, av.getAlignment().getSequences());
- // PaintRefresher.Refresh(this, av.getSequenceSetId());
+ ap.scalePanelHolder.repaint();
+ ap.repaint();
return true;
}
import jalview.structure.StructureSelectionManager;
import java.awt.BorderLayout;
+import java.awt.Component;
import java.awt.GridLayout;
+import java.awt.MouseInfo;
import java.awt.Panel;
+import java.awt.Point;
+import java.awt.Rectangle;
public class SplitFrame extends EmbmenuFrame
{
*/
public void init()
{
- setMenuBar(null);
- outermost = new Panel(new GridLayout(2, 1));
-
- Panel topPanel = new Panel();
- Panel bottomPanel = new Panel();
- outermost.add(topPanel);
- outermost.add(bottomPanel);
-
- addAlignFrameComponents(topFrame, topPanel);
- addAlignFrameComponents(bottomFrame, bottomPanel);
+ constructSplit();
/*
* Try to make and add dna/protein sequence mappings
ssm.addCommandListener(protein);
}
- /*
- * Expand protein to 3 times character width of dna
- */
+ setCharacterWidth(protein, cdna);
+ }
+
+ /**
+ *
+ */
+ protected void constructSplit()
+ {
+ setMenuBar(null);
+ outermost = new Panel(new GridLayout(2, 1));
+
+ Panel topPanel = new Panel();
+ Panel bottomPanel = new Panel();
+ outermost.add(topPanel);
+ outermost.add(bottomPanel);
+
+ addAlignFrameComponents(topFrame, topPanel);
+ addAlignFrameComponents(bottomFrame, bottomPanel);
+ }
+
+ /**
+ * Expand protein to 3 times character width of dna
+ *
+ * @param protein
+ * @param cdna
+ */
+ protected void setCharacterWidth(AlignViewport protein, AlignViewport cdna)
+ {
if (protein != null && cdna != null)
{
ViewStyleI vs = protein.getViewStyle();
vs.setCharWidth(3 * vs.getCharWidth());
protein.setViewStyle(vs);
}
-
}
/**