Package java.awt

Examples of java.awt.Rectangle.grow()


      // LATER: Fix repaint region to be smaller
      if (repaint)
      {
        old = old.union(finderBounds);
        old.grow(3, 3);
        repaint(old);
      }
    }
  }
View Full Code Here


 
      Rectangle rect = new Rectangle();
      rect.add(start.getX(), start.getY());
      rect.add(cur.getX(), cur.getY());
      rect.add(curX, curY);
      rect.grow(3, 3);
 
      cur = Location.create(curX, curY);
      super.mouseDragged(canvas, g, e);
     
      Wire shorten = null;
View Full Code Here

              int x2, int y2,
              int px, int py) {

    Rectangle r = new Rectangle(new Point(x1, y1));
    r.add(x2, y2);
    r.grow(2, 2);
    if (! r.contains(px,py)) {
      return false;
    }

    double a, b, x, y;
View Full Code Here

                Rectangle compBounds = getBounds();
                Rectangle bounds = (Rectangle) compBounds.clone();
                if (mask == null) {
                        mask = /*!Sprite._isTrueVolatile() ? */ new Sprite(SpriteIO.createBufferedImage(getSize(), Sprite.DEFAULT_TYPE), "image/x-png", getSize())/* : new Sprite(Sprite.createVolatileImage(getSize()), "image/x-png", getSize())*/;
                }
                bounds.grow(6 - (int) ((float) bounds.width / 2f), 6 - (int) ((float) bounds.height / 2f));
                g.translate(-compBounds.x, -compBounds.y);
                g.clip(compBounds);
                Color ledColor = Color.WHITE;
                if ((state & ON_STATE) != 0) {
                        g.setColor(ledColor = type == READ ? Color.GREEN.brighter() : Color.RED.brighter());
View Full Code Here

                if (cell instanceof SelectionMenuCell) {
                    if (gui.isDebugEnabled()) {
                        System.err.println("menu cell : " + cell.name);
                    }
                    Rectangle cellBounds = new Rectangle(menuBounds.x, (int) (lastBounds instanceof Rectangle ? lastBounds.getMaxY() : menuBounds.y), menuBounds.width, (int) ((float) menuBounds.height / (float) menu.size()));
                    cellBounds.grow(-PADDING, -(int) ((float) PADDING / 2f));
                    cell.setBounds(cellBounds);
                    cell.GLpaintComponent(gld, z, fx, fx_loc, fx_color);
                    lastBounds = cellBounds;
                }
            }
View Full Code Here

         * collision
         */
        Rectangle2D collision = new Rectangle();
        boolean outOfBounds = false;
        Rectangle paddedBounds = field.getBounds();
        paddedBounds.grow(-1, -1);
        try {
            collision_tag = calcCollision();
        } catch (Exception ex) {
            if (isDebugEnabled()) {
                ex.printStackTrace();
View Full Code Here

        Rectangle2D circleInter = isEllipse ? _intersectCircles((Ellipse2D) one, (Ellipse2D) two) : new Rectangle();
        if (isEllipse ? !circleInter.isEmpty() : two.intersects(one.getBounds2D())) {
            Rectangle2D intersection = isEllipse ? circleInter : two.getBounds2D().createIntersection(one.getBounds2D());
            int outcode = 0;
            Rectangle interOutcode = intersection.getBounds();
            interOutcode.grow(1, 1);
            for (Point p : _get4Coords(interOutcode)) {
                outcode = outcode | one.getBounds2D().outcode(p);
            }
            map.put("intersection", intersection);
            map.put("outcode", outcode);
View Full Code Here

        /**
         * collisions with field bounds
         */
        Rectangle field = new Rectangle(this.field);
        field.grow(1, 1);
        if (shortTag == 0 && !field.contains(bds)) {
            if (field.intersects(bds)) {
                map.putAll(calcCollision(bds, field));
                shortTag = FIGHTERMACHINE_NA;
            } else {
View Full Code Here

            Rectangle rect = new Rectangle();
            rect.add(start.getX(), start.getY());
            rect.add(cur.getX(), cur.getY());
            rect.add(curX, curY);
            rect.grow(3, 3);

            cur = Location.create(curX, curY);
            super.mouseDragged(canvas, g, e);

            Wire shorten = null;
View Full Code Here

      {
         headerRect.width -= 3;    // Hard-coded constant
      }
      else
      {
         headerRect.grow(-3, 0);   // Hard-coded constant
      }

      if (!headerRect.contains(evt.getX(), evt.getY()))
      {
         // Mouse was clicked between column heads
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.