Beispiel #1
0
 @Override
 public void paintIcon(ComponentDrawContext c, int x, int y) {
   Graphics g = c.getGraphics();
   if (toolIcon != null) {
     toolIcon.paintIcon(c.getDestination(), g, x + 2, y + 2);
   } else {
     int[] xp = {x + 5, x + 5, x + 9, x + 12, x + 14, x + 11, x + 16};
     int[] yp = {y, y + 17, y + 12, y + 18, y + 18, y + 12, y + 12};
     g.setColor(java.awt.Color.black);
     g.fillPolygon(xp, yp, xp.length);
   }
 }
 public java.awt.Component getDestination() {
   return context.getDestination();
 }
Beispiel #3
0
 //
 // user interface methods
 //
 public void expose(ComponentDrawContext context) {
   java.awt.Component dest = context.getDestination();
   int x0 = e0.getX();
   int y0 = e0.getY();
   dest.repaint(x0 - 5, y0 - 5, e1.getX() - x0 + 10, e1.getY() - y0 + 10);
 }