thresholdState = oldcs.thresholdState;
thrsh = oldcs.thrsh;
autoScale = oldcs.autoScale;
+ colourByLabel = oldcs.colourByLabel;
}
/**
* make a new gradient from an old one with a different scale range
return rtn; // ? tolow : !tolow;
}
}
+ /**
+ * default implementor of a getColourFromString method.
+ * TODO: abstract an interface enabling pluggable colour from string
+ */
+ private UserColourScheme ucs = null;
+ private boolean colourByLabel=true;
+ /**
+ *
+ * @return true if colourByLabel style is set
+ */
+ public boolean isColourByLabel()
+ {
+ return colourByLabel;
+ }
+ /**
+ * @param colourByLabel the colourByLabel to set
+ */
+ public void setColourByLabel(boolean colourByLabel)
+ {
+ this.colourByLabel = colourByLabel;
+ }
public Color findColor(SequenceFeature feature)
- {
+ {
+ if (colourByLabel)
+ {
+ //TODO: allow user defined feature label colourschemes. Colour space is {type,regex,%anytype%}x{description string, regex, keyword}
+ if (ucs==null)
+ {
+ ucs = new UserColourScheme();
+ }
+ return ucs.createColourFromName(feature.getDescription());
+ }
if (range==0.0)
{
return getMaxColor();