com.jme.ui
Class UIActiveObject

java.lang.Object
  extended bycom.jme.scene.Spatial
      extended bycom.jme.scene.Node
          extended bycom.jme.ui.UIObject
              extended bycom.jme.ui.UIActiveObject
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
UIButton, UICheck, UIEditBox

public abstract class UIActiveObject
extends UIObject

Author:
schustej
See Also:
Serialized Form

Field Summary
protected  java.util.Vector _actions
           
protected  UIActiveArea _hitArea
           
protected  InputHandler _inputHandler
           
protected  int _state
           
static int DOWN
           
static int DRAW_DOWN
           
static int DRAW_OVER
           
static int OVER
           
static int SELECTED
           
static int UP
           
 
Fields inherited from class com.jme.ui.UIObject
_bottomborder, _height, _leftborder, _quad, _rightborder, _textureStates, _topborder, _width, _x, _y, BORDER, INVERSE_BORDER, TEXTURE
 
Fields inherited from class com.jme.scene.Node
children
 
Fields inherited from class com.jme.scene.Spatial
currentStates, defaultStateList, forceCull, forceView, frustrumIntersects, geometricalControllers, lightCombineMode, localRotation, localScale, localTranslation, name, parent, queueDistance, renderQueueMode, renderStateList, textureCombineMode, worldBound, worldRotation, worldScale, worldTranslation, zOrder
 
Constructor Summary
UIActiveObject(java.lang.String name, int x, int y, int width, int height, InputHandler inputHandler, UIColorScheme scheme, int flags)
           
 
Method Summary
 void addAction(UIInputAction action)
          Add an inputaction that will be fired when the control changes state
 void centerAt(int x, int y)
          Places the center of the control at the given screen location
protected  void fireActions()
          When called, all registered actions will be fired using 'this' object as the reference from where the fire was called.
 int getState()
          returns the current state of the control
protected  boolean hitTest()
          Checks the hitarea for the mouse location
 void removeAction(UIInputAction action)
          removes a given input action
 void setAltBorderColors()
           
 void setBaseBorderColors()
           
 void setBaseColors()
           
 void setHighlightColors()
           
 void setLocation(int x, int y)
          Moves the quad around the screen, properly setting local params at the same time.
abstract  boolean update(float time)
          Abstract, must be implemented in the extentions
 
Methods inherited from class com.jme.ui.UIObject
getHeight, getWidth, setup, usingBorders, usingInverseBorder, usingStdBorder, usingTexture
 
Methods inherited from class com.jme.scene.Node
applyRenderState, attachChild, detachAllChildren, detachChild, detachChildAt, detachChildNamed, draw, drawBounds, findCollisions, findPick, getChild, getChild, getChildren, getQuantity, hasChild, hasCollision, putClone, setChild, setForceView, updateCollisionTree, updateWorldBound, updateWorldData
 
Methods inherited from class com.jme.scene.Spatial
addController, applyDefaultStates, calculateCollisions, calculatePick, clearCurrentState, clearCurrentStates, clearRenderState, getController, getControllers, getCurrentState, getLastFrustumIntersection, getLightCombineMode, getLocalRotation, getLocalScale, getLocalTranslation, getName, getParent, getRenderQueueMode, getRenderStateList, getTextureCombineMode, getWorldBound, getWorldRotation, getWorldScale, getWorldTranslation, getZOrder, isForceCulled, isForceView, onDraw, onDrawBounds, propagateBoundToRoot, propagateStatesFromRoot, removeController, removeFromParent, setForceCull, setLightCombineMode, setLocalRotation, setLocalRotation, setLocalScale, setLocalScale, setLocalTranslation, setName, setParent, setRenderQueueMode, setRenderState, setTextureCombineMode, setWorldBound, setZOrder, toString, updateGeometricState, updateRenderState, updateRenderState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DRAW_DOWN

public static final int DRAW_DOWN
See Also:
Constant Field Values

DRAW_OVER

public static final int DRAW_OVER
See Also:
Constant Field Values

UP

public static final int UP
See Also:
Constant Field Values

OVER

public static final int OVER
See Also:
Constant Field Values

DOWN

public static final int DOWN
See Also:
Constant Field Values

SELECTED

public static final int SELECTED
See Also:
Constant Field Values

_state

protected int _state

_actions

protected java.util.Vector _actions

_inputHandler

protected InputHandler _inputHandler

_hitArea

protected UIActiveArea _hitArea
Constructor Detail

UIActiveObject

public UIActiveObject(java.lang.String name,
                      int x,
                      int y,
                      int width,
                      int height,
                      InputHandler inputHandler,
                      UIColorScheme scheme,
                      int flags)
Method Detail

addAction

public void addAction(UIInputAction action)
Add an inputaction that will be fired when the control changes state

Parameters:
action -

removeAction

public void removeAction(UIInputAction action)
removes a given input action

Parameters:
action -

fireActions

protected void fireActions()
When called, all registered actions will be fired using 'this' object as the reference from where the fire was called.


hitTest

protected boolean hitTest()
Checks the hitarea for the mouse location

Returns:

getState

public int getState()
returns the current state of the control

Returns:

centerAt

public void centerAt(int x,
                     int y)
Places the center of the control at the given screen location

Overrides:
centerAt in class UIObject
Returns:

setLocation

public void setLocation(int x,
                        int y)
Moves the quad around the screen, properly setting local params at the same time.

Overrides:
setLocation in class UIObject

setAltBorderColors

public void setAltBorderColors()

setBaseBorderColors

public void setBaseBorderColors()

setHighlightColors

public void setHighlightColors()

setBaseColors

public void setBaseColors()

update

public abstract boolean update(float time)
Abstract, must be implemented in the extentions

Returns: