com.threerings.util
Class ToolUtil.EditablePrefs

java.lang.Object
  extended by com.threerings.util.ToolUtil.EditablePrefs
Direct Known Subclasses:
GlCanvasTool.CanvasToolPrefs
Enclosing class:
ToolUtil

public static class ToolUtil.EditablePrefs
extends Object

A simple editable object used to manipulate preferences.


Field Summary
protected  Preferences _prefs
          The preferences node to use.
protected  File _resourceDir
          The resource directory.
protected  ResourceManager _rsrcmgr
          The resource manager.
 
Constructor Summary
ToolUtil.EditablePrefs(Preferences prefs)
          Creates a new editable prefs object using the specified underlying preferences.
 
Method Summary
protected  Color4f getPref(String key, Color4f def)
          Retrieves the value of a color preference.
protected  Object getPref(String key, Object def)
          Retrieves the value of an exportable preference.
 File getResourceDir()
          Returns the resource directory.
 void init(ResourceManager rsrcmgr)
          Initializes the prefs with a reference to the resource manager.
protected  void putPref(String key, Color4f value)
          Sets the value of a color preference.
protected  void putPref(String key, Object value)
          Sets the value of an exportable preference.
 void setResourceDir(File dir)
          Sets the resource directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_prefs

protected Preferences _prefs
The preferences node to use.


_rsrcmgr

protected ResourceManager _rsrcmgr
The resource manager.


_resourceDir

protected File _resourceDir
The resource directory.

Constructor Detail

ToolUtil.EditablePrefs

public ToolUtil.EditablePrefs(Preferences prefs)
Creates a new editable prefs object using the specified underlying preferences.

Method Detail

init

public void init(ResourceManager rsrcmgr)
Initializes the prefs with a reference to the resource manager.


setResourceDir

@Editable(mode="directory",
          nullable=true)
public void setResourceDir(File dir)
Sets the resource directory.


getResourceDir

@Editable
public File getResourceDir()
Returns the resource directory.


getPref

protected Color4f getPref(String key,
                          Color4f def)
Retrieves the value of a color preference.


putPref

protected void putPref(String key,
                       Color4f value)
Sets the value of a color preference.


getPref

protected Object getPref(String key,
                         Object def)
Retrieves the value of an exportable preference.


putPref

protected void putPref(String key,
                       Object value)
Sets the value of an exportable preference.