public class ActionableModel extends FeatureModel implements Actionable
Constructor and Description |
---|
ActionableModel(Services services,
Setup setup)
Create an actionable model.
|
Modifier and Type | Method and Description |
---|---|
Rectangle |
getButton()
Get the button surface representation.
|
String |
getDescription()
Get the action description.
|
boolean |
isOver()
Check if cursor is over the action button.
|
void |
prepare(FeatureProvider provider)
Prepare the feature.
|
void |
setAction(Action action)
Set the executable action.
|
void |
setClickAction(int click)
Set the mouse click selection value to
Action.execute() the action. |
void |
update(double extrp) |
checkListener, getFeature, getFeatures, getFeaturesType, hasFeature
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkListener
getFeature, getFeatures, getFeaturesType, hasFeature
public ActionableModel(Services services, Setup setup)
The Services
must provide:
The Setup
must provide a valid ActionConfig
.
If the Featurable
owner is an Action
, it will automatically setAction(Action)
on it.
services
- The services reference.setup
- The setup reference.public void prepare(FeatureProvider provider)
Feature
Featurable.addFeature(Feature)
or
Featurable.addFeatureAndGet(Feature)
.prepare
in interface Feature
prepare
in class FeatureModel
provider
- The owner reference.public void setAction(Action action)
Actionable
setAction
in interface Actionable
action
- The action to execute.public void setClickAction(int click)
Actionable
Action.execute()
the action.setClickAction
in interface Actionable
click
- The click number.InputDevicePointer
public Rectangle getButton()
Actionable
getButton
in interface Actionable
public String getDescription()
Actionable
getDescription
in interface Actionable
public boolean isOver()
Actionable
isOver
in interface Actionable
true
if cursor is over, false
else.Copyright © 2017 Byron 3D Games Studio. All rights reserved.