multivalent

Class Multivalent

public final class Multivalent extends Object

Execute application startup, and act as a central repository for resources shared among all browser windows.

Shared resources:

Specification and implementation versions are available from the java.lang.Package.

Version: $Revision: 1.15 $ $Date: 2003/06/02 04:41:46 $

Field Summary
static booleanDEVEL
static StringFILENAME_PREFERENCES
static URIHOME_SITE
URI of Multivalent home WWW site.
static booleanMONITOR
General monitoring flag.
static StringMSG_EXIT
static StringPREF_CACHEDIR
static StringVERSION
Method Summary
Iterator<Browser>browsersIterator()
BrowsergetBrowser(String name)
Returns Browser with given name.
BrowsergetBrowser(String name, String systemHub, boolean standalone)
Returns Browser with given name, with passed URL to system behaviors hub.
CachegetCache()
File cache.
Map<String,String>getGenreMap()
static MultivalentgetInstance()
Returns singleton instance (use instead of a constructor), from which preferences and other state can be accessed
ClassLoadergetJARsClassLoader()
Used by Behavior.
StringgetPreference(String key, String defaultval)
Returns preference under passed key, or if it doesn't exists sets value with defaultval and establishes this as the future preference value.
TimergetTimer()
Heartbeat timer calls observers every 100 ms.
static voidmain(String[] argv)
Starts up Multivalent Browser, automatically loading any files given as command line args.
Iterator<String>prefKeyIterator()
voidputPreference(String key, String val)
StringremapBehavior(String bename)
Returns preferred behavior according to substitution map in Preferences.txt.
voidremovePreference(String key)

Field Detail

DEVEL

public static final boolean DEVEL

FILENAME_PREFERENCES

public static final String FILENAME_PREFERENCES

HOME_SITE

public static final URI HOME_SITE
URI of Multivalent home WWW site.

MONITOR

public static final boolean MONITOR
General monitoring flag. true while developing, false when compile for distribution to users.

MSG_EXIT

public static final String MSG_EXIT
Safely destroy browsers and all their documents, and Destroy .

"EXIT": arg= java.util.HashMap attributes, in= INode root of tree, out=unused.

PREF_CACHEDIR

public static final String PREF_CACHEDIR

VERSION

public static final String VERSION

Method Detail

browsersIterator

public Iterator<Browser> browsersIterator()

getBrowser

public Browser getBrowser(String name)
Returns Browser with given name. If no such browser, create new one.

getBrowser

public Browser getBrowser(String name, String systemHub, boolean standalone)
Returns Browser with given name, with passed URL to system behaviors hub. If no such browser, create new one. This, not Browser's constructor, is the way to create new instances.

getCache

public Cache getCache()
File cache.

getGenreMap

public Map<String,String> getGenreMap()

getInstance

public static Multivalent getInstance()
Returns singleton instance (use instead of a constructor), from which preferences and other state can be accessed.

getJARsClassLoader

public ClassLoader getJARsClassLoader()
Used by Behavior. Maybe move there, or less likely move Behavior.getInstance here.

getPreference

public final String getPreference(String key, String defaultval)
Returns preference under passed key, or if it doesn't exists sets value with defaultval and establishes this as the future preference value. Keys are case insensitive.

getTimer

public Timer getTimer()
Heartbeat timer calls observers every 100 ms.

main

public static void main(String[] argv)
Starts up Multivalent Browser, automatically loading any files given as command line args. The command line option -version reports the version and exits. (Since the browser is usually started by double clicking an icon, general command line options are not used, in favor of a Preferences file.)

prefKeyIterator

public final Iterator<String> prefKeyIterator()

putPreference

public final void putPreference(String key, String val)

remapBehavior

public String remapBehavior(String bename)
Returns preferred behavior according to substitution map in Preferences.txt. Clients can ask for the preferred "Hyperlink" and get the lastest-greatest, which was written after the client. Replacements must subclass what they replace and should generally recognize as many attributes as applicable. Behavior remaps all behavior names.

removePreference

public final void removePreference(String key)