com.threerings.tudey.client.sprite
Class GlobalSprite

java.lang.Object
  extended by com.threerings.expr.SimpleScope
      extended by com.threerings.tudey.client.sprite.Sprite
          extended by com.threerings.tudey.client.sprite.EntrySprite
              extended by com.threerings.tudey.client.sprite.GlobalSprite
All Implemented Interfaces:
ConfigUpdateListener<SceneGlobalConfig>, Scope, ScopeUpdateListener

public class GlobalSprite
extends EntrySprite
implements ConfigUpdateListener<SceneGlobalConfig>

Represents a global entry.


Nested Class Summary
static class GlobalSprite.Camera
          A camera implementation.
static class GlobalSprite.EnvironmentModel
          An environment model implementation.
static class GlobalSprite.Implementation
          The actual sprite implementation.
 
Field Summary
protected  SceneGlobalConfig _config
          The global configuration.
protected  TudeySceneModel.GlobalEntry _entry
          The scene entry.
protected  GlobalSprite.Implementation _impl
          The global implementation.
protected static GlobalSprite.Implementation NULL_IMPLEMENTATION
          An implementation that does nothing.
 
Fields inherited from class com.threerings.tudey.client.sprite.EntrySprite
_selected, SELECTED_COLOR
 
Fields inherited from class com.threerings.tudey.client.sprite.Sprite
_ctx, _view
 
Fields inherited from class com.threerings.expr.SimpleScope
_parentScope
 
Fields inherited from interface com.threerings.expr.Scope
EPOCH, NOW
 
Constructor Summary
GlobalSprite(TudeyContext ctx, TudeySceneView view, TudeySceneModel.GlobalEntry entry)
          Creates a new global sprite.
 
Method Summary
 void configUpdated(ConfigEvent<SceneGlobalConfig> event)
          Called when a configuration has been updated.
 void dispose()
          Releases the resources associated with this scope.
 TudeySceneModel.Entry getEntry()
          Returns a reference to the most recently set entry state.
 Model getModel()
          Returns the model associated with the sprite (if any).
protected  void setConfig(ConfigReference<SceneGlobalConfig> ref)
          Sets the configuration of this global.
protected  void setConfig(SceneGlobalConfig config)
          Sets the configuration of this global.
 void update(TudeySceneModel.Entry entry)
          Updates the sprite with new entry state.
protected  void updateFromConfig()
          Updates the global to match its new or modified configuration.
 
Methods inherited from class com.threerings.tudey.client.sprite.EntrySprite
isSelected, setSelected
 
Methods inherited from class com.threerings.tudey.client.sprite.Sprite
createTooltipComponent, dispatchEvent, getFloorFlags, getFloorMask, getScopeName, getTooltipText, getTooltipTimeout, getTooltipWindowStyle, isClickable, isHoverable, setVisible
 
Methods inherited from class com.threerings.expr.SimpleScope
addListener, get, getParentScope, removeListener, scopeUpdated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_entry

protected TudeySceneModel.GlobalEntry _entry
The scene entry.


_config

protected SceneGlobalConfig _config
The global configuration.


_impl

protected GlobalSprite.Implementation _impl
The global implementation.


NULL_IMPLEMENTATION

protected static final GlobalSprite.Implementation NULL_IMPLEMENTATION
An implementation that does nothing.

Constructor Detail

GlobalSprite

public GlobalSprite(TudeyContext ctx,
                    TudeySceneView view,
                    TudeySceneModel.GlobalEntry entry)
Creates a new global sprite.

Method Detail

configUpdated

public void configUpdated(ConfigEvent<SceneGlobalConfig> event)
Description copied from interface: ConfigUpdateListener
Called when a configuration has been updated.

Specified by:
configUpdated in interface ConfigUpdateListener<SceneGlobalConfig>

getEntry

public TudeySceneModel.Entry getEntry()
Description copied from class: EntrySprite
Returns a reference to the most recently set entry state.

Specified by:
getEntry in class EntrySprite

update

public void update(TudeySceneModel.Entry entry)
Description copied from class: EntrySprite
Updates the sprite with new entry state.

Specified by:
update in class EntrySprite

getModel

public Model getModel()
Description copied from class: Sprite
Returns the model associated with the sprite (if any).

Overrides:
getModel in class Sprite

dispose

public void dispose()
Description copied from class: SimpleScope
Releases the resources associated with this scope.

Overrides:
dispose in class SimpleScope

setConfig

protected void setConfig(ConfigReference<SceneGlobalConfig> ref)
Sets the configuration of this global.


setConfig

protected void setConfig(SceneGlobalConfig config)
Sets the configuration of this global.


updateFromConfig

protected void updateFromConfig()
Updates the global to match its new or modified configuration.