public void paintIcon(Component c,
Graphics g,
int x,
int y) {
cWidth=c.getWidth()/2;
cHeight=c.getHeight()/2;
rW=glyph.getWidth();
rH=glyph.getHeight();
factor=Math.max(rW/(double)width,rH/(double)height);
trW=(int)Math.round(rW/(factor*2))-2; //-2 so that it leaves a 1 pixel border blank
trH=(int)Math.round(rH/(factor*2))-2; //around it and the component's border
if (glyph.getFillStatus()){
g.setColor(glyph.getColor());
g.fillOval(cWidth-trW,cHeight-trH,2*trW,2*trH);
}
g.setColor(glyph.getColorb());
g.drawOval(cWidth-trW,cHeight-trH,2*trW,2*trH);
}
|