|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.artoflife.gui.paintable.PaintableIndividualPersistence
Utility responsible for saving/loading Individuals
using a PaintablePhenotype to and from Files
as a lores thumbnail or hires PNG image with
a serialised copy of the Individual in PNG header
as a tEXtEntry record of the tEXt metadata. The
tEXtEntry record has an attribute called "keyword"
set to "serialized_base64", and another attribute
called "object" set to a base64 encoded serialised
Individual.
The definition of hires and lores comes from UserPreferences. Which is a bad dependency.
Images are painted with anti-aliasing. This setup should probably be more overridable?, make Graphics config overridable
| Method Summary | |
static Individual |
loadIndividual(java.io.File file)
|
static void |
saveIndividual(Individual individual,
java.io.File file,
boolean asThumbnail)
Save an Individual with a PaintablePhenotype
as a PNG file (see class comment). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static void saveIndividual(Individual individual,
java.io.File file,
boolean asThumbnail)
throws java.io.IOException
PaintablePhenotype
as a PNG file (see class comment). Writes a small blank image
if the phenotype isn't paintable.
individual - to savefile - the save intoasThumbnail - whether to create a lores PNG
from the Individual's PaintablePhenotype or a hires one
java.io.IOException - on errors writing the file
java.lang.IllegalArgumentException - if individual or file is null
public static Individual loadIndividual(java.io.File file)
throws java.io.IOException
file - load from here
java.io.IOException - on problems reading from file
java.lang.IllegalArgumentException - if file is null
|
artoflife pre0.1.0-dev | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||