|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.neu.ccs.gui.AbstractPaintable
edu.neu.ccs.gui.Tile
edu.neu.ccs.gui.TileBox
The class TileBox will wrap an object by converting it
to a Paintable if it is not one already.
This class extends Tile to add the following feature.
The contains method will return true if the point is in
the bounding box of the tile. This has two consequences:
TileBox without needing to
accurately click on its paintable.TileBox if some form of
default bounds have been set even if it has no paintable.These features mean that one may interact with a TileBox
much more easily than with a Tile and that one may even use
a mouse click to add or remove the internal paintable.
To provide user feedback, it is generally a good idea to set some non-transparent background color on a tile box.
Prior to 2.7.0, a TileBox also had a concept of border.
This turned out to be a poor design since the border only appeared
under certain conditions. Therefore, the concept of a border has been
removed from this class.
| Field Summary |
| Fields inherited from class edu.neu.ccs.gui.Tile |
col, paintable, row |
| Fields inherited from class edu.neu.ccs.gui.AbstractPaintable |
SET_BACKGROUND_PAINT, SET_BACKGROUND_TILE |
| Fields inherited from interface edu.neu.ccs.gui.Paintable |
REMOVE_PAINTABLE, SET_CLIPPING_SHAPE, SET_DEFAULT_BOUNDS2D, SET_DEFAULT_CENTER, SET_DEFAULT_ORIGINAL_BOUNDS2D, SET_DEFAULT_ORIGINAL_CENTER, SET_MUTATOR, SET_OPACITY, SET_PAINTABLE, SET_VISIBLE, SHIFT_PAINTABLE |
| Fields inherited from interface edu.neu.ccs.util.JPTConstants |
ABOVE, ALIGNMENT, BELOW, BOTTOM_LEFT, BOTTOM_RIGHT, DEFAULT, FONT, INPUT_PROPERTIES, MANDATORY, OPTIONAL, ORIENTATION, TOP_LEFT, TOP_RIGHT, VALUE |
| Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Constructor Summary | |
TileBox()
The constructor that leaves the paintable unspecified and the background paint is set to null. |
|
TileBox(Object o)
The constructor to specify the object to be wrapped; and the background paint is set to null. |
|
TileBox(Object o,
AffineTransform m)
The constructor to specify the object to be wrapped and the initial mutator; the background paint is set to null. |
|
TileBox(Object o,
Paint background)
The constructor to specify the object to be wrapped and the background paint. |
|
TileBox(Object o,
Paint background,
AffineTransform m)
The constructor to specify the object to be wrapped, the background paint, and the initial mutator. |
|
| Method Summary | |
boolean |
contains(double x,
double y)
Tests if a point specified by coordinates is inside the bounding box of the tile box after mutation. |
boolean |
originalContains(double x,
double y)
Tests if a point specified by coordinates is inside the bounding box of the tile box before mutation. |
| Methods inherited from class edu.neu.ccs.gui.Tile |
getActualBounds2D, getCol, getPaintable, getRow, initializeTile, makePaintable, originalPaint, setCol, setPaintable, setRow, setRowCol |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public TileBox()
null.
public TileBox(Object o)
null.
o - the object to convert to a paintable to wrap in this tile
public TileBox(Object o,
Paint background)
o - the object to convert to a paintable to wrap in this tilebackground - the background paint for the tile
public TileBox(Object o,
AffineTransform m)
null.
o - the object to convert to a paintable to wrap in this tilem - the initial mutator
public TileBox(Object o,
Paint background,
AffineTransform m)
o - the object to convert to a paintable to wrap in this tilebackground - the background paint for the tilem - the initial mutator| Method Detail |
public boolean contains(double x,
double y)
Tests if a point specified by coordinates is inside the
bounding box of the tile box after mutation. Calls the
method getBounds2D() to do the test.
This method does not test whether or not the tile box has an internal paintable.
contains in interface Paintablecontains in class AbstractPaintablex - the x-coordinate of the pointy - the y-coordinate of the point
public boolean originalContains(double x,
double y)
Tests if a point specified by coordinates is inside the
bounding box of the tile box before mutation. Calls the
method getOriginalBounds2D() to do the test.
This method does not test whether or not the tile box has an internal paintable.
originalContains in interface PaintableoriginalContains in class Tilex - the x-coordinate of the pointy - the y-coordinate of the point
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||