|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.caff.maze.MazePropertyOwner
de.caff.maze.AbstractBasicMaze
de.caff.maze.TriangularMaze
public class TriangularMaze
A maze with triangular shape, consisting of triangular cells.
![]() |
![]() |
![]() |
![]() |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class de.caff.maze.AbstractBasicMaze |
---|
AbstractBasicMaze.DoubleDelayedPropertyInformation, AbstractBasicMaze.IntegerDelayedPropertyInformation |
Nested classes/interfaces inherited from class de.caff.maze.MazePropertyOwner |
---|
MazePropertyOwner.BooleanPropertyInformation, MazePropertyOwner.EnumPropertyInformation, MazePropertyOwner.InfoPropertyDisplay, MazePropertyOwner.IntegerPropertyInformation, MazePropertyOwner.PaintPropertyInformation |
Field Summary | |
---|---|
static java.lang.String |
MAZE_TYPE
The type of this maze (for storage). |
static java.lang.String |
PROPERTY_SIZE
Property key for the settable size property. |
Fields inherited from class de.caff.maze.AbstractBasicMaze |
---|
BOX_SIZE, PROPERTY_CREATION_TIME, PROPERTY_MAZE, PROPERTY_NUMBER_CELLS, PROPERTY_SEED, PROPERTY_SOLUTION_LENGTH, PROPERTY_WAY, PROPERTY_WAY_POINTS |
Constructor Summary | |
---|---|
TriangularMaze(int size)
Constructor. |
Method Summary | |
---|---|
protected void |
doDraw(MazePainter painter,
MazePaintPropertiesProvider properties)
Do the actual drawing. |
MazeCell |
getCellByID(int id)
Get the cell with the given id. |
MazeCell[] |
getCells()
Get the cells of this maze. |
protected AbstractBasicMaze |
getGeometryClone()
Get a deep copy of this maze geometry. |
java.awt.Insets |
getInsets(MazePaintPropertiesProvider properties,
float scaling)
Get the necessary insets depending on the paint properties. |
java.lang.String |
getMazeType()
Get a internally used string describing the maze type. |
protected java.awt.Shape |
getOuterBorder()
Get the borders of the maze as a shape. |
float |
getPreferredAspectRatio()
Get the preferred aspect ratio of this maze. |
java.util.Collection<PropertyInformation> |
getPropertyInformations()
Get the property setters and displays for this maze. |
void |
loadPersistentData(DataStorage systemAccess)
Load extra data defining the maze from the system access. |
static void |
main(java.lang.String[] args)
Test code. |
protected void |
recreateFromDelayedSetters()
This is called during the call of AbstractBasicMaze.setFromSetters()
and should be used to recreate the geometry of the maze from
the setters of the geometric properties. |
void |
reset()
Resets the internal data. |
void |
setDefaultWayPoints()
Set some useful default way points. |
void |
setSize(int size)
Set the maze size. |
void |
storePersistentData(DataStorage systemAccess)
Store extra data defining the maze to the system access. |
Methods inherited from class de.caff.maze.AbstractBasicMaze |
---|
addMazeFinishedListener, arg2int, createMaze, createMaze, createMaze, draw, drawBackgroundAndWay, getCellAt, getClone, getCreationTimeMillis, getInfo, getSeed, getWay, getWayEnd, getWayStart, isDuringRecreation, loadSeedWayAndVersion, recreateMaze, removeMazeFinishedListener, setFromSetters, setProgressShower, setWayEnd, setWayPoints, setWayStart, solve, storeSeedWayAndVersion |
Methods inherited from class de.caff.maze.MazePropertyOwner |
---|
addPropertyChangeListener, firePropertyChange, removePropertyChangeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String MAZE_TYPE
public static final java.lang.String PROPERTY_SIZE
Constructor Detail |
---|
public TriangularMaze(int size)
size
- maze sizeMethod Detail |
---|
protected AbstractBasicMaze getGeometryClone()
getGeometryClone
in class AbstractBasicMaze
public java.lang.String getMazeType()
getMazeType
in class AbstractBasicMaze
public void reset()
reset
in interface Maze
reset
in class AbstractBasicMaze
public MazeCell[] getCells()
public MazeCell getCellByID(int id)
id
- cell id
null
if there is no such cellMazeCell.getID()
protected void doDraw(MazePainter painter, MazePaintPropertiesProvider properties)
MazePainter.startPainting(de.caff.maze.MazePainter.PaintObjectType)
and
MazePainter.endPaintingMaze()
.
doDraw
in class AbstractBasicMaze
painter
- painter to draw toproperties
- access to properties for drawing (colors etc)public float getPreferredAspectRatio()
public java.awt.Insets getInsets(MazePaintPropertiesProvider properties, float scaling)
properties
- paint propertiesscaling
- scaling used when painting
public void setDefaultWayPoints()
setDefaultWayPoints
in class AbstractBasicMaze
public void setSize(int size)
size
- maze size (number of triangular cells with flat side at border)public java.util.Collection<PropertyInformation> getPropertyInformations()
getPropertyInformations
in class AbstractBasicMaze
protected void recreateFromDelayedSetters()
AbstractBasicMaze.setFromSetters()
and should be used to recreate the geometry of the maze from
the setters of the geometric properties.
recreateFromDelayedSetters
in class AbstractBasicMaze
protected java.awt.Shape getOuterBorder()
getOuterBorder
in class AbstractBasicMaze
public void loadPersistentData(DataStorage systemAccess)
systemAccess
- system accesspublic void storePersistentData(DataStorage systemAccess)
systemAccess
- system accesspublic static void main(java.lang.String[] args)
args
- unused
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |