X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FTreeCanvas.java;h=d1003e551d7e290085b1e9b9ca9f7c78722e3abe;hb=59d682209891099d46b960509907c79e3fb276fe;hp=b23fbc278b2ee6a1459617d7df39c749d9344ada;hpb=d053a3c980cf4318b9a19a255f9fc870e74de989;p=jalview.git diff --git a/src/jalview/gui/TreeCanvas.java b/src/jalview/gui/TreeCanvas.java index b23fbc2..d1003e5 100755 --- a/src/jalview/gui/TreeCanvas.java +++ b/src/jalview/gui/TreeCanvas.java @@ -1,13 +1,13 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7) - * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8) + * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle * * This file is part of Jalview. * * Jalview is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - * + * * Jalview is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR @@ -889,6 +889,8 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, } ColourSchemeI cs = null; + SequenceGroup sg = new SequenceGroup(sequences, null, cs, true, true, + false, 0, av.getAlignment().getWidth() - 1); if (av.getGlobalColourScheme() != null) { @@ -901,21 +903,18 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, } else { - cs = ColourSchemeProperty.getColour(sequences, av.getAlignment() - .getWidth(), ColourSchemeProperty.getColourName(av - .getGlobalColourScheme())); + cs = ColourSchemeProperty.getColour(sg, ColourSchemeProperty + .getColourName(av.getGlobalColourScheme())); } // cs is null if shading is an annotationColourGradient - if (cs!=null) + if (cs != null) { cs.setThreshold(av.getGlobalColourScheme().getThreshold(), av.getIgnoreGapsConsensus()); } } - - SequenceGroup sg = new SequenceGroup(sequences, null, cs, true, true, - false, 0, av.getAlignment().getWidth() - 1); - + sg.cs = cs; + // sg.recalcConservation(); sg.setName("JTreeGroup:" + sg.hashCode()); sg.setIdColour(col); for (int a = 0; a < aps.length; a++) @@ -932,14 +931,15 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, sg.cs.setConservation(c); } - aps[a].av.getAlignment().addGroup(sg); + aps[a].av.getAlignment().addGroup(new SequenceGroup(sg)); } } // notify the panel to redo any group specific stuff. for (int a = 0; a < aps.length; a++) { aps[a].updateAnnotation(); - // TODO: JAL-868 - need to ensure view colour change message is broadcast to any Jmols listening in + // TODO: JAL-868 - need to ensure view colour change message is broadcast + // to any Jmols listening in } }