|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectTileSet
public class TileSet
This class contains all the information relating to a tile set as well as the tiles themselves.
Field Summary | |
---|---|
(package private) boolean |
allowPrintArrangement
true if the set allows users to print. |
(package private) java.lang.String |
arrangementComment
Arrangement comments for the tile set. |
(package private) javax.swing.ImageIcon |
blankTileImage
ImageIcon used for blank tiles. |
(package private) java.lang.String |
desc
The description and/or instructions of the tile set. |
(package private) int |
gridNumTilesTall
Number of tiles the grid should support vertically. |
(package private) int |
gridNumTilesWide
Number of tiles the grid should support horizontally. |
(package private) int |
maxBlankTiles
Max number of blank tiles allowed by the set. |
(package private) int |
maxUnusedTiles
Max number of unused tiles allowed by the set. |
(package private) boolean |
missingTiles
true if missing tiles are enabled. |
(package private) java.lang.String |
name
The name of the tile set. |
(package private) int |
numBlankTiles
Current number of blank tiles in use. |
(package private) int |
numMissingTiles
Number of tiles to randomly leave out when the set loads. |
(package private) int |
numOfTiles
Number of tiles currently in the set. |
(package private) boolean |
reqArrangementComment
true if the set requires arrangement comments. |
(package private) boolean |
reqBlankDesc
true if the set requires descriptions for blank tiles. |
(package private) boolean |
reqBlankName
true if the set requires names for blank tiles. |
(package private) boolean |
reqUnusedDesc
true if the set requires descriptions for unused tiles. |
private static long |
serialVersionUID
|
(package private) java.util.ArrayList |
summaryTiles
The list of summary tiles. |
(package private) java.util.ArrayList |
tile
The list of tiles in the set. |
(package private) int |
tileHeight
Height of the tiles in gridSquares (20x20 pixels each). |
(package private) int |
tileHeightInPixels
Height of the tiles in pixels. |
(package private) int |
tileWidth
Width of the tiles in gridSquares (20x20 pixels each). |
(package private) int |
tileWidthInPixels
Width of the tiles in pixels. |
(package private) boolean |
unlimitedBlanks
true if the set allows unlimited blank tiles. |
(package private) boolean |
unlimitedUnused
true if the set allows unlimited unused tiles. |
Constructor Summary | |
---|---|
TileSet(int tileCount,
int gridSquareSize,
int pixWidth,
int pixHeight)
Constructor for the TileSet class. |
Method Summary | |
---|---|
boolean |
AddBlankIsAllowed()
Returns true if the user is allowed to
add at least one more blank tile to the set. |
int |
AddBlankTile(java.lang.String name,
java.lang.String desc,
java.awt.Component obs)
Adds a blank tile to the tileset. |
void |
addBlankTileAt(int loc,
java.lang.String name,
java.lang.String desc,
Grid theGrid,
TileBin theTileBin)
Adds a blank tile at a specific position in the tile list. |
boolean |
canUseBlankTiles()
Returns true if the set supports
the ability to add blank tiles. |
javax.swing.ImageIcon |
createBlankTileImage(java.lang.String name,
java.awt.Component obs)
Creates an ImageIcon to be used for a blank tile. |
boolean |
deleteBlankTile(int tileID,
Grid theGrid,
TileBin theTileBin)
Deletes a blank tile. |
int |
getGridHeight()
Returns the height of the grid in pixels required by the set. |
int |
getGridWidth()
Returns the width of the grid in pixels required by the set. |
int |
getMaxBlank()
Returns the max number of blank tiles allowed by the set. |
int |
getNumBlank()
Returns the number of blank tiles currently being used. |
int |
getNumOfTiles()
Returns the number of tiles in the set. |
java.awt.Rectangle |
getTileBoundsInGrid()
Returns a bounding rectangle containing every tile in the grid. |
int |
getTileHeight()
Returns the height of the tiles in GridSquares (20x20 pixels each) |
int |
getTileHeightInPixels()
Returns the height of the tiles in pixels. |
int |
getTileWidth()
Returns the width of the tiles in GridSquares (20x20 pixels each) |
int |
getTileWidthInPixels()
Returns the width of the tiles in pixels. |
void |
prepForPlayback()
Removes all blank tiles from the tile set. |
void |
resetIDs()
Resets the TileIDs of every tile in the list to match thier current location in the list. |
void |
setBlankImage(javax.swing.ImageIcon newBlank)
Sets the ImageIcon used as the blank tile. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
java.lang.String name
java.lang.String desc
int numOfTiles
java.util.ArrayList tile
Tile
s.
The first tile is a dummy tile.
java.util.ArrayList summaryTiles
SummaryEntry
s.
int tileWidthInPixels
int tileHeightInPixels
int tileWidth
int tileHeight
javax.swing.ImageIcon blankTileImage
int gridNumTilesWide
int gridNumTilesTall
boolean reqBlankDesc
true
if the set requires descriptions for blank tiles.
boolean reqBlankName
true
if the set requires names for blank tiles.
boolean unlimitedBlanks
true
if the set allows unlimited blank tiles.
int maxBlankTiles
int numBlankTiles
boolean reqUnusedDesc
true
if the set requires descriptions for unused tiles.
boolean unlimitedUnused
true
if the set allows unlimited unused tiles.
int maxUnusedTiles
boolean reqArrangementComment
true
if the set requires arrangement comments.
java.lang.String arrangementComment
boolean allowPrintArrangement
true
if the set allows users to print.
boolean missingTiles
true
if missing tiles are enabled.
int numMissingTiles
Constructor Detail |
---|
public TileSet(int tileCount, int gridSquareSize, int pixWidth, int pixHeight)
tileCount
- Initial number of tilesgridSquareSize
- Size of grid squares (should be 20x20 pixels)pixWidth
- Width of tiles in pixelspixHeight
- Height of tiles in pixelsMethod Detail |
---|
public boolean AddBlankIsAllowed()
true
if the user is allowed to
add at least one more blank tile to the set.
true
if the user is allowed to
add at least one more blank tile to the set.
Returns false
otherwise.public boolean canUseBlankTiles()
true
if the set supports
the ability to add blank tiles.
true
if the set supports
the ability to add blank tiles.public javax.swing.ImageIcon createBlankTileImage(java.lang.String name, java.awt.Component obs)
name
- Name to be drawn on the imageobs
- ImageObserver object
public int AddBlankTile(java.lang.String name, java.lang.String desc, java.awt.Component obs)
name
- Name of the blank tiledesc
- Description of the blank tileobs
- Component to be used as the ImageObserver when
creating the blank tile's image. Any visible
component should work.
public void addBlankTileAt(int loc, java.lang.String name, java.lang.String desc, Grid theGrid, TileBin theTileBin)
loc
- Location in the TileSet to add the blank tilename
- Name of the blank tiledesc
- Description of the blank tiletheGrid
- The Grid objecttheTileBin
- The TileBin objectpublic boolean deleteBlankTile(int tileID, Grid theGrid, TileBin theTileBin)
tileID
- TileID of the tile to deletetheGrid
- The Grid objecttheTileBin
- The TileBin ojbect
true
if the tile was deleted;
false
if it was not a blank tile.public int getNumOfTiles()
public int getTileWidthInPixels()
public int getTileHeightInPixels()
public int getTileWidth()
public int getTileHeight()
public void setBlankImage(javax.swing.ImageIcon newBlank)
newBlank
- ImageIcon to use as the blank tile imagepublic int getGridWidth()
public int getGridHeight()
public int getNumBlank()
public int getMaxBlank()
public void prepForPlayback()
public void resetIDs()
public java.awt.Rectangle getTileBoundsInGrid()
Rectangle
that contains every tile
in the grid. The units of measure for this
Rectangle
are in gridSquares (20x20 pixels each)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |