Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## waba.fx
Class Rect

    java.lang.Object
      |
      +--waba.fx.Rect

public final class Rect
extends Object

Rect is a rectangle.

Field Summary
`int` | `height` rectangle height
`static int` | `SAME`
`int` | `width` rectangle width
`int` | `x` x position
`int` | `y` y position

Constructor Summary
`Rect()` Constructs a rectangle with all args = 0.
`Rect(Coord topleft, Coord bottomright)` Constructs a rectangle with the given coords
`Rect(int x, int y, int width, int height)` Constructs a rectangle with the given x, y, width and height.

Method Summary
`boolean` | `contains(int xx, int yy)` returns true if the point xx,yy is inside this rect. added by guich
`boolean` | `equals(Object other)` Returns true if the bounds of this Rect and the given one are the same
`boolean` | `intersects(Rect r)` returns true if this rectangle intersects with the given one
`Rect` | `intersectWith(Rect r)` Modify this Rect by doing the intersection with the given rect.
`Rect` | `modifiedBy(int deltaX, int deltaY, int deltaW, int deltaH)` returns a new rect modified in the specified parameters. you can use the constant SAME so the value is not modified (or use 0).
`void` | `modify(int deltaX, int deltaY, int deltaW, int deltaH)` modifies this rect with the specified parameters. you can use the constant SAME so the value is not modified (or use 0).
`void` | `set(int x, int y, int width, int height)` sets the coords of this rect.
`void` | `set(Rect r)` sets the coords of this rect.
`String` | `toString()` Returns the string representation of the object, that is full_class_name@internal_address_hex.
`void` | `translate(int deltaX, int deltaY)` translates this rect. the new positions will be this.x+xx,this.y+yy.
`Rect` | `unionWith(Rect r)` Modify this Rect by doing an union with the given rect.
`int` | `x2()` returns x+width-1
`int` | `y2()` returns y+height-1

Methods inherited from class java.lang.Object
`getClass, hashCode, notify, wait, wait`

Field Detail

### x

    public int x

  x position

### y

    public int y

  y position

### width

    public int width

  rectangle width

### height

    public int height

  rectangle height

### SAME

    public static final int SAME

Constructor Detail

### Rect

    public Rect()

  Constructs a rectangle with all args = 0.

### Rect

    public Rect(int x,
                int y,
                int width,
                int height)

  Constructs a rectangle with the given x, y, width and height.

### Rect

    public Rect(Coord topleft,
                Coord bottomright)

  Constructs a rectangle with the given coords

Method Detail

### set

    public void set(int x,
                    int y,
                    int width,
                    int height)

  sets the coords of this rect.

### set

    public void set(Rect r)

  sets the coords of this rect.

### contains

    public boolean contains(int xx,
                            int yy)

  returns true if the point xx,yy is inside this rect. added by guich

### toString

    public String toString()

  Description copied from class: Object
  Returns the string representation of the object, that is full_class_name@internal_address_hex. Note that, differently from JDK, the package separator is / instead of .
  Overrides:
    toString in class Object

### translate

    public void translate(int deltaX,
                          int deltaY)

  translates this rect. the new positions will be this.x+xx,this.y+yy.

### modifiedBy

    public Rect modifiedBy(int deltaX,
                           int deltaY,
                           int deltaW,
                           int deltaH)

  returns a new rect modified in the specified parameters. you can use the constant SAME so the value is not modified (or use 0).

### modify

    public void modify(int deltaX,
                       int deltaY,
                       int deltaW,
                       int deltaH)

  modifies this rect with the specified parameters. you can use the constant SAME so the value is not modified (or use 0).

### x2

    public int x2()

  returns x+width-1

### y2

    public int y2()

  returns y+height-1

### intersects

    public boolean intersects(Rect r)

  returns true if this rectangle intersects with the given one

### intersectWith

    public Rect intersectWith(Rect r)

  Modify this Rect by doing the intersection with the given rect. Returns `this`.

### unionWith

    public Rect unionWith(Rect r)

  Modify this Rect by doing an union with the given rect. Returns `this`

### equals

    public boolean equals(Object other)

  Returns true if the bounds of this Rect and the given one are the same
  Overrides:
    equals in class Object

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD