com.threerings.tudey.client.sprite
Class PathSprite

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.PathSprite
All Implemented Interfaces:
ConfigUpdateListener<PathConfig>, Scope, ScopeUpdateListener

public class PathSprite
extends EntrySprite
implements ConfigUpdateListener<PathConfig>

Represents a path entry.


Nested Class Summary
static class PathSprite.Implementation
          The actual sprite implementation.
static class PathSprite.Original
          An original implementation.
 
Field Summary
static String EDGE_MODEL
          The name of the model to use to represent path and area edges.
static String VERTEX_MODEL
          The name of the model to use to represent path and area vertices.
 
Fields inherited from interface com.threerings.expr.Scope
EPOCH, NOW
 
Constructor Summary
PathSprite(TudeyContext ctx, TudeySceneView view, TudeySceneModel.PathEntry entry)
          Creates a new path sprite.
 
Method Summary
 void configUpdated(ConfigEvent<PathConfig> event)
          Called when a configuration has been updated.
 void dispose()
          Releases the resources associated with this scope.
 int getEdgeIndex(Model model)
          Returns the index of the specified model within the list of edge models, or -1 if it is not an edge.
 TudeySceneModel.Entry getEntry()
          Returns a reference to the most recently set entry state.
 int getVertexIndex(Model model)
          Returns the index of the specified model within the list of vertex models, or -1 if it is not a vertex.
static Model[] maybeResize(Model[] omodels, int ncount, TudeyContext ctx, Scene scene, String name, ColorState colorState, Object userObject)
          Resizes the specified array of models if necessary, adding new models or removing models as required.
 void scopeUpdated(ScopeEvent event)
          Called when the scope has been updated.
 void setSelected(boolean selected)
          Sets whether or not this sprite is selected.
 void setVisible(boolean visible)
          Attempt to set the visibility of this sprite.
 void update(TudeySceneModel.Entry entry)
          Updates the sprite with new entry state.
static void updateEdges(TudeySceneModel.Vertex[] vertices, Model[] models)
          Updates the supplied array of edge models based on the vertex state.
static float updateVertices(TudeySceneModel.Vertex[] vertices, Model[] models)
          Updates the supplied array of vertex models based on the vertex state.
 
Methods inherited from class com.threerings.tudey.client.sprite.EntrySprite
isSelected
 
Methods inherited from class com.threerings.tudey.client.sprite.Sprite
createTooltipComponent, dispatchEvent, getFloorFlags, getFloorMask, getModel, getScopeName, getTooltipText, getTooltipTimeout, getTooltipWindowStyle, isClickable, isHoverable
 
Methods inherited from class com.threerings.expr.SimpleScope
addListener, get, getParentScope, removeListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERTEX_MODEL

public static final String VERTEX_MODEL
The name of the model to use to represent path and area vertices.

See Also:
Constant Field Values

EDGE_MODEL

public static final String EDGE_MODEL
The name of the model to use to represent path and area edges.

See Also:
Constant Field Values
Constructor Detail

PathSprite

public PathSprite(TudeyContext ctx,
                  TudeySceneView view,
                  TudeySceneModel.PathEntry entry)
Creates a new path sprite.

Method Detail

updateVertices

public static float updateVertices(TudeySceneModel.Vertex[] vertices,
                                   Model[] models)
Updates the supplied array of vertex models based on the vertex state.

Returns:
the minimum vertex z coordinate.

updateEdges

public static void updateEdges(TudeySceneModel.Vertex[] vertices,
                               Model[] models)
Updates the supplied array of edge models based on the vertex state.


maybeResize

public static Model[] maybeResize(Model[] omodels,
                                  int ncount,
                                  TudeyContext ctx,
                                  Scene scene,
                                  String name,
                                  ColorState colorState,
                                  Object userObject)
Resizes the specified array of models if necessary, adding new models or removing models as required.


getVertexIndex

public int getVertexIndex(Model model)
Returns the index of the specified model within the list of vertex models, or -1 if it is not a vertex.


getEdgeIndex

public int getEdgeIndex(Model model)
Returns the index of the specified model within the list of edge models, or -1 if it is not an edge.


configUpdated

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

Specified by:
configUpdated in interface ConfigUpdateListener<PathConfig>

scopeUpdated

public void scopeUpdated(ScopeEvent event)
Description copied from interface: ScopeUpdateListener
Called when the scope has been updated.

Specified by:
scopeUpdated in interface ScopeUpdateListener
Overrides:
scopeUpdated in class SimpleScope

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

setVisible

public void setVisible(boolean visible)
Description copied from class: Sprite
Attempt to set the visibility of this sprite. No guarantees are made.

Overrides:
setVisible in class Sprite

setSelected

public void setSelected(boolean selected)
Description copied from class: EntrySprite
Sets whether or not this sprite is selected.

Overrides:
setSelected in class EntrySprite

dispose

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

Overrides:
dispose in class SimpleScope


Copyright © 2011. All Rights Reserved.