|
Game of Life 1.5 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.bitstorm.gameoflife.StandaloneGameOfLife.GameOfLifeGridIO
File open and save operations for GameOfLifeGrid.
Field Summary | |
java.lang.String |
FILE_EXTENSION
|
private java.lang.String |
filename
|
private GameOfLifeGrid |
grid
|
Constructor Summary | |
StandaloneGameOfLife.GameOfLifeGridIO(GameOfLifeGrid grid)
Contructor. |
Method Summary | |
Shape |
makeShape(java.lang.String name,
java.lang.String text)
"Draw" the shape on the grid. |
void |
openShape()
Load shape from disk |
void |
openShape(EasyFile file)
Use EasyFile object to read GameOfLife-file from. |
void |
openShape(java.lang.String filename)
Load shape from disk |
void |
openShape(java.net.URL url)
Open shape from URL. |
void |
saveShape()
Write shape to disk. |
void |
setShape(Shape shape)
Set a shape and optionally resizes window. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public final java.lang.String FILE_EXTENSION
private GameOfLifeGrid grid
private java.lang.String filename
Constructor Detail |
public StandaloneGameOfLife.GameOfLifeGridIO(GameOfLifeGrid grid)
grid
- grid to read/write files from/toMethod Detail |
public void openShape()
public void openShape(java.lang.String filename)
filename
- filename to load shape from, or null when no filename given.public void openShape(java.net.URL url)
url
- URL pointing to GameOfLife-filepublic void openShape(EasyFile file) throws java.io.IOException
file
- EasyFile-object
java.io.IOException
EasyFile
public void setShape(Shape shape)
shape
- Shape to setpublic Shape makeShape(java.lang.String name, java.lang.String text)
name
- name of shapetext
- lines of textpublic void saveShape()
|
Game of Life 1.5 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This API descibes the Game of Life program, written by Edwin Martin. The source code is available online too.
Copyright 1996-2004 Edwin Martin <edwin@bitstorm.org>.