Package com.simsilica.lemur.event
Class MouseEventControl
java.lang.Object
com.jme3.scene.control.AbstractControl
com.simsilica.lemur.event.MouseEventControl
- All Implemented Interfaces:
Savable,Control,JmeCloneable,Cloneable
A control that can be added to any Spatial to provide
standard MouseListener/MouseEvent support. The only requirement
is that the Spatial must be somewhere in a hierarchy that has
been provided to the MouseAppState or GuiGlobals class and that
MouseAppState is active (either manually attached to the StateManager
or done automatically by GuiGlobals.initialize())
-
Field Summary
Fields inherited from class com.jme3.scene.control.AbstractControl
enabled, spatial -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddListenersToSpatial(Spatial s, MouseListener... listeners) Convenience method that will add a MouseEventControl if it doesn't exist, while adding the specified listeners.voidprotected voidcontrolRender(RenderManager rm, ViewPort vp) To be implemented in subclass.protected voidcontrolUpdate(float tpf) To be implemented in subclass.<T extends MouseListener>
TgetMouseListener(Class<T> type) booleanisEmpty()voidmouseButtonEvent(MouseButtonEvent event, Spatial target, Spatial capture) voidmouseEntered(MouseMotionEvent event, Spatial target, Spatial capture) voidmouseExited(MouseMotionEvent event, Spatial target, Spatial capture) voidmouseMoved(MouseMotionEvent event, Spatial target, Spatial capture) static voidremoveListenersFromSpatial(Spatial s, MouseListener... listeners) Convenience method that will remove the specified listeners from a Spatial only if a MouseEventControl already exists.voidMethods inherited from class com.jme3.scene.control.AbstractControl
cloneFields, cloneForSpatial, getSpatial, isEnabled, jmeClone, read, render, setEnabled, setSpatial, update, write
-
Constructor Details
-
MouseEventControl
public MouseEventControl() -
MouseEventControl
-
-
Method Details
-
addListenersToSpatial
Convenience method that will add a MouseEventControl if it doesn't exist, while adding the specified listeners. -
removeListenersFromSpatial
Convenience method that will remove the specified listeners from a Spatial only if a MouseEventControl already exists. -
getMouseListener
-
isEmpty
public boolean isEmpty() -
addMouseListener
-
removeMouseListener
-
mouseButtonEvent
-
mouseEntered
-
mouseExited
-
mouseMoved
-
controlRender
Description copied from class:AbstractControlTo be implemented in subclass.- Specified by:
controlRenderin classAbstractControl- Parameters:
rm- the RenderManager rendering the controlled Spatial (not null)vp- the ViewPort being rendered (not null)
-
controlUpdate
protected void controlUpdate(float tpf) Description copied from class:AbstractControlTo be implemented in subclass.- Specified by:
controlUpdatein classAbstractControl- Parameters:
tpf- time per frame (in seconds)
-