*/
package jalview.appletgui;
+import jalview.analysis.AAFrequency;
import jalview.api.FeatureColourI;
import jalview.datamodel.SequenceGroup;
import jalview.renderer.ResidueShader;
+import jalview.schemes.Blosum62ColourScheme;
import jalview.schemes.ColourSchemeI;
import jalview.schemes.FeatureColour;
+import jalview.schemes.PIDColourScheme;
import jalview.schemes.ResidueProperties;
import jalview.schemes.UserColourScheme;
import jalview.util.MessageManager;
return;
}
- Color[] newColours = new Color[24];
- for (int i = 0; i < 24; i++)
- {
- newColours[i] = oldColours.elementAt(i);
- buttonPanel.getComponent(i).setBackground(newColours[i]);
- }
-
- UserColourScheme ucs = new UserColourScheme(newColours);
-
if (ap != null)
{
if (seqGroup != null)
{
- seqGroup.cs = new ResidueShader(ucs);
+ seqGroup.cs = new ResidueShader(oldColourScheme);
+ if (oldColourScheme instanceof PIDColourScheme
+ || oldColourScheme instanceof Blosum62ColourScheme)
+ {
+ seqGroup.cs.setConsensus(AAFrequency.calculate(
+ seqGroup.getSequences(ap.av.getHiddenRepSequences()), 0,
+ ap.av.getAlignment().getWidth()));
+ }
}
else
{
- ap.av.setGlobalColourScheme(ucs);
+ ap.av.setGlobalColourScheme(oldColourScheme);
}
ap.paintAlignment(true);
}
- else if (jmol != null)
- {
- jmol.setJalviewColourScheme(ucs);
- }
- else if (pdbcanvas != null)
- {
- pdbcanvas.pdb.setColours(ucs);
- }
frame.setVisible(false);
}