示例#1
0
 static void drawALU(Graphics g, Bounds bds) {
   int wid = bds.getWidth();
   int ht = bds.getHeight();
   int x0 = bds.getX();
   int x1 = x0 + wid;
   int y0 = bds.getY();
   int y1 = y0 + ht;
   int xp[] = {x0, x1, x1, x0, x0, x0 + 20, x0};
   int yp[] = {y0, y0 + 30, y1 - 30, y1, y1 - 40, y1 - 50, y1 - 60};
   GraphicsUtil.switchToWidth(g, 2);
   g.drawPolygon(xp, yp, 7);
 }
示例#2
0
 /**
  * Creates a new rectangle that fits perfectly in the bounding box bounds.
  *
  * @param bounds
  */
 public RectangularShape(Bounds bounds) {
   x = bounds.getX();
   y = bounds.getY();
   width = bounds.getWidth();
   height = bounds.getHeight();
 }