Ejemplo n.º 1
0
 /**
  * Write the given text string in the current font, centered at <location>.
  *
  * @param location the Point at the center of the text
  * @param s the text
  */
 public static void text(Point2D.Double location, String s) {
   text(location.getX(), location.getY(), s);
 }
Ejemplo n.º 2
0
  /**
   * Draw a filled rectangle of given half width and half height, centred at <location> and rotated
   * by d degrees.
   *
   * @param location the Point at the centre of the rectangle
   * @param halfWidth is half the width of the rectangle
   * @param halfHeight is half the height of the rectangle
   * @param degrees is the rotation of the rectangle with 3 o'clock being 0 degrees and 12 o'clock
   *     being 270 degrees
   * @throws RuntimeException if halfWidth or halfHeight is negative
   */
  public static void filledAngledRectangle(
      Point2D.Double location, double halfWidth, double halfHeight, double degrees) {

    filledAngledRectangle(location.getX(), location.getY(), halfWidth, halfHeight, degrees);
  }
Ejemplo n.º 3
0
 /**
  * Draw a filled square of side length 2r, centred at <location>.
  *
  * @param location the Point at the centre of the square
  * @param r radius is half the length of any side of the square
  * @throws RuntimeException if r is negative
  */
 public static void filledSquare(Point2D.Double location, double r) {
   filledSquare(location.getX(), location.getY(), r);
 }
Ejemplo n.º 4
0
 /**
  * Draw a filled diamond of side length 2r, centred at <location>.
  *
  * @param location the Point at the centre of the square
  * @param r radius is half the length of any side of the diamond
  * @throws RuntimeException if r is negative
  */
 public static void filledDiamond(Point2D.Double location, double r) {
   filledDiamond(location.getX(), location.getY(), r);
 }
Ejemplo n.º 5
0
 /**
  * Draw a circle of radius r, centred at <location>.
  *
  * @param location the Point at the centre of the circle
  * @param r the radius of the circle
  * @throws RuntimeException if the radius of the circle is negative
  */
 public static void circle(Point2D.Double location, double r) {
   circle(location.getX(), location.getY(), r);
 }