com.threerings.toybox.util
Class ToyBoxContext

java.lang.Object
  extended by com.threerings.toybox.util.ToyBoxContext
All Implemented Interfaces:
CrowdContext, ParlorContext, PresentsContext, com.whirled.game.util.WhirledGameContext
Direct Known Subclasses:
GameViewTest.ToyBoxContextImpl, ToyBoxClient.ToyBoxContextImpl

public abstract class ToyBoxContext
extends Object
implements com.whirled.game.util.WhirledGameContext

Aggregates the various bits that are needed on the ToyBox client.


Constructor Summary
ToyBoxContext()
           
 
Method Summary
abstract  FrameManager getFrameManager()
          Returns a reference to our frame manager (used for media services).
abstract  KeyDispatcher getKeyDispatcher()
          Returns a reference to our key dispatcher.
abstract  MessageManager getMessageManager()
          Returns a reference to the message manager used by the client to generate localized messages.
 ResourceManager getResourceManager()
          Returns the resource manager which is used to load media resources.
abstract  ToyBoxDirector getToyBoxDirector()
          Returns a reference to our ToyBox director.
 Name getUsername()
          Convenience method to get the username of the currently logged on user.
 BufferedImage loadImage(String rsrcPath)
          Convenience method to load an image from our resource bundles.
 String xlate(String bundle, String message)
          Translates the specified message using the specified message bundle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.threerings.parlor.util.ParlorContext
getParlorDirector
 
Methods inherited from interface com.threerings.crowd.util.CrowdContext
clearPlaceView, getChatDirector, getLocationDirector, getOccupantDirector, setPlaceView
 
Methods inherited from interface com.threerings.presents.util.PresentsContext
getClient, getConfig, getDObjectManager
 

Constructor Detail

ToyBoxContext

public ToyBoxContext()
Method Detail

getMessageManager

public abstract MessageManager getMessageManager()
Returns a reference to the message manager used by the client to generate localized messages.

Specified by:
getMessageManager in interface CrowdContext
Specified by:
getMessageManager in interface com.whirled.game.util.WhirledGameContext

getToyBoxDirector

public abstract ToyBoxDirector getToyBoxDirector()
Returns a reference to our ToyBox director.


getFrameManager

public abstract FrameManager getFrameManager()
Returns a reference to our frame manager (used for media services).


getKeyDispatcher

public abstract KeyDispatcher getKeyDispatcher()
Returns a reference to our key dispatcher.


getResourceManager

public ResourceManager getResourceManager()
Returns the resource manager which is used to load media resources.


xlate

public String xlate(String bundle,
                    String message)
Translates the specified message using the specified message bundle.


getUsername

public Name getUsername()
Convenience method to get the username of the currently logged on user. Returns null when we're not logged on.


loadImage

public BufferedImage loadImage(String rsrcPath)
Convenience method to load an image from our resource bundles.