Package edu.wisc.game.sql
Class ImageObject
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<String,String>
- Direct Known Subclasses:
Composite
public class ImageObject extends HashMap<String,String>
Describes an image-and-properties-based object. For details, see
Image-and-property-based description of objects
- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImageObject.Generator
static class
ImageObject.PickFromList
A Generator interface to a stored list of ImageObjectsNested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description protected
ImageObject()
Used by Composite -
Method Summary
Modifier and Type Method Description static void
clearTable()
void
enlist()
Enters this ImageObject into the master tableString
getKey()
String
getSvg()
The SVG code for the image, if available.String
listProperties()
String
listProperties(String sep)
Produces a "key1:val1, key2:val2, ..." list, with a desired separator.static ImageObject
obtainImageObjectPlain(File f)
static ImageObject
obtainImageObjectPlain(File f, boolean allowMissing)
static ImageObject
obtainImageObjectPlain(File dir, String plainPath, boolean allowMissing)
Retrieves the ImageObject for a specified path from the master table.static Vector<ImageObject>
obtainImageObjects(String wildCardPath)
Loads an image object, or a group of them, if a wildcard is given.String
symbol()
For use in ASCII graphicsMethods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Field Details
-
Constructor Details
-
ImageObject
protected ImageObject()Used by Composite
-
-
Method Details
-
getKey
-
getSvg
The SVG code for the image, if available. It is mandatory for dynamically generated ImageObjects (/composite). For static ones, it may or may not be null. -
clearTable
public static void clearTable() -
enlist
public void enlist()Enters this ImageObject into the master table -
obtainImageObjectPlain
Retrieves the ImageObject for a specified path from the master table. If necessary, tries to add that object (and all other objects listed in the properties file in that directory) to the master table.- Parameters:
dir
- If provided, plainPath is understood as being relative to it.plainPath
- The image path (relative to dir, or absolute if dir==null). Must not contain wildcard. May contain an extension (e.g. ".png" or ".svg"); if it does not, ".svg" will be added.
-
obtainImageObjectPlain
-
obtainImageObjectPlain
- Parameters:
allowMissing
- If true, simply return null, rather than throw exception, when the file is not listed in the prop file
-
obtainImageObjects
Loads an image object, or a group of them, if a wildcard is given. The path may also refer to dynamically generated Composite ImageObjects.- Returns:
- a Vector of "regular" ImageObjects (associated with the file(s) given by the wildCardPath), or a Composite ImageObject (maybe a "family" one) is the path is of that kind.
-
listProperties
-
listProperties
Produces a "key1:val1, key2:val2, ..." list, with a desired separator. -
symbol
For use in ASCII graphics
-