|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.media.image.ColorPository
public class ColorPository
A repository of image recoloration information. It was called the recolor repository but the re-s cancelled one another out.
| Nested Class Summary | |
|---|---|
static class |
ColorPository.ClassRecord
Used to store information on a class of colors. |
static class |
ColorPository.ColorRecord
Used to store information on a particular color. |
| Field Summary | |
|---|---|
protected HashIntMap<ColorPository.ClassRecord> |
_classes
Our mapping from class names to class records. |
protected static String |
CONFIG_PATH
The path (relative to the resource directory) at which the serialized recolorization repository should be loaded and stored. |
| Constructor Summary | |
|---|---|
ColorPository()
|
|
| Method Summary | |
|---|---|
void |
addClass(ColorPository.ClassRecord record)
Adds a fully configured color class record to the pository. |
Iterator<ColorPository.ClassRecord> |
enumerateClasses()
Returns an iterator over all color classes in this pository. |
int[] |
enumerateColorIds(String className)
Returns an array containing the ids of the colors in the specified class. |
ColorPository.ColorRecord[] |
enumerateColors(String className)
Returns an array containing the records for the colors in the specified class. |
Collection<ColorPository.ClassRecord> |
getClasses()
|
ColorPository.ClassRecord |
getClassRecord(int classId)
Looks up the requested color class record. |
ColorPository.ClassRecord |
getClassRecord(String className)
Loads up a colorization class by name and logs a warning if it doesn't exist. |
Colorization |
getColorization(int colorPrint)
Looks up a colorization by color print. |
Colorization |
getColorization(int classId,
int colorId)
Looks up a colorization by id. |
Colorization |
getColorization(String className,
int colorId)
Looks up a colorization by name. |
Colorization |
getColorization(String className,
String colorName)
Looks up a colorization by class and color names. |
ColorPository.ColorRecord |
getColorRecord(int classId,
int colorId)
Looks up the requested color record. |
ColorPository.ColorRecord |
getColorRecord(String className,
String colorName)
Looks up the requested color record by class & color names. |
ColorPository.ColorRecord |
getRandomStartingColor(String className)
Returns a random starting color from the specified color class. |
ColorPository.ColorRecord |
getRandomStartingColor(String className,
Random rand)
Returns a random starting color from the specified color class. |
boolean |
isLegalStartColor(int colorPrint)
Returns true if the specified color is legal for use at character creation time. false is always returned for non-existent colors or classes. |
boolean |
isLegalStartColor(int classId,
int colorId)
Returns true if the specified color is legal for use at character creation time. false is always returned for non-existent colors or classes. |
static ColorPository |
loadColorPository(InputStream source)
Loads up a serialized ColorPository from the supplied resource manager. |
static ColorPository |
loadColorPository(ResourceManager rmgr)
Loads up a serialized ColorPository from the supplied resource manager. |
static void |
saveColorPository(ColorPository posit,
File root)
Serializes and saves color pository to the supplied file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected HashIntMap<ColorPository.ClassRecord> _classes
protected static final String CONFIG_PATH
| Constructor Detail |
|---|
public ColorPository()
| Method Detail |
|---|
public Iterator<ColorPository.ClassRecord> enumerateClasses()
public Collection<ColorPository.ClassRecord> getClasses()
public ColorPository.ColorRecord[] enumerateColors(String className)
public int[] enumerateColorIds(String className)
public boolean isLegalStartColor(int colorPrint)
public boolean isLegalStartColor(int classId,
int colorId)
public ColorPository.ColorRecord getRandomStartingColor(String className)
public ColorPository.ColorRecord getRandomStartingColor(String className,
Random rand)
public Colorization getColorization(int classId,
int colorId)
public Colorization getColorization(int colorPrint)
public Colorization getColorization(String className,
int colorId)
public Colorization getColorization(String className,
String colorName)
public ColorPository.ClassRecord getClassRecord(String className)
public ColorPository.ColorRecord getColorRecord(int classId,
int colorId)
public ColorPository.ColorRecord getColorRecord(String className,
String colorName)
public ColorPository.ClassRecord getClassRecord(int classId)
public void addClass(ColorPository.ClassRecord record)
public static ColorPository loadColorPository(ResourceManager rmgr)
public static ColorPository loadColorPository(InputStream source)
public static void saveColorPository(ColorPository posit,
File root)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||