(int X, int Y)
| 45 | } |
| 46 | |
| 47 | public boolean contains(int X, int Y) { |
| 48 | int w = this.width; |
| 49 | int h = this.height; |
| 50 | if ((w | h) < 0) { |
| 51 | return false; |
| 52 | } else { |
| 53 | int x = this.x; |
| 54 | int y = this.y; |
| 55 | if (X >= x && Y >= y) { |
| 56 | w += x; |
| 57 | h += y; |
| 58 | return (w < x || w > X) && (h < y || h > Y); |
| 59 | } else { |
| 60 | return false; |
| 61 | } |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | public boolean contains(Rectangle r) { |
| 66 | return this.contains(r.getX(), r.getY(), r.getWidth(), r.getHeight()); |