java.lang.Object
|
+--java.awt.geom.RectangularShape
|
+--java.awt.geom.Rectangle2D
|
+--java.awt.Rectangle
|
+--Box3D
Box3D.java - Creates an object that represents a 3d box by extending the java.awt.Rectangle class.
| Inner classes inherited from class java.awt.geom.Rectangle2D |
java.awt.geom.Rectangle2D.Double, java.awt.geom.Rectangle2D.Float |
| Fields inherited from class java.awt.Rectangle |
height, width, x, y |
| Fields inherited from class java.awt.geom.Rectangle2D |
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP |
| Constructor Summary | |
Box3D(int x,
int y,
int z,
int width,
int height,
int depth)
Constructs a new 3dBox whose front-upper-left corner is at (x,y,z), with width, height and depth specified. |
|
| Method Summary | |
boolean |
contains(Box3D box)
Determine if the 3dBox is within this 3dBox. |
boolean |
contains(int x,
int y,
int z)
Determines if the point (x,y,z) is within the box. |
boolean |
equals(Box3D box)
Determines if this box the specified box are equal. |
int |
getDepth()
Returns the depth of the 3d box. |
int |
getVolume()
Compute the volume of the 3D box. |
int |
getZ()
Returns the z coordinate of the 3d box. |
void |
setLocation(int x,
int y,
int z)
Set the location of the box. |
void |
setSize(int width,
int height,
int depth)
Set the size of the box. |
java.lang.String |
toString()
Returns a Sring representing this 3 dimensional box. |
| Methods inherited from class java.awt.Rectangle |
|
| Methods inherited from class java.awt.geom.Rectangle2D |
add, add, add, contains, contains, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, setRect, union |
| Methods inherited from class java.awt.geom.RectangularShape |
clone, contains, contains, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.awt.Shape |
contains, contains, contains, contains, getPathIterator, getPathIterator, intersects, intersects |
| Constructor Detail |
public Box3D(int x,
int y,
int z,
int width,
int height,
int depth)
x - x coordinate of front-upper-left corner.y - y coordinate of front-upper-left corner.z - z coordinate of front-upper-left corner.width - width of the box.height - height of the box.depth - depth of the box.| Method Detail |
public boolean contains(Box3D box)
public boolean contains(int x,
int y,
int z)
public boolean equals(Box3D box)
public int getDepth()
public int getVolume()
public int getZ()
public void setLocation(int x,
int y,
int z)
x - x coordinate of front-upper-left corner.y - y coordinate of front-upper-left corner.z - z coordinate of front-upper-left corner.
public void setSize(int width,
int height,
int depth)
width - width of the box.height - height of the box.depth - depth of the box.public java.lang.String toString()
toString in class java.awt.Rectangle