+ jalview.schemabinding.version2.Colour newcol = jucs.getColour(i);
+ if (newcol.hasMax())
+ {
+ Color mincol = null, maxcol = null;
+ try
+ {
+ mincol = new Color(Integer.parseInt(newcol.getMinRGB(), 16));
+ maxcol = new Color(Integer.parseInt(newcol.getRGB(), 16));
+
+ } catch (Exception e)
+ {
+ Cache.log.warn("Couldn't parse out graduated feature color.",
+ e);
+ }
+ GraduatedColor gcol = new GraduatedColor(mincol, maxcol,
+ newcol.getMin(), newcol.getMax());
+ if (newcol.hasAutoScale())
+ {
+ gcol.setAutoScaled(newcol.getAutoScale());
+ }
+ if (newcol.hasColourByLabel())
+ {
+ gcol.setColourByLabel(newcol.getColourByLabel());
+ }
+ if (newcol.hasThreshold())
+ {
+ gcol.setThresh(newcol.getThreshold());
+ gcol.setThreshType(AnnotationColourGradient.NO_THRESHOLD); // default
+ }
+ if (newcol.getThreshType().length() > 0)
+ {
+ String ttyp = newcol.getThreshType();
+ if (ttyp.equalsIgnoreCase("NONE"))
+ {
+ gcol.setThreshType(AnnotationColourGradient.NO_THRESHOLD);
+ }
+ if (ttyp.equalsIgnoreCase("ABOVE"))
+ {
+ gcol.setThreshType(AnnotationColourGradient.ABOVE_THRESHOLD);
+ }
+ if (ttyp.equalsIgnoreCase("BELOW"))
+ {
+ gcol.setThreshType(AnnotationColourGradient.BELOW_THRESHOLD);
+ }
+ }
+ fr.setColour(name = newcol.getName(), gcol);
+ }
+ else
+ {
+ fr.setColour(name = jucs.getColour(i).getName(), new Color(
+ Integer.parseInt(jucs.getColour(i).getRGB(), 16)));
+ }