X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fappletgui%2FUserDefinedColours.java;h=95e36b5046067e5fed77cf2024e344f699dde3f7;hb=02c0b8687b9932f2b4fe0a9284a47875e0269a7e;hp=106f28959c7c7c180576ced12b0967c88613944f;hpb=db93a1adcbe0a4eaaf06e0a70ade0d6c5c1961c3;p=jalview.git diff --git a/src/jalview/appletgui/UserDefinedColours.java b/src/jalview/appletgui/UserDefinedColours.java index 106f289..95e36b5 100644 --- a/src/jalview/appletgui/UserDefinedColours.java +++ b/src/jalview/appletgui/UserDefinedColours.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2) - * Copyright (C) 2015 The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors * * This file is part of Jalview. * @@ -22,6 +22,7 @@ package jalview.appletgui; import jalview.api.FeatureColourI; import jalview.datamodel.SequenceGroup; +import jalview.renderer.ResidueShader; import jalview.schemes.ColourSchemeI; import jalview.schemes.FeatureColour; import jalview.schemes.ResidueProperties; @@ -93,7 +94,7 @@ public class UserDefinedColours extends Panel implements ActionListener, if (seqGroup != null) { - oldColourScheme = seqGroup.cs; + oldColourScheme = seqGroup.getColourScheme(); } else { @@ -407,14 +408,9 @@ public class UserDefinedColours extends Panel implements ActionListener, { final Button button = new Button(); Color col = Color.white; - if (oldColourScheme != null) + if (oldColourScheme != null && oldColourScheme.isSimple()) { - try - { - col = oldColourScheme.findColour(aa.charAt(0), -1, null); - } catch (Exception ex) - { - } + col = oldColourScheme.findColour(aa.charAt(0), 0, null, null, 0f); } button.setBackground(col); oldColours.addElement(col); @@ -501,20 +497,24 @@ public class UserDefinedColours extends Panel implements ActionListener, } UserColourScheme ucs = new UserColourScheme(newColours); - if (ap != null) - { - ucs.setThreshold(0, ap.av.isIgnoreGapsConsensus()); - } + // if (ap != null) + // { + // ucs.setThreshold(0, ap.av.isIgnoreGapsConsensus()); + // } if (ap != null) { if (seqGroup != null) { - seqGroup.cs = ucs; + seqGroup.cs = new ResidueShader(ucs); + seqGroup.getGroupColourScheme().setThreshold(0, + ap.av.isIgnoreGapsConsensus()); } else { ap.av.setGlobalColourScheme(ucs); + ap.av.getResidueShading().setThreshold(0, + ap.av.isIgnoreGapsConsensus()); } ap.seqPanel.seqCanvas.img = null; ap.paintAlignment(true); @@ -592,7 +592,7 @@ public class UserDefinedColours extends Panel implements ActionListener, { if (seqGroup != null) { - seqGroup.cs = ucs; + seqGroup.cs = new ResidueShader(ucs); } else {