|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectRules
public class Rules
The rules class stores the values related to a set such as name, instructions, tile size, etc., which uniquely identify what a set can do, some information about the set, and the tiles that a set contains. This is a serializable class that the CLIP system outputs as '.set' files.
Field Summary | |
---|---|
(package private) boolean |
allowBlanks
true if blank tiles are allowed |
(package private) boolean |
allowPrintArrangement
true if printing is allowed |
(package private) boolean |
allowUnused
true if unused tiles are allowed |
(package private) byte[] |
blankImage
Byte array of blank tile image. |
(package private) int |
blankIndex
Index of the blank tile image in the tile list |
(package private) java.lang.String |
instructions
TileSet instructions and/or description |
(package private) boolean |
missingTiles
true if the set should randomly remove some
tiles when it loads. |
(package private) java.lang.String |
name
TileSet name |
(package private) int |
numBlankTiles
Maximum number of blank tiles allowed |
(package private) int |
numMissingTiles
Number of tiles to randomly remove on set load |
(package private) int |
numTilesHigh
Number of tiles the grid can fit from top to bottom |
(package private) int |
numTilesWide
Number of tiles the grid can fit from side to side |
(package private) int |
numUnusedTiles
Maximum number of unused tiles allowed |
(package private) boolean |
reqArrangementComment
true if arrangement comments are required |
(package private) boolean |
reqBlankDesc
true if blank tiles require a description |
(package private) boolean |
reqBlankName
true if blank tiles require a name |
(package private) boolean |
reqUnusedDesc
true if unused tiles require a description |
(package private) static long |
serialVersionUID
|
(package private) int |
tileHeight
Height of the set's tiles in pixels |
(package private) java.util.ArrayList |
tileNames
Names of tiles in the tiles ArrayList. |
(package private) java.util.ArrayList |
tiles
Holds the tiles for a set as byte arrays. |
(package private) int |
tileWidth
Width of the set's tiles in pixels |
(package private) boolean |
unlimitedBlanks
true if unlimited blank tiles are allowed |
(package private) boolean |
unlimitedUnused
true if unlimited unused tiles are allowed |
Constructor Summary | |
---|---|
Rules()
The constructor initializes all fields to default values |
Method Summary | |
---|---|
boolean |
blankOption()
Returns true if blank tiles are
allowed for this set. |
boolean |
getAllowBlanks()
Returns true if blank tiles are allowed. |
boolean |
getAllowPrintArrangement()
Returns true if printing is allowed. |
boolean |
getAllowUnused()
Returns true if unused tiles are allowed. |
byte[] |
getBlank()
Returns a byte array that is used to create an ImageIcon used as the blank tile image. |
java.lang.String |
getInstructions()
Returns the set instructions. |
boolean |
getMissingTiles()
Returns true if the set randomly removes some
tiles when it loads. |
java.lang.String |
getName()
Returns the set name. |
int |
getNumberBlankTiles()
Returns the maximum number of blank tiles allowed. |
int |
getNumberUnusedTiles()
Returns the maximum number of unused tiles allowed. |
int |
getNumMissingTiles()
Returns the number of randomly removed tiles on set load. |
int |
getNumTilesHigh()
Returns the number of tiles the grid can hold from top to bottom. |
int |
getNumTilesWide()
Returns the number of tiles the grid can hold from side to side. |
boolean |
getReqBlankDesc()
Returns true if blank tiles require a description. |
boolean |
getReqBlankName()
Returns true if blank tiles require a name. |
boolean |
getRequireArrangementComment()
Returns true if tile arrangements require comments. |
boolean |
getReqUnusedDesc()
Returns true if unused tiles require a description. |
int |
getTileHeight()
Returns the height of the tiles in pixels. |
int |
getTileWidth()
Returns the width of the tiles in pixels. |
boolean |
getUnlimitedBlanks()
Returns true if unlimited blank tiles are allowed. |
boolean |
getUnlimitedUnused()
Returns true if unlimited unused tiles are allowed. |
boolean |
missingOption()
Returns true if the set randomly removes
some tiles on loading. |
void |
resetValues()
Resets all fields to default values. |
void |
setBlank(byte[] newBlank,
int index)
Sets the blank tile by passing in a byte array and index number to use as the blank tile. |
void |
setBlankOptions(boolean allow,
boolean blankName,
boolean blankDesc,
boolean unlimited,
int blankNumber)
Sets the variables related to blank tiles to the passed in parameter values. |
void |
setGridSize(int numWide,
int numHigh)
Sets the grid size (# of tiles wide and tall) |
void |
setInstructions(java.lang.String newInstructions)
Sets the set instructions to the passed in value. |
void |
setMissingTilesOptions(boolean missing,
int missingNumber)
Sets the variables related to missing tiles to the passed in parameter values. |
void |
setName(java.lang.String newName)
Sets the set name to the passed in value. |
void |
setSessionOptions(boolean allowPrint,
boolean arrangementComment)
Sets the variables related to session options to the values of the passed in parameters. |
void |
setTileSize(int tileW,
int tileH)
Sets the size of the tiles (in pixels) |
void |
setUnusedOptions(boolean allow,
boolean unusedDesc,
boolean unlimited,
int unusedNumber)
Set the variables related to unused tiles to the values of the passed in parameters. |
boolean |
unusedOption()
Returns true if unused tiles are
allowed for this set. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final long serialVersionUID
java.util.ArrayList tiles
ImageIcon
s can be constructed
from the byte arrays
java.util.ArrayList tileNames
tiles
ArrayList.
Stored as Strings.
java.lang.String name
java.lang.String instructions
int numTilesWide
int numTilesHigh
int tileWidth
int tileHeight
boolean allowBlanks
true
if blank tiles are allowed
boolean reqBlankDesc
true
if blank tiles require a description
boolean reqBlankName
true
if blank tiles require a name
boolean unlimitedBlanks
true
if unlimited blank tiles are allowed
int numBlankTiles
int blankIndex
byte[] blankImage
ImageIcon
boolean allowUnused
true
if unused tiles are allowed
boolean reqUnusedDesc
true
if unused tiles require a description
boolean unlimitedUnused
true
if unlimited unused tiles are allowed
int numUnusedTiles
boolean missingTiles
true
if the set should randomly remove some
tiles when it loads.
int numMissingTiles
boolean allowPrintArrangement
true
if printing is allowed
boolean reqArrangementComment
true
if arrangement comments are required
Constructor Detail |
---|
public Rules()
Method Detail |
---|
public void resetValues()
public boolean blankOption()
true
if blank tiles are
allowed for this set.
true
if blank tiles are allowed
for this set; false
otherwise.public boolean missingOption()
true
if the set randomly removes
some tiles on loading.
true
if the set randomly removes
some tiles on loading. false
otherwise.public void setBlank(byte[] newBlank, int index)
newBlank
- Byte array to create the ImageIcon
fromindex
- Index of the blank image in the tile listpublic byte[] getBlank()
ImageIcon
used as the blank tile image.
ImageIcon
used as the blank tile image.public boolean unusedOption()
true
if unused tiles are
allowed for this set.
true
if unused tiles are allowed
for this set; false
otherwise.public void setName(java.lang.String newName)
newName
- The new set namepublic java.lang.String getName()
public void setInstructions(java.lang.String newInstructions)
newInstructions
- The new set instructionspublic java.lang.String getInstructions()
public void setGridSize(int numWide, int numHigh)
numWide
- Number of tiles the grid can hold from side to sidenumHigh
- Number of tiles the grid can hold from top to bottompublic int getNumTilesWide()
public int getNumTilesHigh()
public void setTileSize(int tileW, int tileH)
tileW
- Width of the tiles in pixelstileH
- Height of the tiles in pixelspublic int getTileWidth()
public int getTileHeight()
public void setBlankOptions(boolean allow, boolean blankName, boolean blankDesc, boolean unlimited, int blankNumber)
allow
- true
to allow blank tiles to be usedblankName
- true
to require names for blank tilesblankDesc
- true
to require descriptions for blank tilesunlimited
- true
to allow unlimited blank tilesblankNumber
- Maximum number of blank tiles allowedpublic void setMissingTilesOptions(boolean missing, int missingNumber)
missing
- true
to allow missing tilesmissingNumber
- Number of missing tiles (randomly removed)public boolean getMissingTiles()
true
if the set randomly removes some
tiles when it loads.
true
if the set randomly removes some
tiles when it loadspublic int getNumMissingTiles()
public boolean getAllowBlanks()
true
if blank tiles are allowed.
true
if blank tiles are allowed.public boolean getReqBlankName()
true
if blank tiles require a name.
true
if blank tiles require a name.public boolean getReqBlankDesc()
true
if blank tiles require a description.
true
if blank tiles require a descriptionpublic boolean getUnlimitedBlanks()
true
if unlimited blank tiles are allowed.
true
if unlimited blank tiles are allowedpublic int getNumberBlankTiles()
public void setUnusedOptions(boolean allow, boolean unusedDesc, boolean unlimited, int unusedNumber)
allow
- true
if unused tiles are allowedunusedDesc
- true
if unused tiles require a descriptionunlimited
- true
if unlimited unused tiles are allowedunusedNumber
- Maximum number of unused tiles allowedpublic boolean getAllowUnused()
true
if unused tiles are allowed.
true
if unused tiles are allowedpublic boolean getReqUnusedDesc()
true
if unused tiles require a description.
true
if unused tiles require a descriptionpublic boolean getUnlimitedUnused()
true
if unlimited unused tiles are allowed.
true
if unlimited unused tiles are allowedpublic int getNumberUnusedTiles()
public void setSessionOptions(boolean allowPrint, boolean arrangementComment)
allowPrint
- true
if printing is allowedarrangementComment
- true
if arrangement comments
are requiredpublic boolean getAllowPrintArrangement()
true
if printing is allowed.
true
if printing is allowedpublic boolean getRequireArrangementComment()
true
if tile arrangements require comments.
true
if tile arrangements require comments
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |