tx += "Label";
comp.setIcon(null);
}
+ // else if (gcol.isColourAlternately())
+ // {
+ // tt = "Coloured alternately " + tt;
+ // if (thr)
+ // {
+ // tx += " ";
+ // }
+ // tx += "Alternately";
+ // comp.setIcon(null);
+ // }
else
{
Color newColor = gcol.getMaxColor();
comp.setBackground(newColor);
- // System.err.println("Width is " + w / 2);
Icon ficon = new FeatureIcon(gcol, comp.getBackground(), w, h, thr);
comp.setIcon(ficon);
- // tt+="RGB value: Max (" + newColor.getRed() + ", "
- // + newColor.getGreen() + ", " + newColor.getBlue()
- // + ")\nMin (" + minCol.getRed() + ", " + minCol.getGreen()
- // + ", " + minCol.getBlue() + ")");
}
comp.setHorizontalAlignment(SwingConstants.CENTER);
comp.setText(tx);
width = w;
height = h;
midspace = mspace;
- if (midspace)
+ if (midspace || gcol.isColourAlternately())
{
s1 = width / 3;
e1 = s1 * 2;
g.drawString(MessageManager.getString("label.label"), 0, 0);
}
+ else if (gcol.isColourAlternately())
+ {
+ Color minCol = gcol.getMinColor();
+ g.setColor(minCol);
+ g.fillRect(0, 0, s1, height);
+ g.setColor(gcol.getMaxColor());
+ g.fillRect(s1, 0, e1 - s1, height);
+ g.setColor(minCol);
+ g.fillRect(e1, 0, width - e1, height);
+ }
else
{
Color minCol = gcol.getMinColor();
g.fillRect(s1, 0, e1 - s1, height);
}
g.setColor(gcol.getMaxColor());
- g.fillRect(0, e1, width - e1, height);
+ g.fillRect(e1, 0, width - e1, height);
+ // this is wrong but works - why??
+ // g.fillRect(0, e1, width - e1, height);
}
}
}