irc.style
Class StyledRectangle

java.lang.Object
  |
  +--irc.style.StyledRectangle

public class StyledRectangle
extends java.lang.Object

A rectangle.


Field Summary
 int height
          Height.
 int width
          Width.
 int x
          X position.
 int y
          Y position.
 
Constructor Summary
StyledRectangle(int x, int y, int w, int h)
          Create a new StyledRectangle.
 
Method Summary
 boolean contains(int px, int py)
          Test wether the given point is inside the rectangle or not.
 boolean equals(java.lang.Object o)
           
 int hashCode()
           
 boolean hit(StyledRectangle r)
          Test wether the given rectangle is partially or fully inside the rectangle or not.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public int x
X position.


y

public int y
Y position.


width

public int width
Width.


height

public int height
Height.

Constructor Detail

StyledRectangle

public StyledRectangle(int x,
                       int y,
                       int w,
                       int h)
Create a new StyledRectangle.

Parameters:
x - x position.
y - y position.
w - width.
Method Detail

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

contains

public boolean contains(int px,
                        int py)
Test wether the given point is inside the rectangle or not.

Parameters:
px - x coordinate of point to test.
py - y coordinate of point to test.
Returns:
true if the point is inside the rectangle, false otherwise.

hit

public boolean hit(StyledRectangle r)
Test wether the given rectangle is partially or fully inside the rectangle or not.

Parameters:
r - rectangle to test.
Returns:
true if r is partially or fully inside the rectangle, false otherwise.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object