X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FFeatureColour.java;h=71a89b045936865a9d3f365cf785c7ffcc7c3c9e;hb=8ace2707dd1c5cfbb1688efa265fd0afcec35def;hp=df4ea39dcf9c128e8136183e20b8af464bd9edcd;hpb=9bde0814fff97f50e3ac6165a9fb83787c37d39a;p=jalview.git diff --git a/src/jalview/schemes/FeatureColour.java b/src/jalview/schemes/FeatureColour.java index df4ea39..71a89b0 100644 --- a/src/jalview/schemes/FeatureColour.java +++ b/src/jalview/schemes/FeatureColour.java @@ -78,10 +78,10 @@ public class FeatureColour implements FeatureColourI private boolean colourByLabel; /* - * if not null, the value of this named attribute is used for - * colourByLabel or graduatedColour + * if not null, the value of [attribute, [sub-attribute] ...] + * is used for colourByLabel or graduatedColour */ - private String byAttributeName; + private String[] attributeName; private float threshold; @@ -371,7 +371,7 @@ public class FeatureColour implements FeatureColourI base = fc.base; range = fc.range; isHighToLow = fc.isHighToLow; - byAttributeName = fc.byAttributeName; + attributeName = fc.attributeName; setAboveThreshold(fc.isAboveThreshold()); setBelowThreshold(fc.isBelowThreshold()); setThreshold(fc.getThreshold()); @@ -389,7 +389,6 @@ public class FeatureColour implements FeatureColourI public FeatureColour(FeatureColour fc, float min, float max) { this(fc); - setGraduatedColour(true); updateBounds(min, max); } @@ -594,8 +593,8 @@ public class FeatureColour implements FeatureColourI { if (isColourByLabel()) { - String label = byAttributeName == null ? feature.getDescription() - : feature.getValueAsString(byAttributeName); + String label = attributeName == null ? feature.getDescription() + : feature.getValueAsString(attributeName); return label == null ? noColour : ColorUtils .createColourFromName(label); } @@ -612,11 +611,11 @@ public class FeatureColour implements FeatureColourI * no such attribute is assigned the 'no value' colour */ float scr = feature.getScore(); - if (byAttributeName != null) + if (attributeName != null) { try { - String attVal = feature.getValueAsString(byAttributeName); + String attVal = feature.getValueAsString(attributeName); scr = Float.valueOf(attVal); } catch (Throwable e) { @@ -747,19 +746,19 @@ public class FeatureColour implements FeatureColourI @Override public boolean isColourByAttribute() { - return byAttributeName != null; + return attributeName != null; } @Override - public String getAttributeName() + public String[] getAttributeName() { - return byAttributeName; + return attributeName; } @Override - public void setAttributeName(String name) + public void setAttributeName(String... name) { - byAttributeName = name; + attributeName = name; } }