com.threerings.tudey.client.cursor
Class TileCursor

java.lang.Object
  extended by com.threerings.expr.SimpleScope
      extended by com.threerings.tudey.client.cursor.Cursor
          extended by com.threerings.tudey.client.cursor.EntryCursor
              extended by com.threerings.tudey.client.cursor.TileCursor
All Implemented Interfaces:
ConfigUpdateListener<TileConfig>, Scope, ScopeUpdateListener, Compositable, Tickable

public class TileCursor
extends EntryCursor
implements ConfigUpdateListener<TileConfig>

A cursor for tiles.


Nested Class Summary
static class TileCursor.Implementation
          The actual cursor implementation.
static class TileCursor.Original
          The original implementation.
 
Field Summary
protected  TileConfig _config
          The tile config.
protected  TudeySceneModel.TileEntry _entry
          The prototype entry.
protected  TileCursor.Implementation _impl
          The cursor implementation.
protected static TileCursor.Implementation NULL_IMPLEMENTATION
          An implementation that does nothing.
 
Fields inherited from class com.threerings.tudey.client.cursor.EntryCursor
FOOTPRINT_COLOR
 
Fields inherited from class com.threerings.tudey.client.cursor.Cursor
_ctx
 
Fields inherited from class com.threerings.expr.SimpleScope
_parentScope
 
Fields inherited from interface com.threerings.expr.Scope
EPOCH, NOW
 
Constructor Summary
TileCursor(TudeyContext ctx, TudeySceneView view, TudeySceneModel.TileEntry entry)
          Creates a new tile cursor.
 
Method Summary
 void composite()
          Adds this object's Dependencys and Enqueueables to the compositor in preparation for rendering.
 void configUpdated(ConfigEvent<TileConfig> 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.
 Shape getShape()
          Returns a reference to the shape of the entry (or null for none).
protected  void setConfig(ConfigReference<TileConfig> ref)
          Sets the configuration of the tile.
protected  void setConfig(TileConfig config)
          Sets the configuration of the tile.
 void tick(float elapsed)
          Updates the state of this object based on the elapsed time in seconds.
 void update(TudeySceneModel.Entry entry)
          Updates the cursor with new entry state.
protected  void updateFromConfig()
          Updates this cursor to match its configuration.
 
Methods inherited from class com.threerings.tudey.client.cursor.Cursor
getScopeName
 
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.TileEntry _entry
The prototype entry.


_config

protected TileConfig _config
The tile config.


_impl

protected TileCursor.Implementation _impl
The cursor implementation.


NULL_IMPLEMENTATION

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

Constructor Detail

TileCursor

public TileCursor(TudeyContext ctx,
                  TudeySceneView view,
                  TudeySceneModel.TileEntry entry)
Creates a new tile cursor.

Method Detail

configUpdated

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

Specified by:
configUpdated in interface ConfigUpdateListener<TileConfig>

getEntry

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

Specified by:
getEntry in class EntryCursor

getShape

public Shape getShape()
Description copied from class: EntryCursor
Returns a reference to the shape of the entry (or null for none).

Specified by:
getShape in class EntryCursor

update

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

Specified by:
update in class EntryCursor

tick

public void tick(float elapsed)
Description copied from interface: Tickable
Updates the state of this object based on the elapsed time in seconds.

Specified by:
tick in interface Tickable
Overrides:
tick in class Cursor

composite

public void composite()
Description copied from interface: Compositable
Adds this object's Dependencys and Enqueueables to the compositor in preparation for rendering.

Specified by:
composite in interface Compositable
Overrides:
composite in class Cursor

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<TileConfig> ref)
Sets the configuration of the tile.


setConfig

protected void setConfig(TileConfig config)
Sets the configuration of the tile.


updateFromConfig

protected void updateFromConfig()
Updates this cursor to match its configuration.