Make all those take "width" and "height".

Before, it was a mix of that and "w" and "h", which lends itself
to problems such as the bug that gets fixed here where Ellipse.setFrame()
was broken because "this.width = width" was a no-op given the method's
argument was "w"
This commit is contained in:
David Hoover
2011-06-10 14:36:45 -07:00
parent e072c6cb57
commit 8cc6f63a11
4 changed files with 7 additions and 9 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ public class Ellipse extends AbstractEllipse implements Serializable
}
@Override // from RectangularShape
public void setFrame (float x, float y, float w, float h) {
public void setFrame (float x, float y, float width, float height) {
this.x = x;
this.y = y;
this.width = width;
+2 -2
View File
@@ -19,13 +19,13 @@ public interface IShape
boolean contains (IPoint point);
/** Returns true if this shape completely contains the specified rectangle. */
boolean contains (float x, float y, float w, float h);
boolean contains (float x, float y, float width, float height);
/** Returns true if this shape completely contains the supplied rectangle. */
boolean contains (IRectangle r);
/** Returns true if this shape intersects the specified rectangle. */
boolean intersects (float x, float y, float w, float h);
boolean intersects (float x, float y, float width, float height);
/** Returns true if this shape intersects the supplied rectangle. */
boolean intersects (IRectangle r);
+3 -5
View File
@@ -27,9 +27,7 @@ public class Rectangle extends AbstractRectangle implements Serializable
* Constructs a rectangle at (0,0) and with dimensions (0,0).
*/
public Rectangle () {
}
/**
} /**
* Constructs a rectangle with the supplied upper-left corner and dimensions (0,0).
*/
public Rectangle (IPoint p) {
@@ -182,7 +180,7 @@ public class Rectangle extends AbstractRectangle implements Serializable
}
@Override // from RectangularShape
public void setFrame (float x, float y, float w, float h) {
setBounds(x, y, w, h);
public void setFrame (float x, float y, float width, float height) {
setBounds(x, y, width, height);
}
}
@@ -13,7 +13,7 @@ public abstract class RectangularShape implements IRectangularShape
/**
* Sets the location and size of the framing rectangle of this shape to the specified values.
*/
public abstract void setFrame (float x, float y, float w, float h);
public abstract void setFrame (float x, float y, float width, float height);
/**
* Sets the location and size of the framing rectangle of this shape to the supplied values.