jautil
Class JAOptions

java.lang.Object
  extended by jautil.JAOptions

public class JAOptions
extends java.lang.Object

A JAOptions is a complete collection of options settings associated with a given Java ARP avatar canvas (or with the applet/application instance containing that canvas), and backed by one or more nodes in the User Preferences hierarchy of the underlying platform.

For Windows systems, user preferences are stored in the Registry under the key
       HKEY_CURRENT_USER\Software\JavaSoft\Prefs
while under Mac OS X, user preferences are held as a plist in the directory
       ~/Library/Preferences
JA preferences nodes are all held (currently) under the user Preferences node
       /uk/ac/uea/cmp/ja

A JAOptions collection is supported by a hierarchical chain of BasicOptionSets, in order of precedence from highest to lowest:

A user-configurable option set is usually backed by a Preferences node. For an application-specific option set, the name of this Preferences node is fixed by the application; for the system-wide option set the Preferences node name is jadefaults. In general, when an option set is created it is initialised from its associated Preferences node, possibly supplemented by a user-supplied properties file. In the case where a properties file is supplied, the associated Preferences node may optionally be updated permanently from that file.

Note that applets are more restricted than applications in their power to manipulate permanent the options settings permanently recorded in the Preferences nodes.

When a JAOptions collection is constructed, it is supplied with a JAEnv utilities processor, and defined by the name of the associated application-specific Preferences node, together with a pair of CLI-style argument strings, which specify the application-specific Properties URL and its mode of use:
       [(-s[ession] | -u[pdate])] [properties-URL]

The first argument indicates whether the properties are to be used for the given session only, or if the associated Preferences node is to be permanantly updated with these properties; the default value is -session only. If the properties-URL argument is omitted the associated Preferences node name is used (resolved against the appropriate base URL). A properties file name with no extension automatically has the the extension .properties appended to it.


Nested Class Summary
static interface JAOptions.KeyChecker
          Key validity checking interface -- used when checking that a given preference key is valid in the context of an applet, as opposed to an app.
 
Field Summary
static java.lang.String DEFAULT_JA_PREFS
          Default Preferences node name.
static java.lang.String DEFAULT_PROPS_FILE
          Common defaults properties file name.
static char SEPARATOR
          Separator character for multi-component string option values.
static java.lang.String SEPARATOR_STR
          String containing the separator character for multi-component string option values.
 
Method Summary
 boolean animgenDoLog()
          Returns the setting of the "animgen.do.log" option.
 float animgenFPS()
          Returns the setting of the "animgen.fps" (frames-per-second) option.
 boolean animgenLogDoAppend()
          Returns the setting of the "animgen.log.do.append" option.
 java.lang.String animgenLogFileURL()
          Returns the setting of the "animgen.log.file.uri" option.
 int[] appWindowLocationAndSize()
          Returns the values (x,y,width,height) from the "app.window.loc.size" option.
 java.lang.String avatarConfigBaseURL()
          Returns the setting of the "avatar.config.base.uri" option.
 boolean avatarDefinitionIsToBeSaved()
          Returns the setting of the "avatar.definition.do.save" option.
 java.lang.String avatarDefinitionSaveURL()
          Returns the setting of the "avatar.definition.save.uri" option.
 java.lang.String avatarDefinitionVersion()
          Returns the setting of the "avatar.definition.version" option.
 java.lang.String avatarID()
          Returns the setting of the "avatar.id" option.
 java.lang.String[] avatarIDList()
          Returns the setting of the "avatar.id.list" option.
 boolean avatarMenuDoUseSubmenus()
          Returns the setting of the "avatar.menu.do.use.submenus" option.
 java.lang.String avatarSpecialDefinitionURL()
          Returns the setting of the "avatar.special.definition.uri" option.
 java.lang.String avatarSubmenuSpecs()
          Returns the setting of the "avatar.submenu.specs" option.
 java.lang.String[] cacheableAvatarList()
          Returns the setting of the "cacheable.avatar.list" option.
 java.lang.String cacheableAvatarURI(java.lang.String avatar)
          Returns the setting of the cacheable avatar URI key for the given avatar.
 float[] cameraSettings()
          Returns an array of camera-settings values taken from the "camera.settings" option; any entries for which no setting is available will be set to -1.
 float[] cameraSettings(int SIZE)
          Returns an array of camera-settings values taken from the "camera.settings" option; the array has the given size if that value is non-negative, or the actual number of available settings values otherwise; any entries for which no setting is available will be set to -1.
 float[] cameraSettings(int SIZE, float DFLT)
          Returns an array of camera-settings values taken from the "camera.settings" option; the array has the given size if that value is non-negative, or the actual number of available settings values otherwise; any entries for which no setting is available will be set to the given default value.
static java.lang.String cameraSettingsString(float[] cam)
          Returns the string representataion of the given camera settings values.
 java.lang.String defaultSiGMLBaseURL()
          Returns the setting of the "default.sigml.base.uri" option.
 java.lang.String[] directFilesAvatarList()
          Returns the setting of the "direct.files.avatar.list" option.
 java.lang.String directFilesAvatarURI(java.lang.String avatar)
          Returns the setting of the direct files avatar base URI key for the given avatar.
 boolean doAvatarSelfSliding()
          Returns the setting of the "do.avatar.self.sliding" option.
 boolean doAvatarSkinSliding()
          Returns the setting of the "do.avatar.skin.sliding" option.
 boolean doForceAWT()
          Returns the setting of the "do.use.awt.only" option.
 boolean doLazyAvatarCacheRefresh()
          Returns the setting of the "do.lazy.avatar.cache.refresh" option.
 boolean doShowAnimationTimes()
          Returns the setting of the "do.show.animation.times" option.
 boolean doStreamedAnimationBuild()
          Returns the setting of the "do.streamed.animation.build" option.
 AvatarsEnv getAvatarsEnv()
          Returns the avatars-data handler for this JAOptions set.
 java.lang.String getBaseURLProperty(java.lang.String key)
          Returns the Base URL property with the given key.
 boolean getBooleanProperty(java.lang.String key)
          Returns the boolean property with the given key.
 float getFloatProperty(java.lang.String key)
          Returns the int property with the given key.
 int getIntegerProperty(java.lang.String key)
          Returns the int property with the given key.
 JAEnv getJAEnv()
          Returns the JAEnv instance for this JAOptions set.
 java.lang.String getOutputURLProperty(java.lang.String key)
          Returns the Output URL property with the given key.
 java.lang.String[] getStringListProperty(java.lang.String key)
          Returns the String list property with the given key, obtained by obtaining the property as a String and splitting it on the standard separator character, ":"; the result is guaranteed to be non-null.
 java.lang.String getStringProperty(java.lang.String key)
          Returns the String property with the given key.
 java.lang.String getURLProperty(java.lang.String key)
          Returns the URL property with the given key.
static java.lang.String[] JA_OPTION_KEYS()
          Returns a list of known JA Option key names.
static JAOptions makeJAOptions(java.lang.String prefs, java.lang.String[] args, java.applet.Applet applet, JAEnv jaenv)
          Factory method for a new JAOptions set, using the Preferences node name prefs, with supplementary options and their mode as specified by the given command-line argumments (see JAOptions class description); applet is the applet that owns the option set, or null if the set belongs to an application, and jaenv is the JA environment that hosts the option set.
static JAOptions makeJAOptions(java.lang.String prefs, java.lang.String[] args, JAEnv jaenv)
          Factory method for a new JAOptions set, using the Preferences node name prefs, with supplementary options and their mode as specified by the given command-line argumments (see JAOptions class description); the option set belongs to an application, and jaenv is the JA environment that hosts it.
 boolean meshDuplicatesFormatIsNew()
          Returns the setting of the "mesh.duplicates.format.is.new" option.
 int playerFramesDriftLimitMS()
          Returns the setting of the "player.frame.drift.limit.ms" option.
 boolean textureFileOnlyIsToBeSaved()
          Returns a flag value indicating whether or not the texture file alone is to be saved, that is, if the texture is to be saved as a separate file, but not as part of the process of saving the main JARP avatar definition.
 boolean textureInputFormatIsJARP()
          Returns the setting of the "texture.input.format.is.jarp" option.
 boolean textureInputIsCompressed()
          Returns the setting of the "texture.input.is.compressed" option.
 boolean textureInputIsFlipped()
          Returns the setting of the "texture.input.is.flipped" option.
 boolean textureInputIsSeparate()
          Returns the setting of the "texture.input.is.separate" option.
 java.lang.String textureInputURL()
          Returns the setting of the "texture.input.uri" option.
 boolean textureIsToBeSaved()
          Returns the setting of the "texture.do.save" option.
 boolean textureOutputDoCompressed()
          Returns the setting of the "texture.output.do.compressed" option.
 boolean textureOutputDoFlipPNG()
          Returns the setting of the "texture.output.do.flip.png" option.
 boolean textureOutputDoPNG()
          Returns the setting of the "texture.output.do.png" option.
 boolean textureOutputIsSeparate()
          Returns the setting of the "texture.output.is.separate" option.
 java.lang.String textureSaveFileURL()
          Returns the setting of the "texture.save.file.uri" option.
 java.lang.String textureSeparateFileName()
          Returns the setting of the "texture.separate.file.name" option.
 void updateAppWindowLocationAndSize(int[] xywh)
          Updates the "app.window.loc.size" option with the given values (x,y,width,height).
 void updateAvatarID(java.lang.String avatar)
          Updates the "avatar.id" property.
 void updateBooleanProperty(java.lang.String key, boolean bval)
          Updates this options collection and, if appropriate, the underlying preferences with the given boolean key-value pair.
 void updateCameraSettings(float[] cam)
          Updates the "camera.settings" option with the given values.
 void updateDefaultSiGMLBaseURL(java.lang.String base)
          Updates the "avatar.id" property.
 void updateDoStreamedAnimationBuild(boolean dosab)
          Updates the "do.streamed.animation.build" option with the given flag value.
 void updateStringProperty(java.lang.String key, java.lang.String value)
          Updates this options collection and, if appropriate, the underlying preferences with the given key-value pair.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEPARATOR

public static final char SEPARATOR
Separator character for multi-component string option values.

See Also:
Constant Field Values

SEPARATOR_STR

public static final java.lang.String SEPARATOR_STR
String containing the separator character for multi-component string option values.

See Also:
Constant Field Values

DEFAULT_JA_PREFS

public static final java.lang.String DEFAULT_JA_PREFS
Default Preferences node name.

See Also:
Constant Field Values

DEFAULT_PROPS_FILE

public static final java.lang.String DEFAULT_PROPS_FILE
Common defaults properties file name.

See Also:
Constant Field Values
Method Detail

makeJAOptions

public static JAOptions makeJAOptions(java.lang.String prefs,
                                      java.lang.String[] args,
                                      JAEnv jaenv)
Factory method for a new JAOptions set, using the Preferences node name prefs, with supplementary options and their mode as specified by the given command-line argumments (see JAOptions class description); the option set belongs to an application, and jaenv is the JA environment that hosts it.


makeJAOptions

public static JAOptions makeJAOptions(java.lang.String prefs,
                                      java.lang.String[] args,
                                      java.applet.Applet applet,
                                      JAEnv jaenv)
Factory method for a new JAOptions set, using the Preferences node name prefs, with supplementary options and their mode as specified by the given command-line argumments (see JAOptions class description); applet is the applet that owns the option set, or null if the set belongs to an application, and jaenv is the JA environment that hosts the option set.


getJAEnv

public JAEnv getJAEnv()
Returns the JAEnv instance for this JAOptions set.


getAvatarsEnv

public AvatarsEnv getAvatarsEnv()
Returns the avatars-data handler for this JAOptions set.


updateStringProperty

public void updateStringProperty(java.lang.String key,
                                 java.lang.String value)
Updates this options collection and, if appropriate, the underlying preferences with the given key-value pair.


updateBooleanProperty

public void updateBooleanProperty(java.lang.String key,
                                  boolean bval)
Updates this options collection and, if appropriate, the underlying preferences with the given boolean key-value pair.


getStringProperty

public java.lang.String getStringProperty(java.lang.String key)
Returns the String property with the given key.


getStringListProperty

public java.lang.String[] getStringListProperty(java.lang.String key)
Returns the String list property with the given key, obtained by obtaining the property as a String and splitting it on the standard separator character, ":"; the result is guaranteed to be non-null.


getBooleanProperty

public boolean getBooleanProperty(java.lang.String key)
Returns the boolean property with the given key.


getURLProperty

public java.lang.String getURLProperty(java.lang.String key)
Returns the URL property with the given key.


getBaseURLProperty

public java.lang.String getBaseURLProperty(java.lang.String key)
Returns the Base URL property with the given key.


getOutputURLProperty

public java.lang.String getOutputURLProperty(java.lang.String key)
Returns the Output URL property with the given key.


getIntegerProperty

public int getIntegerProperty(java.lang.String key)
Returns the int property with the given key.


getFloatProperty

public float getFloatProperty(java.lang.String key)
Returns the int property with the given key.


doForceAWT

public boolean doForceAWT()
Returns the setting of the "do.use.awt.only" option.


doShowAnimationTimes

public boolean doShowAnimationTimes()
Returns the setting of the "do.show.animation.times" option.


doStreamedAnimationBuild

public boolean doStreamedAnimationBuild()
Returns the setting of the "do.streamed.animation.build" option.


updateDoStreamedAnimationBuild

public void updateDoStreamedAnimationBuild(boolean dosab)
Updates the "do.streamed.animation.build" option with the given flag value.


doAvatarSkinSliding

public boolean doAvatarSkinSliding()
Returns the setting of the "do.avatar.skin.sliding" option.


doAvatarSelfSliding

public boolean doAvatarSelfSliding()
Returns the setting of the "do.avatar.self.sliding" option.


appWindowLocationAndSize

public int[] appWindowLocationAndSize()
Returns the values (x,y,width,height) from the "app.window.loc.size" option.


updateAppWindowLocationAndSize

public void updateAppWindowLocationAndSize(int[] xywh)
Updates the "app.window.loc.size" option with the given values (x,y,width,height).


cameraSettings

public float[] cameraSettings(int SIZE,
                              float DFLT)
Returns an array of camera-settings values taken from the "camera.settings" option; the array has the given size if that value is non-negative, or the actual number of available settings values otherwise; any entries for which no setting is available will be set to the given default value.


cameraSettings

public float[] cameraSettings(int SIZE)
Returns an array of camera-settings values taken from the "camera.settings" option; the array has the given size if that value is non-negative, or the actual number of available settings values otherwise; any entries for which no setting is available will be set to -1.


cameraSettings

public float[] cameraSettings()
Returns an array of camera-settings values taken from the "camera.settings" option; any entries for which no setting is available will be set to -1.


updateCameraSettings

public void updateCameraSettings(float[] cam)
Updates the "camera.settings" option with the given values.


cameraSettingsString

public static java.lang.String cameraSettingsString(float[] cam)
Returns the string representataion of the given camera settings values.


avatarConfigBaseURL

public java.lang.String avatarConfigBaseURL()
Returns the setting of the "avatar.config.base.uri" option.


avatarID

public java.lang.String avatarID()
Returns the setting of the "avatar.id" option.


updateAvatarID

public void updateAvatarID(java.lang.String avatar)
Updates the "avatar.id" property.


avatarIDList

public java.lang.String[] avatarIDList()
Returns the setting of the "avatar.id.list" option.


directFilesAvatarList

public java.lang.String[] directFilesAvatarList()
Returns the setting of the "direct.files.avatar.list" option.


cacheableAvatarList

public java.lang.String[] cacheableAvatarList()
Returns the setting of the "cacheable.avatar.list" option.


directFilesAvatarURI

public java.lang.String directFilesAvatarURI(java.lang.String avatar)
Returns the setting of the direct files avatar base URI key for the given avatar.


cacheableAvatarURI

public java.lang.String cacheableAvatarURI(java.lang.String avatar)
Returns the setting of the cacheable avatar URI key for the given avatar.


avatarMenuDoUseSubmenus

public boolean avatarMenuDoUseSubmenus()
Returns the setting of the "avatar.menu.do.use.submenus" option.


avatarSubmenuSpecs

public java.lang.String avatarSubmenuSpecs()
Returns the setting of the "avatar.submenu.specs" option.


avatarSpecialDefinitionURL

public java.lang.String avatarSpecialDefinitionURL()
Returns the setting of the "avatar.special.definition.uri" option.


avatarDefinitionVersion

public java.lang.String avatarDefinitionVersion()
Returns the setting of the "avatar.definition.version" option.


avatarDefinitionSaveURL

public java.lang.String avatarDefinitionSaveURL()
Returns the setting of the "avatar.definition.save.uri" option.


avatarDefinitionIsToBeSaved

public boolean avatarDefinitionIsToBeSaved()
Returns the setting of the "avatar.definition.do.save" option.


doLazyAvatarCacheRefresh

public boolean doLazyAvatarCacheRefresh()
Returns the setting of the "do.lazy.avatar.cache.refresh" option.


animgenLogFileURL

public java.lang.String animgenLogFileURL()
Returns the setting of the "animgen.log.file.uri" option.


animgenDoLog

public boolean animgenDoLog()
Returns the setting of the "animgen.do.log" option.


animgenLogDoAppend

public boolean animgenLogDoAppend()
Returns the setting of the "animgen.log.do.append" option.


animgenFPS

public float animgenFPS()
Returns the setting of the "animgen.fps" (frames-per-second) option.


defaultSiGMLBaseURL

public java.lang.String defaultSiGMLBaseURL()
Returns the setting of the "default.sigml.base.uri" option.


updateDefaultSiGMLBaseURL

public void updateDefaultSiGMLBaseURL(java.lang.String base)
Updates the "avatar.id" property.


playerFramesDriftLimitMS

public int playerFramesDriftLimitMS()
Returns the setting of the "player.frame.drift.limit.ms" option.


meshDuplicatesFormatIsNew

public boolean meshDuplicatesFormatIsNew()
Returns the setting of the "mesh.duplicates.format.is.new" option.


textureInputURL

public java.lang.String textureInputURL()
Returns the setting of the "texture.input.uri" option.


textureInputIsSeparate

public boolean textureInputIsSeparate()
Returns the setting of the "texture.input.is.separate" option.


textureInputFormatIsJARP

public boolean textureInputFormatIsJARP()
Returns the setting of the "texture.input.format.is.jarp" option.


textureInputIsCompressed

public boolean textureInputIsCompressed()
Returns the setting of the "texture.input.is.compressed" option.


textureInputIsFlipped

public boolean textureInputIsFlipped()
Returns the setting of the "texture.input.is.flipped" option.


textureSeparateFileName

public java.lang.String textureSeparateFileName()
Returns the setting of the "texture.separate.file.name" option.


textureOutputIsSeparate

public boolean textureOutputIsSeparate()
Returns the setting of the "texture.output.is.separate" option.


textureOutputDoCompressed

public boolean textureOutputDoCompressed()
Returns the setting of the "texture.output.do.compressed" option.


textureOutputDoPNG

public boolean textureOutputDoPNG()
Returns the setting of the "texture.output.do.png" option.


textureOutputDoFlipPNG

public boolean textureOutputDoFlipPNG()
Returns the setting of the "texture.output.do.flip.png" option.


textureSaveFileURL

public java.lang.String textureSaveFileURL()
Returns the setting of the "texture.save.file.uri" option.


textureIsToBeSaved

public boolean textureIsToBeSaved()
Returns the setting of the "texture.do.save" option.


textureFileOnlyIsToBeSaved

public boolean textureFileOnlyIsToBeSaved()
Returns a flag value indicating whether or not the texture file alone is to be saved, that is, if the texture is to be saved as a separate file, but not as part of the process of saving the main JARP avatar definition.


JA_OPTION_KEYS

public static final java.lang.String[] JA_OPTION_KEYS()
Returns a list of known JA Option key names.