jautil.avatar
Class AvatarData

java.lang.Object
  extended by jautil.avatar.AvatarData

public final class AvatarData
extends java.lang.Object

Holds all the essential data for a particular instance of a JARP avatar, including its name and base URL.


Field Summary
 java.lang.Class ACCESS_CLASS
          The access class for the avatar data files, if it has one.
 byte[] ASD_XML
          The data in the avatar's ASD XML file (asd.xml).
 java.lang.String AVATAR
          The avatar name.
 byte[] AVATAR_DEF
          The data in the ARP avatar definition file for this avatar (avatardef.jarp or avatardef.jarp).
 java.lang.String AVATAR_DEF_NAME
          The name of the avatar definition file.
 java.lang.String AVATAR_DEF_URL
          The full URL for the avatar definition file.
 java.lang.String BASE_URL
          The base URL for the directory containing the avatar data files, if it has one.
 byte[] CONFIG_XML
          The data in the avatar's animgen configuration data XML file (config.xml).
 byte[] NONMANUALS_XML
          The data in the avatar's nonmanuals XML file (nonmanuals.xml).
static java.lang.String[] XML_NAMES
          Names of an avatar's XML data files.
 
Constructor Summary
AvatarData(java.lang.String av, java.lang.Class access)
          Constructs a new avatar data record for the avatar with the given name and access class.
AvatarData(java.lang.String av, java.lang.String burl)
          Constructs a new avatar data record for the avatar with the given name and data at the given base URL.
 
Method Summary
 byte[] getData(java.lang.String rname)
          Loads and returns the data from the specified resource for this avatar.
static byte[] getFileDataAtBase(java.lang.String fname, java.lang.String baseurl, java.lang.String btag)
          Loads and returns the given file under the given avatar base URL, using the given base description tag in any download progress dialog, if one is used.
static byte[] getResourceData(java.lang.Class access, java.lang.String rname)
          Loads and returns the data from the given resource from the same package/folder as the given access class.
 boolean isAllAvailable()
          Indicates whether or not all the avatar data files (ASD, animgen config, nonmanuals, ARP avatar def.) were successfully loaded.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_NAMES

public static final java.lang.String[] XML_NAMES
Names of an avatar's XML data files.


AVATAR

public final java.lang.String AVATAR
The avatar name.


BASE_URL

public final java.lang.String BASE_URL
The base URL for the directory containing the avatar data files, if it has one.


ACCESS_CLASS

public final java.lang.Class ACCESS_CLASS
The access class for the avatar data files, if it has one.


AVATAR_DEF_URL

public final java.lang.String AVATAR_DEF_URL
The full URL for the avatar definition file.


AVATAR_DEF_NAME

public final java.lang.String AVATAR_DEF_NAME
The name of the avatar definition file.


ASD_XML

public final byte[] ASD_XML
The data in the avatar's ASD XML file (asd.xml).


CONFIG_XML

public final byte[] CONFIG_XML
The data in the avatar's animgen configuration data XML file (config.xml).


NONMANUALS_XML

public final byte[] NONMANUALS_XML
The data in the avatar's nonmanuals XML file (nonmanuals.xml).


AVATAR_DEF

public final byte[] AVATAR_DEF
The data in the ARP avatar definition file for this avatar (avatardef.jarp or avatardef.jarp).

Constructor Detail

AvatarData

public AvatarData(java.lang.String av,
                  java.lang.String burl)
Constructs a new avatar data record for the avatar with the given name and data at the given base URL.


AvatarData

public AvatarData(java.lang.String av,
                  java.lang.Class access)
Constructs a new avatar data record for the avatar with the given name and access class.

Method Detail

isAllAvailable

public boolean isAllAvailable()
Indicates whether or not all the avatar data files (ASD, animgen config, nonmanuals, ARP avatar def.) were successfully loaded.


getData

public byte[] getData(java.lang.String rname)
Loads and returns the data from the specified resource for this avatar.


getFileDataAtBase

public static byte[] getFileDataAtBase(java.lang.String fname,
                                       java.lang.String baseurl,
                                       java.lang.String btag)
Loads and returns the given file under the given avatar base URL, using the given base description tag in any download progress dialog, if one is used.


getResourceData

public static byte[] getResourceData(java.lang.Class access,
                                     java.lang.String rname)
Loads and returns the data from the given resource from the same package/folder as the given access class.