public class ObjectActionHandler extends Object
| Constructor and Description |
|---|
ObjectActionHandler() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
actionAllowed(String action)
Returns true if we should allow this object action, false if we should not.
|
SceneObjectIndicator |
createIndicator(MisoScenePanel panel,
String text,
Icon icon)
Creates an indicator for this type of object action.
|
static String |
getAction(String command)
Returns the unqualified object action (minus the type, see
getType(java.lang.String)). |
Icon |
getTipIcon(String action)
Returns the tooltip icon for the specified action or null if the action has no tooltip
icon.
|
String |
getTipText(String action)
Get the human readable object tip for the specified action.
|
static String |
getType(String command)
Returns the type associated with this action command (which is mapped to a registered
object action handler) or the empty string if it has no type.
|
void |
handleAction(SceneObject scobj,
ActionEvent event)
Called when an action is generated for an object.
|
RadialMenu |
handlePressed(SceneObject sourceObject)
Return a
RadialMenu or null if no menu needed. |
boolean |
isVisible(String action)
Returns true if we should display the text for the action.
|
static ObjectActionHandler |
lookup(String command)
Looks up the object action handler associated with the specified command.
|
static void |
register(String prefix,
ObjectActionHandler handler)
Registers an object action handler which will be called when a user clicks on an object in
a scene that has an associated action.
|
static void |
unregister(String prefix)
Removes an object action handler registration.
|
public boolean actionAllowed(String action)
public boolean isVisible(String action)
public String getTipText(String action)
public Icon getTipIcon(String action)
public RadialMenu handlePressed(SceneObject sourceObject)
RadialMenu or null if no menu needed.public void handleAction(SceneObject scobj, ActionEvent event)
public static String getType(String command)
public static String getAction(String command)
getType(java.lang.String)).public SceneObjectIndicator createIndicator(MisoScenePanel panel, String text, Icon icon)
public static ObjectActionHandler lookup(String command)
public static void register(String prefix, ObjectActionHandler handler)
public static void unregister(String prefix)
Copyright © 2015. All rights reserved.