brf.j2me.dynaworks.util
Class Rectangle

java.lang.Object
  |
  +--brf.j2me.dynaworks.util.Rectangle

public class Rectangle
extends java.lang.Object

This is a primitive rectangle class.

A rectangle represents an area on the screen and is therefore limited to positive coordinates.

Version:
1.0
Author:
Bernd R. Fix

Field Summary
private  Point lr
          corner point (lower right).
private  Point ul
          corner point (upper left).
 
Constructor Summary
Rectangle(int x, int y, int w, int h)
          constructor from (x,y,w,h)
 
Method Summary
 int getHeight()
          get the height of the rectangle.
 int getWidth()
          get the width of the rectangle.
 int getX()
          get the x-coordinate of the upper-left corner.
 int getY()
          get the y-coordinate of the upper-left corner.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

ul

private Point ul
corner point (upper left).


lr

private Point lr
corner point (lower right).

Constructor Detail

Rectangle

public Rectangle(int x,
                 int y,
                 int w,
                 int h)
constructor from (x,y,w,h)

Parameters:
x - int - x-coordinate of the upper-left corner.
y - int - y-coordinate of the upper-left corner.
w - int - width of the rectangle.
h - int - height of the rectangle.
Method Detail

getX

public int getX()
get the x-coordinate of the upper-left corner.

Returns:
int - x-coordinate

getY

public int getY()
get the y-coordinate of the upper-left corner.

Returns:
int - y-coordinate

getWidth

public int getWidth()
get the width of the rectangle.

Returns:
int - width

getHeight

public int getHeight()
get the height of the rectangle.

Returns:
int - height