|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthmi.xml.XMLStructureAdapter
hmi.environment.avatars.VirtualHumanSpec
public class VirtualHumanSpec
This is like the 'personnel card' of a virtual human that you want to be created by the VIrtualHumanLoader for putting it in Elckerlyc. A spec consists of a number of named sections (Face, Voice, Body, ...). Each segment has a number of named parameters. A parameter can in principle be any kind of object; e.g., the "gesturebinding" section has a parameter names "gesturebinding" that is, actually, a Gesturebindingh Specs are stored in XML. The order in which things occur in the XML matters: later values for the same section / parameter overwrite values specified earlier in the file. There are two ways to load an XML file with a VirtualHumanSpec. 1) create a new spec of the right type; load the XML into it 2) you already have a spec of the right type; take the STag, then load the content into the already existing spec; then take the STag This class uses SpecLoaders to load parts of the content; a SpecLoader uses the addParameter callback to add data to this spec. Note that for some of the parameters, if they are null, some hard coded default may be used, while in other cases the system may simply omit that aspect from the avatar. E.g., when you do not specify a VoiceSpec, the virtual human will be loaded with no voice planner; but if you omit the BodySpec, you will get a default body :)
| Field Summary | |
|---|---|
static String |
IMPL_VERSION
|
private HashMap<String,HashMap<String,Object>> |
sections
|
private Resources |
specRes
|
private static String |
XMLTAG
|
| Fields inherited from class hmi.xml.XMLStructureAdapter |
|---|
ATTRIBUTE_TOKEN_DELIMITERS, COMMA_SEPARATOR, DECODEDARRAYSIZE, DEFAULT_RECOVER_MODE, NEWLINE, SYSTEMNEWLINE, TAB, TAB_STRING |
| Constructor Summary | |
|---|---|
VirtualHumanSpec(Resources newRes)
|
|
| Method Summary | |
|---|---|
void |
addSpecParameter(String sectionName,
String parameterName,
Object parameterValue)
Add a parameter to the given section. |
boolean |
canReadSpecType(String tag)
return true iff the given XMLtag is of a type that this VirtualHumanSPec can read. |
void |
decodeAttributes(HashMap<String,String> attrMap,
XMLTokenizer tokenizer)
decodes all attributes. |
void |
decodeContent(XMLTokenizer tokenizer)
read the content in order; for each encountered element, get a loader that will interpret its content and load it into this spec. |
(package private) SpecLoader |
getLoader(String type)
Get a Specloader, for the given element type, attached to this spec Extend this method for subclasses to add extra element types... |
Object |
getSpecParameter(String sectionName,
String parameterName)
|
Object |
getSpecParameter(String sectionName,
String parameterName,
Object defaultValue)
|
Resources |
getSpecResources()
|
String |
getXMLTag()
The XML Stag for XML encoding -- use this method to find out the run-time xml tag of an object |
static String |
xmlTag()
The XML Stag for XML encoding -- use this static method when you want to see if a given String equals the xml tag for this class |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String IMPL_VERSION
private Resources specRes
private HashMap<String,HashMap<String,Object>> sections
private static final String XMLTAG
| Constructor Detail |
|---|
public VirtualHumanSpec(Resources newRes)
| Method Detail |
|---|
public Resources getSpecResources()
public void decodeAttributes(HashMap<String,String> attrMap,
XMLTokenizer tokenizer)
XMLStructureAdapter
decodeAttributes in class XMLStructureAdapter
public void decodeContent(XMLTokenizer tokenizer)
throws IOException
decodeContent in class XMLStructureAdapterIOExceptionSpecLoader getLoader(String type)
public void addSpecParameter(String sectionName,
String parameterName,
Object parameterValue)
public Object getSpecParameter(String sectionName,
String parameterName,
Object defaultValue)
public Object getSpecParameter(String sectionName,
String parameterName)
public boolean canReadSpecType(String tag)
public static String xmlTag()
public String getXMLTag()
getXMLTag in interface XMLStructuregetXMLTag in class XMLStructureAdapter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||