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;
base = fc.base;
range = fc.range;
isHighToLow = fc.isHighToLow;
- byAttributeName = fc.byAttributeName;
+ attributeName = fc.attributeName;
setAboveThreshold(fc.isAboveThreshold());
setBelowThreshold(fc.isBelowThreshold());
setThreshold(fc.getThreshold());
public FeatureColour(FeatureColour fc, float min, float max)
{
this(fc);
- setGraduatedColour(true);
updateBounds(min, max);
}
{
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);
}
* 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)
{
@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;
}
}