X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FAlignFrame.java;h=1510a14e6c2bfcda582e27ff8b53b97ed787b01c;hb=496a78f25054b4003f6115c7194a2a466c44197f;hp=5c8135d2fde3cb4d8c85379972549030d1563342;hpb=f69e96788c2ae3a08f56c4461d8d197a3b3a06a2;p=jalview.git diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index 5c8135d..1510a14 100644 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -103,6 +103,7 @@ import jalview.structure.StructureSelectionManager; import jalview.structures.models.AAStructureBindingModel; import jalview.util.MappingUtils; import jalview.util.MessageManager; +import jalview.viewmodel.AlignmentViewport; public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemListener, KeyListener, AlignViewControllerGuiI @@ -155,6 +156,20 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, public AlignFrame(AlignmentI al, JalviewLite applet, String title, boolean embedded, boolean addToDisplay) { + this(al, null, null, applet, title, embedded, addToDisplay); + } + + public AlignFrame(AlignmentI al, SequenceI[] hiddenSeqs, + ColumnSelection columnSelection, JalviewLite applet, + String title, boolean embedded) + { + this(al, hiddenSeqs, columnSelection, applet, title, embedded, true); + } + + public AlignFrame(AlignmentI al, SequenceI[] hiddenSeqs, + ColumnSelection columnSelection, JalviewLite applet, + String title, boolean embedded, boolean addToDisplay) + { if (applet != null) { jalviewServletURL = applet.getParameter("APPLICATION_URL"); @@ -190,6 +205,17 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, } } viewport = new AlignViewport(al, applet); + + if (hiddenSeqs != null && hiddenSeqs.length > 0) + { + viewport.hideSequence(hiddenSeqs); + viewport.setHasHiddenRows(true); + } + if (columnSelection != null) + { + viewport.setColumnSelection(columnSelection); + } + alignPanel = new AlignmentPanel(this, viewport); avc = new jalview.controller.AlignViewController(this, viewport, alignPanel); @@ -197,7 +223,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, viewport.updateConsensus(alignPanel); displayNonconservedMenuItem.setState(viewport.getShowUnconserved()); - followMouseOverFlag.setState(viewport.getFollowHighlight()); + followMouseOverFlag.setState(viewport.isFollowHighlight()); showGroupConsensus.setState(viewport.isShowGroupConsensus()); showGroupConservation.setState(viewport.isShowGroupConservation()); showConsensusHistogram.setState(viewport.isShowConsensusHistogram()); @@ -926,7 +952,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, private void mouseOverFlag_stateChanged() { - viewport.followHighlight = followMouseOverFlag.getState(); + viewport.setFollowHighlight(followMouseOverFlag.getState()); // TODO: could kick the scrollTo mechanism to reset view for current // searchresults. } @@ -1312,7 +1338,11 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, jalview.bin.JalviewLite.addFrame(frame, MessageManager.formatMessage( "label.alignment_output_command", new Object[] { e.getActionCommand() }), 600, 500); - cap.setText(new AppletFormatAdapter().formatSequences( + + FeatureRenderer fr = this.alignPanel.cloneFeatureRenderer(); + viewport.setFeatureRenderer(fr); + viewport.setIncludeHiddenRegion(false); + cap.setText(new AppletFormatAdapter(viewport).formatSequences( e.getActionCommand(), viewport.getAlignment(), viewport.getShowJVSuffix())); } @@ -1594,7 +1624,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, viewport.addToRedoList(command); command.undoCommand(null); - AlignViewport originalSource = getOriginatingSource(command); + AlignmentViewport originalSource = getOriginatingSource(command); // JBPNote Test if (originalSource != viewport) { @@ -1626,7 +1656,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, viewport.addToHistoryList(command); command.doCommand(null); - AlignViewport originalSource = getOriginatingSource(command); + AlignmentViewport originalSource = getOriginatingSource(command); // JBPNote Test if (originalSource != viewport) { @@ -1642,9 +1672,9 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, .getAlignment().getSequences()); } - AlignViewport getOriginatingSource(CommandI command) + AlignmentViewport getOriginatingSource(CommandI command) { - AlignViewport originalSource = null; + AlignmentViewport originalSource = null; // For sequence removal and addition, we need to fire // the property change event FROM the viewport where the // original alignment was altered @@ -2541,7 +2571,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, } - void changeColour(ColourSchemeI cs) + public void changeColour(ColourSchemeI cs) { int threshold = 0;