示例#1
0
 public void draw(Graphics2D graphic) {
   setForegroundColor(colorString);
   graphic.fill(shape);
   if (text != null) {
     setForegroundColor("black");
     java.awt.Rectangle bounds = shape.getBounds();
     int x = bounds.x + bounds.width / 2;
     int y = bounds.y + bounds.height / 2;
     graphic.drawString(text, x, y);
   }
 }
示例#2
0
 // Graphics2D g=getG();return g==null?null:g.getClip();}
 public Rectangle getClipBounds() {
   Shape s = bufferClip();
   return s == null ? null : s.getBounds();
 }