com.threerings.tudey.client.sprite
Class PlaceableSprite

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

public class PlaceableSprite
extends EntrySprite
implements ConfigUpdateListener<PlaceableConfig>

Represents a placeable entry.


Nested Class Summary
static class PlaceableSprite.ClickableProp
          A prop that may be clicked to perform some action.
static class PlaceableSprite.Implementation
          The actual sprite implementation.
static class PlaceableSprite.Marker
          A marker implementation.
static class PlaceableSprite.Original
          Superclass of the original implementations.
static class PlaceableSprite.Prop
          A prop implementation.
 
Field Summary
 
Fields inherited from interface com.threerings.expr.Scope
EPOCH, NOW
 
Constructor Summary
PlaceableSprite(TudeyContext ctx, TudeySceneView view, TudeySceneModel.PlaceableEntry entry)
          Creates a new placeable sprite.
 
Method Summary
 void configUpdated(ConfigEvent<PlaceableConfig> event)
          Called when a configuration has been updated.
 Component createTooltipComponent(String tiptext)
          Creates a tooltip component for the sprite (will only be called if Sprite.getTooltipText() returns true).
 boolean dispatchEvent(Event event)
          Dispatches an event on the sprite.
 void dispose()
          Releases the resources associated with this scope.
 TudeySceneModel.Entry getEntry()
          Returns a reference to the most recently set entry state.
 int getFloorFlags()
          Returns the sprite's floor flags.
 Model getModel()
          Returns the model associated with the sprite (if any).
 String getTooltipText()
          Returns the sprite's tooltip text, or null for none.
 float getTooltipTimeout()
          Returns the sprite's tooltip timeout, or -1 to use the default.
 String getTooltipWindowStyle()
          Returns the sprite's tooltip window style.
 boolean isClickable()
          Determines whether the sprite is clickable.
 boolean isHoverable()
          Determines whether the sprite is hoverable (for purposes of in-game user interaction).
 void scopeUpdated(ScopeEvent event)
          Called when the scope has been updated.
 void setSelected(boolean selected)
          Sets whether or not this sprite is selected.
 void update(TudeySceneModel.Entry entry)
          Updates the sprite with new entry state.
 
Methods inherited from class com.threerings.tudey.client.sprite.EntrySprite
isSelected
 
Methods inherited from class com.threerings.tudey.client.sprite.Sprite
getFloorMask, getScopeName, setVisible
 
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
 

Constructor Detail

PlaceableSprite

public PlaceableSprite(TudeyContext ctx,
                       TudeySceneView view,
                       TudeySceneModel.PlaceableEntry entry)
Creates a new placeable sprite.

Method Detail

configUpdated

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

Specified by:
configUpdated in interface ConfigUpdateListener<PlaceableConfig>

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

getFloorFlags

public int getFloorFlags()
Description copied from class: Sprite
Returns the sprite's floor flags.

Overrides:
getFloorFlags in class Sprite

isHoverable

public boolean isHoverable()
Description copied from class: Sprite
Determines whether the sprite is hoverable (for purposes of in-game user interaction).

Overrides:
isHoverable in class Sprite

isClickable

public boolean isClickable()
Description copied from class: Sprite
Determines whether the sprite is clickable.

Overrides:
isClickable in class Sprite

getTooltipText

public String getTooltipText()
Description copied from class: Sprite
Returns the sprite's tooltip text, or null for none.

Overrides:
getTooltipText in class Sprite

getTooltipTimeout

public float getTooltipTimeout()
Description copied from class: Sprite
Returns the sprite's tooltip timeout, or -1 to use the default.

Overrides:
getTooltipTimeout in class Sprite

getTooltipWindowStyle

public String getTooltipWindowStyle()
Description copied from class: Sprite
Returns the sprite's tooltip window style.

Overrides:
getTooltipWindowStyle in class Sprite

createTooltipComponent

public Component createTooltipComponent(String tiptext)
Description copied from class: Sprite
Creates a tooltip component for the sprite (will only be called if Sprite.getTooltipText() returns true).

Overrides:
createTooltipComponent in class Sprite

dispatchEvent

public boolean dispatchEvent(Event event)
Description copied from class: Sprite
Dispatches an event on the sprite.

Overrides:
dispatchEvent in class Sprite
Returns:
true if the sprite handled the event, false if it should be handled elsewhere.

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

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.