From 40f08a931412edd1bc0e776033792fe3d4c0a5fa Mon Sep 17 00:00:00 2001 From: jprocter Date: Tue, 17 Mar 2009 16:57:34 +0000 Subject: [PATCH] sortbytree view setting and action added - setting is not yet stored in the jalview xml --- src/jalview/gui/AlignViewport.java | 33 +++++++++++++++-- src/jalview/gui/TreePanel.java | 68 ++++++++++++++++++++++++------------ 2 files changed, 76 insertions(+), 25 deletions(-) diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index b90d89b..19ec9e0 100755 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -184,6 +184,8 @@ public class AlignViewport implements SelectionSource Hashtable hiddenRepSequences; + boolean sortByTree; + /** * Creates a new AlignViewport object. * @@ -374,13 +376,14 @@ public class AlignViewport implements SelectionSource wrapAlignment = jalview.bin.Cache.getDefault("WRAP_ALIGNMENT", false); showUnconserved = jalview.bin.Cache.getDefault("SHOW_UNCONSERVED", false); + sortByTree = jalview.bin.Cache.getDefault("SORT_BY_TREE", false); } /** - * DOCUMENT ME! + * set the flag * * @param b - * DOCUMENT ME! + * features are displayed if true */ public void setShowSequenceFeatures(boolean b) { @@ -2207,4 +2210,30 @@ public class AlignViewport implements SelectionSource { showUnconserved=showunconserved; } + /** + * return the alignPanel containing the given viewport. Use this to get the + * components currently handling the given viewport. + * @param av + * @return null or an alignPanel guaranteed to have non-null alignFrame reference + */ + public AlignmentPanel getAlignPanel() + { + AlignmentPanel[] aps = PaintRefresher.getAssociatedPanels(this.getSequenceSetId()); + AlignmentPanel ap=null; + for (int p=0;aps!=null && p