com.jmex.bui
Class BRootNode

java.lang.Object
  extended by com.jme.scene.SceneElement
      extended by com.jme.scene.Spatial
          extended by com.jme.scene.Geometry
              extended by com.jmex.bui.BRootNode
All Implemented Interfaces:
Savable, Serializable
Direct Known Subclasses:
CanvasRootNode, PolledRootNode

public abstract class BRootNode
extends Geometry

Connects the BUI system into the JME scene graph.

See Also:
Serialized Form

Field Summary
protected  BComponent _ccomponent
           
protected  ArrayList<BComponent> _defaults
           
protected  BComponent _focus
           
protected  ArrayList<BGeomView> _geomviews
           
protected  ArrayList<EventListener> _globals
           
protected  BComponent _hcomponent
           
protected  float _lastMoveTime
           
protected  float _lastTipTime
           
protected  ColorRGBA _modalShade
           
protected  int _modifiers
           
protected  int _mouseX
           
protected  int _mouseY
           
protected  float _tipTime
           
protected  int _tipWidth
           
protected  BWindow _tipwin
           
protected  ArrayList<BWindow> _windows
           
protected static float TIP_MODE_RESET
           
 
Fields inherited from class com.jme.scene.Geometry
batchList
 
Fields inherited from class com.jme.scene.Spatial
geometricalControllers, localRotation, localScale, localTranslation, parent, worldRotation, worldScale, worldTranslation
 
Fields inherited from class com.jme.scene.SceneElement
COMPOSITE_MESH, CULL_ALWAYS, CULL_DYNAMIC, CULL_INHERIT, CULL_NEVER, cullMode, frustrumIntersects, GEOMBATCH, GEOMETRY, isCollidable, lightCombineMode, LOCKED_BOUNDS, LOCKED_BRANCH, LOCKED_MESH_DATA, LOCKED_NONE, LOCKED_SHADOWS, LOCKED_TRANSFORMS, lockedMode, name, NM_GL_NORMALIZE_IF_SCALED, NM_GL_NORMALIZE_PROVIDED, NM_INHERIT, NM_OFF, NM_USE_PROVIDED, NODE, normalsMode, QUADBATCH, queueDistance, renderQueueMode, renderStateList, SHARED_MESH, SHAREDBATCH, SKY_BOX, TERRAIN_BLOCK, TERRAIN_PAGE, textureCombineMode, TRIANGLEBATCH, TRIMESH, worldBound, zOrder
 
Constructor Summary
BRootNode()
           
 
Method Summary
 void addGlobalEventListener(EventListener listener)
          Registers a listener that will be notified of all events prior to their being dispatched normally.
 void addWindow(BWindow window)
          Registers a top-level window with the input system.
 void addWindow(BWindow window, boolean topLayer)
          Registers a top-level window with the input system.
protected  void clearTipWindow()
           
protected  boolean dispatchEvent(BComponent target, BEvent event)
          Dispatches an event to the specified target (which may be null).
 void draw(Renderer renderer)
           
 void findCollisions(Spatial scene, CollisionResults results)
           
 BComponent getFocus()
          Returns the component that currently has the focus, or null.
abstract  long getTickStamp()
          Returns the current timestamp used to stamp event times.
 float getTooltipTimeout()
          Returns the tool tip timeout.
 BWindow getWindow(int index)
          Returns the window at the specified index.
 int getWindowCount()
          Returns the total number of windows added to this node.
 boolean hasCollision(Spatial scene, boolean checkTriangles)
           
 boolean isOnTop(BWindow window)
          Returns true if the specified window is on top.
protected  void mouseDidMove(int mouseX, int mouseY)
           
 void onDraw(Renderer renderer)
           
 void popDefaultEventTarget(BComponent component)
          Pops the default event target off the stack.
 void pushDefaultEventTarget(BComponent component)
          Configures a component to receive all events that are not sent to some other component.
protected  void registerGeomView(BGeomView nview)
          Registers a BGeomView with the root node.
 void removeAllWindows()
          Removes all windows from the root node.
 void removeGlobalEventListener(EventListener listener)
          Removes a global event listener registration.
 void removeWindow(BWindow window)
          Removes a window from participation in the input system.
protected  void renderModalShade()
           
 void requestFocus(BComponent component)
          Requests that the specified component be given the input focus.
 void resortWindows()
          Called when an added window's layer is changed.
abstract  void rootInvalidated(BComponent root)
          This is called by a window or a scroll pane when it has become invalid.
protected  void setFocus(BComponent focus)
          Configures the component that has keyboard focus.
 void setModalShade(ColorRGBA color)
          Sets the color of the shade behind the first active modal window.
 void setTooltipPreferredWidth(int width)
          Sets the preferred width of tooltip windows.
 void setTooltipTimeout(float seconds)
          Configures the number of seconds that the mouse must rest over a component to trigger a tooltip.
 void tipTextChanged(BComponent component)
          A large component that changes its tooltip while it is the hover component in the normal course of events can call this method to force an update to the tooltip window.
 String toString()
          Generates a string representation of this instance.
protected  void unregisterGeomView(BGeomView nview)
          Clears out a node view registration.
 void updateGeometricState(float time, boolean initiator)
           
protected  void updateHoverComponent(int mx, int my)
          Recomputes the component over which the mouse is hovering, generating mouse exit and entry events as necessary.
protected  void windowDidMove(BWindow window)
          Called by a window when its position changes.
 
Methods inherited from class com.jme.scene.Geometry
addBatch, applyRenderState, clearBatches, clearBuffers, copyTextureCoords, copyTextureCoords, findPick, getBatch, getBatchCount, getBatchIndex, getColorBuffer, getNormalBuffer, getNumberOfUnits, getTextureBuffer, getTextureBuffers, getTotalVertices, getType, getVBOInfo, getVertexBuffer, getWorldCoords, getWorldCoords, getWorldNormals, getWorldNormals, lockBounds, lockMeshes, lockShadows, lockTransforms, randomVertex, read, reconstruct, reconstruct, removeBatch, removeBatch, setColorBuffer, setDefaultColor, setModelBound, setNormalBuffer, setRandomColors, setSolidColor, setTextureBuffer, setTextureBuffer, setupBatchList, setVBOInfo, setVBOInfo, setVertexBuffer, swapBatches, unlockBounds, unlockMeshes, unlockShadows, unlockTransforms, updateModelBound, updateWorldBound, updateWorldData, write
 
Methods inherited from class com.jme.scene.Spatial
addController, calculateCollisions, calculatePick, getController, getControllers, getCullMode, getLightCombineMode, getLocalRotation, getLocalScale, getLocalTranslation, getNormalsMode, getParent, getRenderQueueMode, getTextureCombineMode, getWorldRotation, getWorldScale, getWorldTranslation, localToWorld, lookAt, propagateBoundToRoot, propagateStatesFromRoot, removeController, removeFromParent, rotateUpTo, setLocalRotation, setLocalRotation, setLocalScale, setLocalScale, setLocalTranslation, setParent, updateCollisionTree, updateWorldRotation, updateWorldScale, updateWorldTranslation, updateWorldVectors, worldToLocal
 
Methods inherited from class com.jme.scene.SceneElement
clearRenderState, getClassTag, getLastFrustumIntersection, getLocalCullMode, getLocalLightCombineMode, getLocalNormalsMode, getLocalRenderQueueMode, getLocalTextureCombineMode, getLocks, getName, getRenderState, getWorldBound, getZOrder, isCollidable, lock, lock, lockBranch, lockMeshes, setCullMode, setIsCollidable, setLastFrustumIntersection, setLightCombineMode, setLocks, setLocks, setName, setNormalsMode, setRenderQueueMode, setRenderState, setTextureCombineMode, setZOrder, unlock, unlock, unlockBranch, unlockMeshes, updateRenderState, updateRenderState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.jme.util.export.Savable
getClassTag
 

Field Detail

_modifiers

protected int _modifiers

_mouseX

protected int _mouseX

_mouseY

protected int _mouseY

_tipwin

protected BWindow _tipwin

_lastMoveTime

protected float _lastMoveTime

_tipTime

protected float _tipTime

_lastTipTime

protected float _lastTipTime

_tipWidth

protected int _tipWidth

_modalShade

protected ColorRGBA _modalShade

_windows

protected ArrayList<BWindow> _windows

_hcomponent

protected BComponent _hcomponent

_ccomponent

protected BComponent _ccomponent

_focus

protected BComponent _focus

_defaults

protected ArrayList<BComponent> _defaults

_geomviews

protected ArrayList<BGeomView> _geomviews

_globals

protected ArrayList<EventListener> _globals

TIP_MODE_RESET

protected static final float TIP_MODE_RESET
See Also:
Constant Field Values
Constructor Detail

BRootNode

public BRootNode()
Method Detail

getTickStamp

public abstract long getTickStamp()
Returns the current timestamp used to stamp event times.


addWindow

public void addWindow(BWindow window)
Registers a top-level window with the input system.


addWindow

public void addWindow(BWindow window,
                      boolean topLayer)
Registers a top-level window with the input system.

Parameters:
topLayer - if true, will set the window layer to the top most layer if it's current layer is less than that.

isOnTop

public boolean isOnTop(BWindow window)
Returns true if the specified window is on top.


resortWindows

public void resortWindows()
Called when an added window's layer is changed. Adjusts the ordering of the windows in the stack.


removeAllWindows

public void removeAllWindows()
Removes all windows from the root node.


removeWindow

public void removeWindow(BWindow window)
Removes a window from participation in the input system.


setTooltipTimeout

public void setTooltipTimeout(float seconds)
Configures the number of seconds that the mouse must rest over a component to trigger a tooltip. If the value is set to zero, tips will appear immediately.


getTooltipTimeout

public float getTooltipTimeout()
Returns the tool tip timeout. See setTooltipTimeout(float) for details.


setTooltipPreferredWidth

public void setTooltipPreferredWidth(int width)
Sets the preferred width of tooltip windows. The default is to prefer a width slightly less wide that the entire window.


addGlobalEventListener

public void addGlobalEventListener(EventListener listener)
Registers a listener that will be notified of all events prior to their being dispatched normally.


removeGlobalEventListener

public void removeGlobalEventListener(EventListener listener)
Removes a global event listener registration.


rootInvalidated

public abstract void rootInvalidated(BComponent root)
This is called by a window or a scroll pane when it has become invalid. The root node should schedule a revalidation of this component on the next tick or the next time an event is processed.


pushDefaultEventTarget

public void pushDefaultEventTarget(BComponent component)
Configures a component to receive all events that are not sent to some other component. When an event is not consumed during normal processing, it is sent to the default event targets, most recently registered to least recently registered.


popDefaultEventTarget

public void popDefaultEventTarget(BComponent component)
Pops the default event target off the stack.


requestFocus

public void requestFocus(BComponent component)
Requests that the specified component be given the input focus. Pass null to clear the focus.


getFocus

public BComponent getFocus()
Returns the component that currently has the focus, or null.


getWindowCount

public int getWindowCount()
Returns the total number of windows added to this node.


getWindow

public BWindow getWindow(int index)
Returns the window at the specified index.


toString

public String toString()
Generates a string representation of this instance.

Overrides:
toString in class SceneElement

tipTextChanged

public void tipTextChanged(BComponent component)
A large component that changes its tooltip while it is the hover component in the normal course of events can call this method to force an update to the tooltip window.


updateGeometricState

public void updateGeometricState(float time,
                                 boolean initiator)
Overrides:
updateGeometricState in class Spatial

onDraw

public void onDraw(Renderer renderer)
Overrides:
onDraw in class Spatial

draw

public void draw(Renderer renderer)
Overrides:
draw in class Geometry

findCollisions

public void findCollisions(Spatial scene,
                           CollisionResults results)
Specified by:
findCollisions in class Spatial

hasCollision

public boolean hasCollision(Spatial scene,
                            boolean checkTriangles)
Specified by:
hasCollision in class Spatial

setModalShade

public void setModalShade(ColorRGBA color)
Sets the color of the shade behind the first active modal window.


dispatchEvent

protected boolean dispatchEvent(BComponent target,
                                BEvent event)
Dispatches an event to the specified target (which may be null). If the target is null, or did not consume the event, it will be passed on to the most recently opened modal window if one exists (and the supplied target component was not a child of that window) and then to the default event targets if the event is still unconsumed.

Returns:
true if the event was dispatched, false if not.

setFocus

protected void setFocus(BComponent focus)
Configures the component that has keyboard focus.


registerGeomView

protected void registerGeomView(BGeomView nview)
Registers a BGeomView with the root node. This is called automatically from BGeomView.wasAdded().


unregisterGeomView

protected void unregisterGeomView(BGeomView nview)
Clears out a node view registration. This is called automatically from BGeomView.wasRemoved().


windowDidMove

protected void windowDidMove(BWindow window)
Called by a window when its position changes. This triggers a recomputation of the hover component as the window may have moved out from under or under the mouse.


mouseDidMove

protected void mouseDidMove(int mouseX,
                            int mouseY)

updateHoverComponent

protected void updateHoverComponent(int mx,
                                    int my)
Recomputes the component over which the mouse is hovering, generating mouse exit and entry events as necessary.


clearTipWindow

protected void clearTipWindow()

renderModalShade

protected void renderModalShade()


Copyright © 2008 Michael Bayne. All Rights Reserved.