Jeospace API

org.jeospace.simulation
Class Profile

java.lang.Object
  extended byorg.jeospace.simulation.Profile

public class Profile
extends java.lang.Object

The primary configuration object for the simulation environment, Profile is analogous to the Unix user configuration profile. It contains user preferences and references to the working set(s) of components for the simulation. The Profile is backed by an xml file that describes initial values and states for Profile objects.

Version:
$Revision: 1.1.1.1 $
Author:
Rex Melton
See Also:
URL, Locale, TimeZone, Chronometer, Atlas, Document, Element

Constructor Summary
Profile(org.w3c.dom.Document document, java.net.URL codeBase)
          Construct a Profile initialized from the argument xml Document
Profile(java.lang.String name, java.net.URL codeBase)
          Construct a Profile
Profile(java.net.URL codeBase)
          Construct a Profile
 
Method Summary
 void addProfileListener(ProfileListener listener)
          Add a listener to this profile
 void closeAtlas(java.net.URL url)
          Remove the Atlas that cooresponds to the URL from the profile's working set.
protected  void fireProfileEvent(int id, java.lang.Object arg)
          Deliver events to the listeners
 org.w3c.dom.Element getActiveViewpoint()
          Return the Element that describes the current active viewpoint
 Atlas getAtlas(java.net.URL url)
          Return the Atlas that matches the url key string
 Atlas getAtlas(java.net.URL url, boolean createIfNull)
          Return the Atlas that matches the url key string
 java.util.List getAtlasList()
          Return the List of the profile's atlases.
 java.util.Map getAtlasMap()
          Return the Map of the profile's atlases.
 Chronometer getChronometer()
          Return the Chronometer
 java.net.URL getCodeBase()
          Return the base URL
 org.w3c.dom.Document getDocument()
          Return the xml Document that describes the state and references of the profile's objects.
 org.w3c.dom.Element getHomeViewpoint()
          Return the Element that describes the home viewpoint
 java.util.Locale getLocale()
          Return the Locale
 java.lang.String getName()
          Return the name of the profile
 java.util.TimeZone getTimeZone()
          Return the TimeZone
 boolean isDefaultLocale()
          Return a flag indicating that the profile's locale is also the system default locale.
 boolean isDefaultTimeZone()
          Return a flag indicating that the profile's timezone is also the system default timezone.
 void openAtlas(java.net.URL url, Atlas atlas)
          Add the argument Atlas to the profile's working set.
 void removeProfileListener(ProfileListener listener)
          Remove a listener from this profile
 void setActiveViewpoint(java.net.URL atlasURL, org.w3c.dom.Element viewpoint)
          Set the Element that describes the current active viewpoint
 void setDefaultLocale()
          Set the profile's locale to the system default locale.
 void setDefaultTimeZone()
          Set the profile's timezone to the system default timezone.
 void setHomeViewpoint(java.net.URL atlasURL, org.w3c.dom.Element viewpoint)
          Set the Element that describes the home viewpoint
 void setLocale(java.util.Locale locale)
          Set the Locale
 void setName(java.lang.String name)
          Set the name of the profile
 void setTimeZone(java.util.TimeZone timezone)
          Set the TimeZone
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Profile

public Profile(java.net.URL codeBase)
Construct a Profile

Parameters:
codeBase - the URL that functions as the base from which the configuration and simulation components can be loaded.

Profile

public Profile(java.lang.String name,
               java.net.URL codeBase)
Construct a Profile

Parameters:
name - the name of the profile.
codeBase - the URL that functions as the base from which the configuration and simulation components can be loaded.

Profile

public Profile(org.w3c.dom.Document document,
               java.net.URL codeBase)
Construct a Profile initialized from the argument xml Document

Parameters:
document - the xml Document containing the initial states and references.
codeBase - the URL that functions as the base from which the configuration and simulation components can be loaded.
Method Detail

getName

public java.lang.String getName()
Return the name of the profile

Returns:
the name of the profile

setName

public void setName(java.lang.String name)
Set the name of the profile

Parameters:
name - the name of the profile

getCodeBase

public java.net.URL getCodeBase()
Return the base URL

Returns:
the base URL

getChronometer

public Chronometer getChronometer()
Return the Chronometer

Returns:
the Chronometer

getLocale

public java.util.Locale getLocale()
Return the Locale

Returns:
the Locale

setLocale

public void setLocale(java.util.Locale locale)
Set the Locale

Parameters:
locale - the Locale

isDefaultLocale

public boolean isDefaultLocale()
Return a flag indicating that the profile's locale is also the system default locale.

Returns:
true if the profile's locale is also the system default locale, false

setDefaultLocale

public void setDefaultLocale()
Set the profile's locale to the system default locale.


getTimeZone

public java.util.TimeZone getTimeZone()
Return the TimeZone

Returns:
the TimeZone

setTimeZone

public void setTimeZone(java.util.TimeZone timezone)
Set the TimeZone

Parameters:
timezone - the TimeZone

isDefaultTimeZone

public boolean isDefaultTimeZone()
Return a flag indicating that the profile's timezone is also the system default timezone.

Returns:
true if the profile's timezone is also the system default timezone, false

setDefaultTimeZone

public void setDefaultTimeZone()
Set the profile's timezone to the system default timezone.


getHomeViewpoint

public org.w3c.dom.Element getHomeViewpoint()
Return the Element that describes the home viewpoint

Returns:
the Element that describes the home viewpoint

setHomeViewpoint

public void setHomeViewpoint(java.net.URL atlasURL,
                             org.w3c.dom.Element viewpoint)
Set the Element that describes the home viewpoint

Parameters:
atlasURL - the URL of the Atlas that contains the home viewpoint
viewpoint - the viewpoint Element

getActiveViewpoint

public org.w3c.dom.Element getActiveViewpoint()
Return the Element that describes the current active viewpoint

Returns:
the Element that describes the current active viewpoint

setActiveViewpoint

public void setActiveViewpoint(java.net.URL atlasURL,
                               org.w3c.dom.Element viewpoint)
Set the Element that describes the current active viewpoint

Parameters:
atlasURL - the URL of the Atlas that contains the current active viewpoint
viewpoint - the viewpoint Element

getAtlasMap

public java.util.Map getAtlasMap()
Return the Map of the profile's atlases. The atlases in the map are keyed by URL.

Returns:
the Map of the profile's atlases

getAtlasList

public java.util.List getAtlasList()
Return the List of the profile's atlases.

Returns:
the List of the profile's atlases

getAtlas

public Atlas getAtlas(java.net.URL url)
Return the Atlas that matches the url key string

Parameters:
url - the URL that describes the atlas's source
Returns:
the Atlas that matches the url key string or null if a match is not found.

getAtlas

public Atlas getAtlas(java.net.URL url,
                      boolean createIfNull)
Return the Atlas that matches the url key string

Parameters:
url - the URL that describes the atlas's source
createIfNull - flag indicating that a new empty atlas should be created and returned if one does not already exist. Otherwise, null will be returned.
Returns:
the Atlas that matches the url key string

openAtlas

public void openAtlas(java.net.URL url,
                      Atlas atlas)
Add the argument Atlas to the profile's working set.

Parameters:
url - the URL that describes the atlas's source
atlas - the atlas.

closeAtlas

public void closeAtlas(java.net.URL url)
Remove the Atlas that cooresponds to the URL from the profile's working set.

Parameters:
url - the URL that describes the atlas's source

getDocument

public org.w3c.dom.Document getDocument()
Return the xml Document that describes the state and references of the profile's objects.

Returns:
the xml document.

addProfileListener

public void addProfileListener(ProfileListener listener)
Add a listener to this profile

Parameters:
listener - the listener to add

removeProfileListener

public void removeProfileListener(ProfileListener listener)
Remove a listener from this profile

Parameters:
listener - the listener to remove

fireProfileEvent

protected void fireProfileEvent(int id,
                                java.lang.Object arg)
Deliver events to the listeners

Parameters:
id - the event ID
arg - the ProfileEvent argument Object

Jeospace API

Copyright © 2006 - jeospace.org