*/
public class GraduatedColor
{
+ private static final Color[] colours = new Color[] { Color.blue,
+ Color.red };
+
+ private static int colourModulus = 0;
+
int thresholdState = AnnotationColourGradient.NO_THRESHOLD; // or
// ABOVE_THRESHOLD
// or
thrsh = oldcs.thrsh;
autoScale = oldcs.autoScale;
colourByLabel = oldcs.colourByLabel;
+ colourAlternately = oldcs.colourAlternately;
}
/**
private boolean colourByLabel = false;
+ private boolean colourAlternately = false;
+
/**
*
* @return true if colourByLabel style is set
}
return ucs.createColourFromName(feature.getDescription());
}
+ if (colourAlternately)
+ {
+ int minOrMax = feature.getFeatureNumber() % 2;
+ return minOrMax == 0 ? new Color(lr, lg, lb) : new Color(lr + dr, lg
+ + dg, lb + db);
+ }
if (range == 0.0)
{
return getMaxColor();
tolow = false;
}
}
+
+ public boolean isColourAlternately()
+ {
+ return colourAlternately;
+ }
+
+ public void setColourAlternately(boolean colourAlternately)
+ {
+ this.colourAlternately = colourAlternately;
+ }
}