Package com.googlecode.jumpnevolve.math

Examples of com.googlecode.jumpnevolve.math.Rectangle


    this.yField.addContentListener(this);
  }

  @Override
  public Rectangle getWantedSize() {
    Rectangle xSize = this.xField.getNeededSize();
    return new Rectangle(Vector.ZERO, Math.max(xSize.width,
        this.yField.getNeededSize().width) + 20, 2 * xSize.height + 5);
  }
View Full Code Here


    return this.mainContainer;
  }

  @Override
  public Rectangle getWantedSize() {
    return new Rectangle(Vector.ZERO, this.parentInterfaceable.getWidth(),
        this.parentInterfaceable.getHeight());
  }
View Full Code Here

      z++;
    }
    float width = (InterfaceButton.BUTTON_DIMENSION + this.distanceBetweenButtons)
        * (this.numberOfButtonsDisplayed + z)
        - this.distanceBetweenButtons;
    return new Rectangle(Vector.ZERO, width,
        InterfaceButton.BUTTON_DIMENSION);
  }
View Full Code Here

  }

  @Override
  public Vector getPositionFor(InterfacePart object) {
    if (this.objects.containsKey(object)) {
      Rectangle place = (Rectangle) this.getNeededSize();
      Vector cell = this.objects.get(object);
      Shape shape = object.getNeededSize();
      int x = (int) (this.getXPosInCell((int) cell.x, (int) cell.y,
          place.width / cols, shape.getXRange()) + place.width / cols
          * cell.x);
 
View Full Code Here

    for (Object object : objectsCopy) {
      Shape size = ((InterfacePart) object).getNeededSize();
      width = Math.max(width, size.getXRange());
      height = Math.max(height, size.getYRange());
    }
    return new Rectangle(Vector.ZERO, width * this.cols, height * this.rows);
  }
 
View Full Code Here

  @Override
  public Rectangle getNeededSize() {
    float width = this.sizeX, height = this.sizeY;
    if (Float.isNaN(width)) {
      Rectangle wanted = this.getWantedSize();
      if (Float.isNaN(height)) {
        width = wanted.width;
        height = wanted.height;
      } else {
        width = wanted.width;
      }
    } else {
      if (Float.isNaN(height)) {
        Rectangle wanted = this.getWantedSize();
        height = wanted.height;
      }
    }
    return new Rectangle(Vector.ZERO, width, height);
  }
View Full Code Here

    }
  }

  @Override
  public Rectangle getNeededSize() {
    return new Rectangle(Vector.ZERO, InterfaceButton.BUTTON_DIMENSION * 2
        + this.textField.getNeededSize().getXRange(),
        InterfaceButton.BUTTON_DIMENSION + 10);
  }
View Full Code Here

  /**
   * @return Die Position des Zentrum dieses Objekts auf der Oberfläche, ohne
   *         die Translation durch die Kamera
   */
  public Vector getCenterVector() {
    Rectangle size = this.getNeededSize();
    return this.parent.getPositionFor(this).add(
        new Vector(size.getDistanceToSide(Shape.LEFT), size
            .getDistanceToSide(Shape.UP)));
  }
View Full Code Here

  }

  @Override
  public Rectangle getNeededSize() {
    if (Font == null) {
      return new Rectangle(Vector.ZERO, this.text.length() * 10, 12);
    } else {
      return new Rectangle(Vector.ZERO, Font.getWidth(text),
          Font.getHeight(text));
    }
  }
View Full Code Here

    }
    for (InterfaceTextButton button : this.buttons) {
      width = Math.max(button.getNeededSize().getXRange(), width);
      height = Math.max(button.getNeededSize().getYRange(), height);
    }
    this.dimensions = new Rectangle(Vector.ZERO, width * 2, height
        * (this.contents.size() + this.buttons.size()));
  }
View Full Code Here

TOP

Related Classes of com.googlecode.jumpnevolve.math.Rectangle

Copyright © 2018 www.massapicom. 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.