public abstract class GrabberObject extends Object implements Grabber
Grabber
object which eases third-party implementation of the
Grabber
interface.
Based on the concrete event type, this model object splits the
checkIfGrabsInput(BogusEvent)
and the performInteraction(BogusEvent)
methods into more specific versions of them, e.g.,
checkIfGrabsInput(ClickEvent)
, checkIfGrabsInput(DOF3Event)
,
performInteraction(DOF6Event)
, performInteraction(KeyboardEvent)
and
so on. Thus allowing implementations of this abstract GrabberObject to override only
those method signatures that might be of their interest.
Constructor and Description |
---|
GrabberObject()
Empty constructor.
|
GrabberObject(Agent agent)
Constructs and adds this grabber to the agent pool.
|
GrabberObject(InputHandler inputHandler)
Constructs and adds this grabber to all agents belonging to the input handler.
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkIfGrabsInput(BogusEvent event)
Defines the rules to set the grabber as an agent input-grabber.
|
boolean |
checkIfGrabsInput(MotionEvent event)
|
boolean |
grabsInput(Agent agent)
Check if this object is the
Agent.inputGrabber() . |
boolean |
grabsInput(InputHandler inputHandler)
Checks if the frame grabs input from any agent registered at the given input handler.
|
void |
performInteraction(BogusEvent event)
Defines how the grabber should react according to the given bogus-event.
|
public GrabberObject()
public GrabberObject(Agent agent)
Agent.grabbers()
public GrabberObject(InputHandler inputHandler)
InputHandler.agents()
public boolean grabsInput(Agent agent)
Agent.inputGrabber()
. Returns
true
if this object grabs the agent and false
otherwise.public boolean grabsInput(InputHandler inputHandler)
public void performInteraction(BogusEvent event)
Grabber
performInteraction
in interface Grabber
Agent.handle(BogusEvent)
public boolean checkIfGrabsInput(BogusEvent event)
Grabber
checkIfGrabsInput
in interface Grabber
Agent.updateTrackedGrabber(BogusEvent)
,
Agent.inputGrabber()
public boolean checkIfGrabsInput(MotionEvent event)
DOF1Event
, DOF2Event
,
DOF3Event
or DOF6Event
.
Override this method when you want the object to be picked from a
KeyboardEvent
.
Processing Library proscene by Jean Pierre Charalambos. (c) 2014-2017 National University of Colombia