boolean result = true ;
int curX = 0;
//while (!oObj.containsPoint(new Point(curX, bounds.Y)) && curX < bounds.Width+bounds.X) {
while (!oObj.containsPoint(new Point(curX, 0)) && curX < bounds.Width) {
curX++;
};
//if ((bounds.X <= curX) && (curX < bounds.Width+bounds.X)) {
if (curX < bounds.Width) {
log.println("Upper bound of box contains point ("
+ curX + ",0) - OK");
} else {
log.println
("Upper bound of box contains no component points - FAILED");
result = false;
}
curX = 0;
//while (!oObj.containsPoint(new Point(curX, bounds.Y+bounds.Height - 1))
while (!oObj.containsPoint(new Point(curX, bounds.Height - 1))
&& curX < bounds.Width) {
log.println("Contains returns false for ("+curX+","+bounds.Height+")");
curX++;
};
//if ((bounds.X <= curX) && (curX < bounds.Width+bounds.X)) {
if (curX < bounds.Width) {
log.println("Lower bound of box contains point ("
+ curX + "," + (bounds.Height - 1) + ") - OK");
} else {
log.println
("Lower bound of box contains no component points - FAILED");
result = false;
}
int curY = 0;
//while (!oObj.containsPoint(new Point(bounds.X, curY)) && curY < bounds.Height+bounds.Y) {
while (!oObj.containsPoint(new Point(0, curY)) && curY < bounds.Height) {
curY++;
};
//if ((bounds.Y <= curY) && (curY < bounds.Height+bounds.Y)) {
if (curY < bounds.Height) {
log.println("Left bound of box contains point (0,"
+ curY + ") - OK");
} else {
log.println
("Left bound of box contains no component points - FAILED");
result = false;
}
curY = 0;
//while (!oObj.containsPoint(new Point(bounds.X+bounds.Width - 1, curY))
// && curY < bounds.Height+bounds.Y) {
while (!oObj.containsPoint(new Point(bounds.Width - 1, curY)) && curY < bounds.Height) {
curY++;
};
//if ((bounds.Y <= curY) && (curY < bounds.Height + bounds.Y)) {
if (curY < bounds.Height) {
log.println("Right bound of box contains point ("
+ (bounds.Width - 1) + "," + curY + ") - OK");
} else {
log.println
("Right bound of box contains no component points - FAILED");
result = false;
}
boolean locRes = true;
for (int x = -1; x <= bounds.Width; x++) {
locRes &= !oObj.containsPoint(new Point(x, -1));
locRes &= !oObj.containsPoint(new Point(x, bounds.Height+bounds.Y));
}
if (locRes) {
log.println("Outer upper and lower bounds contain no component "
+ "points - OK");
} else {
log.println("Outer upper and lower bounds CONTAIN some component "
+ "points - FAILED");
result = false;
}
locRes = true;
for (int y = -1; y <= bounds.Height; y++) {
locRes &= !oObj.containsPoint(new Point(-1, y));
locRes &= !oObj.containsPoint(new Point(bounds.X+bounds.Width, y));
}
if (locRes) {
log.println("Outer left and right bounds contain no component "
+ "points - OK");
} else {