X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FTreeCanvas.java;h=9f6551146ba47af4b6d89d653c8bc703656f159a;hb=3eef76298c55f3def21eed2516b5ace4405bed0a;hp=9022182f137f626f2007cf0363d5723f321ba111;hpb=153dd62dc91da13ae732600e6ea55ddbe15eab39;p=jalview.git diff --git a/src/jalview/gui/TreeCanvas.java b/src/jalview/gui/TreeCanvas.java index 9022182..9f65511 100755 --- a/src/jalview/gui/TreeCanvas.java +++ b/src/jalview/gui/TreeCanvas.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6) - * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle + * 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 * * This file is part of Jalview. * @@ -125,7 +125,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, aps[a].av.setSelectionGroup(selected); } - selected.setEndRes(aps[a].av.alignment.getWidth() - 1); + selected.setEndRes(aps[a].av.getAlignment().getWidth() - 1); selected.addOrRemove(sequence, true); } } @@ -851,7 +851,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, for (int a = 0; a < aps.length; a++) { aps[a].av.setSelectionGroup(null); - aps[a].av.alignment.deleteAllGroups(); + aps[a].av.getAlignment().deleteAllGroups(); aps[a].av.sequenceColours = null; } colourGroups(); @@ -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,18 +903,18 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, } else { - cs = ColourSchemeProperty.getColour(sequences, av.alignment - .getWidth(), ColourSchemeProperty.getColourName(av + cs = ColourSchemeProperty.getColour(sg, ColourSchemeProperty.getColourName(av .getGlobalColourScheme())); } - - cs.setThreshold(av.getGlobalColourScheme().getThreshold(), - av.getIgnoreGapsConsensus()); + // cs is null if shading is an annotationColourGradient + if (cs!=null) + { + cs.setThreshold(av.getGlobalColourScheme().getThreshold(), + av.getIgnoreGapsConsensus()); + } } - - SequenceGroup sg = new SequenceGroup(sequences, null, cs, true, true, - false, 0, av.alignment.getWidth() - 1); - + sg.cs=cs; +// sg.recalcConservation(); sg.setName("JTreeGroup:" + sg.hashCode()); sg.setIdColour(col); for (int a = 0; a < aps.length; a++) @@ -925,17 +927,18 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, sg.getStartRes(), sg.getEndRes()); c.calculate(); - c.verdict(false, aps[a].av.ConsPercGaps); + c.verdict(false, aps[a].av.getConsPercGaps()); sg.cs.setConservation(c); } - aps[a].av.alignment.addGroup(sg); + aps[a].av.getAlignment().addGroup(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 } }