Added a bevy of interfaces that Sprites can implement to be recognized

by the MediaPanel as sprites that interact in some standard way with the
mouse.
Modified existing ButtonSprite to work this new way, and it now implements
CommandSprite, ArmingSprite, and DisableableSprite. One method name changed.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3362 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2005-02-22 04:14:44 +00:00
parent 097730e84d
commit 7ec0eeca56
7 changed files with 190 additions and 54 deletions
@@ -0,0 +1,16 @@
//
// $Id$
package com.threerings.media.sprite.action;
/**
* An Action sprite is a sprite that may be pressed to generate an
* ActionEvent that will be posted to the Controller hierarchy.
*/
public interface ActionSprite
{
/**
* @return the action command to submit if this sprite is clicked.
*/
public String getActionCommand ();
}
@@ -0,0 +1,16 @@
//
// $Id$
package com.threerings.media.sprite.action;
/**
* An ActionSprite that wishes to be notified of events when it is armed
* or not.
*/
public interface ArmingSprite extends ActionSprite
{
/**
* Render this sprite such that is is drawn "armed".
*/
public void setArmed (boolean armed);
}
@@ -0,0 +1,16 @@
//
// $Id$
package com.threerings.media.sprite.action;
/**
* Extends CommandSprite to be a sprite that posts CommandEvents to
* the Controller hierarchy.
*/
public interface CommandSprite extends ActionSprite
{
/**
* @return the argument to the action command.
*/
public Object getCommandArgument();
}
@@ -0,0 +1,16 @@
//
// $Id$
package com.threerings.media.sprite.action;
/**
* Indicates a Sprite that may or may not be enabled to receive
* action / hover / arming notifications.
*/
public interface DisableableSprite
{
/**
* @return true if this sprite is currently enabled.
*/
public boolean isEnabled ();
}
@@ -0,0 +1,16 @@
//
// $Id$
package com.threerings.media.sprite.action;
/**
* An interface indicating that a sprite wishes to be notified when
* the mouse hovers over it.
*/
public interface HoverSprite
{
/**
* Set the current hover state.
*/
public void setHovered (boolean hovered);
}