From 606f571bec04e3163d136056ae3453b568336feb Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 18 Feb 2011 17:24:29 +0000 Subject: [PATCH] JAL-779 and some redraw refinements --- src/jalview/gui/AlignFrame.java | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index f79afca..e9b0873 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -754,7 +754,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, progressBars.put(lId, progressPanel); } // update GUI - setMenusForViewport(); + // setMenusForViewport(); validate(); } @@ -3723,18 +3723,20 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, sortByTreeMenu.add(item); } } + public boolean sortBy(AlignmentOrder alorder, String undoname) { - SequenceI[] oldOrder = viewport.getAlignment() - .getSequencesArray(); + SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray(); AlignmentSorter.sortBy(viewport.getAlignment(), alorder); - if (undoname!=null) + if (undoname != null) { - addHistoryItem(new OrderCommand(undoname, oldOrder, viewport.alignment)); + 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. @@ -4388,7 +4390,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, featuresFile = new FeaturesFile(file, type) .parse(viewport.alignment.getDataset(), alignPanel.seqPanel.seqCanvas.getFeatureRenderer().featureColours, - false,jalview.bin.Cache.getDefault("RELAXEDSEQIDMATCHING", false)); + false, jalview.bin.Cache.getDefault( + "RELAXEDSEQIDMATCHING", false)); } catch (Exception ex) { ex.printStackTrace(); @@ -5041,6 +5044,26 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, alignPanel.paintAlignment(true); } } + + /** + * make the given alignmentPanel the currently selected tab + * + * @param alignmentPanel + */ + public void setDisplayedView(AlignmentPanel alignmentPanel) + { + if (!viewport.getSequenceSetId().equals( + alignmentPanel.av.getSequenceSetId())) + { + throw new Error( + "Implementation error: cannot show a view from another alignment in an AlignFrame."); + } + if (tabbedPane != null + & alignPanels.indexOf(alignmentPanel) != tabbedPane.getSelectedIndex()) + { + tabbedPane.setSelectedIndex(alignPanels.indexOf(alignmentPanel)); + } + } } class PrintThread extends Thread -- 1.7.10.2