|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpt.ua.gboard.Gelem
pt.ua.gboard.games.LabyrinthGelem
public class LabyrinthGelem
Labyrinth graphical element.
This gelem draws an appropriate labyrinth cell taking into consideration the contents of the eight adjacent cells.
+++
+X+
+++
This class follows DbC(tm) methodology. Where possible, contracts are implement with JML and native's Java assert.
Field Summary | |
---|---|
static int |
ROAD
|
static int |
ROAD_E
|
static int |
ROAD_N
|
static int |
ROAD_NE
|
static int |
ROAD_NW
|
static int |
ROAD_S
|
static int |
ROAD_SE
|
static int |
ROAD_SW
|
static int |
ROAD_W
|
Constructor Summary | |
---|---|
LabyrinthGelem(int form)
|
|
LabyrinthGelem(int form,
int numberOfLines,
int numberOfColumns)
|
Method Summary | |
---|---|
void |
draw(java.awt.Graphics g,
int line,
int column,
int cellWidth,
int cellHeight,
java.awt.Color background)
Draw Gelem in GBoard (it should be exported only to GBoard). |
void |
erase(java.awt.Graphics g,
int line,
int column,
int cellWidth,
int cellHeight,
java.awt.Color background)
Erase Gelem from GBoard (it should be exported only to GBoard). |
boolean |
isRoad()
|
boolean |
isWall()
|
static void |
resetShowRoadBoundaries()
Singleton method to reset the visualization of road boundaries (this is the default). |
static void |
setGapPercentageSize(double perc)
Singleton method to define the separation gap between a wall and a road. |
static void |
setShowRoadBoundaries()
Singleton method to set the visualization of road boundaries (as a thin yellow square). |
static boolean |
validForm(int form)
|
Methods inherited from class pt.ua.gboard.Gelem |
---|
height, intersects, isMutable, mutable, numberOfColumns, numberOfLines, width, x, y |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ROAD_NW
public static final int ROAD_N
public static final int ROAD_NE
public static final int ROAD_W
public static final int ROAD_E
public static final int ROAD_SW
public static final int ROAD_S
public static final int ROAD_SE
public static final int ROAD
Constructor Detail |
---|
public LabyrinthGelem(int form)
public LabyrinthGelem(int form, int numberOfLines, int numberOfColumns)
Method Detail |
---|
public static void setGapPercentageSize(double perc)
requires: perc >= 0.0 && perc <= 100.0
perc
- percentage valuepublic static void setShowRoadBoundaries()
public static void resetShowRoadBoundaries()
public static boolean validForm(int form)
public boolean isWall()
public boolean isRoad()
public void draw(java.awt.Graphics g, int line, int column, int cellWidth, int cellHeight, java.awt.Color background)
Gelem
requires: g != null && background != null
(incomplete!)
draw
in class Gelem
g
- Java's Graphics object to use in drawingline
- line in GBoard to draw Gelem.column
- column in GBoard to draw Gelem.cellWidth
- number of horizontal pixels per cellcellHeight
- number of vertical pixels per cellbackground
- background colorpublic void erase(java.awt.Graphics g, int line, int column, int cellWidth, int cellHeight, java.awt.Color background)
Gelem
requires: g != null && background != null
(incomplete!)
erase
in class Gelem
g
- Java's Graphics object to use in drawingline
- line in GBoard to draw Gelem.column
- column in GBoard to draw Gelem.cellWidth
- number of horizontal pixels per cellcellHeight
- number of vertical pixels per cell
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |