Package java.awt

Examples of java.awt.Rectangle.translate()


                                       r.getMinY()+deltaY);
    }

    public Raster getData(Rectangle rect) {
        Rectangle r = (Rectangle)rect.clone();
        r.translate(-deltaX, -deltaY);
        Raster ret = getSource().getData(r);
        return ret.createTranslatedChild(ret.getMinX()+deltaX,
                                         ret.getMinY()+deltaY);
    }
View Full Code Here


      // For each rectangle in the region to remove
      for (final Rectangle remove : removeRegion.rectangles)
      {
        // Offset the rectangle
        final Rectangle offsetRemove = new Rectangle(remove);
        offsetRemove.translate(offset.x, offset.y);

        // If we've gone past a possible match
        if (offsetRemove.y > y)
        {
          // quit
View Full Code Here

        Rectangle r = (Rectangle)rect.clone();

        if (!r.intersects(getBounds()))
            return null;
        r = r.intersection(getBounds());
        r.translate(-getMinX(), - getMinY());

        Raster ret = bi.getData(r);
        return ret.createTranslatedChild(ret.getMinX()+getMinX(),
                                         ret.getMinY()+getMinY());
    }
View Full Code Here

    if (!Plugins.getInstance().isCardPluginLoaded()) {
      for (UUID attachmentId: permanent.getAttachments()) {
        MagePermanent link = permanents.get(attachmentId);
        if (link != null) {
          perm.getLinks().add(link);
          r.translate(20, 20);
          link.setBounds(r);
          setPosition(link, ++position);
        }
      }
    } else {
View Full Code Here

      for (UUID attachmentId: permanent.getAttachments()) {
        MagePermanent link = permanents.get(attachmentId);
        if (link != null) {
          link.setBounds(r);
          perm.getLinks().add(link);
          r.translate(8, 10);
          perm.setBounds(r);
          moveToFront(link);
          moveToFront(perm);
        }
      }
View Full Code Here

  private void loadCardsFew(CardsView showCards, BigCard bigCard, CardDimensions dimension, UUID gameId) {
    Rectangle rectangle = new Rectangle(Config.dimensions.frameWidth, Config.dimensions.frameHeight);
    for (CardView card: showCards.values()) {
      addCard(card, bigCard, gameId, rectangle, dimension);
      rectangle.translate(Config.dimensions.frameWidth, 0);
    }
    cardArea.setPreferredSize(new Dimension(Config.dimensions.frameWidth * showCards.size(), Config.dimensions.frameHeight));
  }
 
  private void addCard(CardView card, BigCard bigCard, UUID gameId, Rectangle rectangle, CardDimensions dimension) {
View Full Code Here

      Rectangle rectangle = new Rectangle(Config.dimensions.frameWidth, Config.dimensions.frameHeight);
      int count = 0;
      for (CardView card: showCards.values()) {
        addCard(card, bigCard, gameId, rectangle, dimension);
        if (count >= 20) {
          rectangle.translate(Config.dimensions.frameWidth, -400);
          columns++;
          count = 0;
        } else {
          rectangle.translate(0, 20);
          count++;
View Full Code Here

        if (count >= 20) {
          rectangle.translate(Config.dimensions.frameWidth, -400);
          columns++;
          count = 0;
        } else {
          rectangle.translate(0, 20);
          count++;
        }
      }
    }
    cardArea.setPreferredSize(new Dimension(Config.dimensions.frameWidth * columns, Config.dimensions.frameHeight + 400));
View Full Code Here

      Rectangle rectangle = new Rectangle(Config.dimensions.frameWidth, Config.dimensions.frameHeight);
      int count = 0;
      for (CardView card: showCards.values()) {
        addCard(card, bigCard, gameId, rectangle);
        if (count >= 10) {
          rectangle.translate(Config.dimensions.frameWidth, -200);
          count = 0;
        } else {
          rectangle.translate(0, 20);
          count++;
        }
View Full Code Here

        addCard(card, bigCard, gameId, rectangle);
        if (count >= 10) {
          rectangle.translate(Config.dimensions.frameWidth, -200);
          count = 0;
        } else {
          rectangle.translate(0, 20);
          count++;
        }
      }
    }
    cardArea.setPreferredSize(new Dimension(Config.dimensions.frameWidth, Config.dimensions.frameHeight + 200));
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.