com.jmex.bui
Class BRootNode

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

public abstract class BRootNode
extends com.jme.scene.Geometry

Connects the BUI system into the JME scene graph.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.jme.scene.Spatial
com.jme.scene.Spatial.CullHint, com.jme.scene.Spatial.LightCombineMode, com.jme.scene.Spatial.NormalsMode, com.jme.scene.Spatial.TextureCombineMode
 
Field Summary
protected  BComponent _ccomponent
           
protected  java.util.ArrayList<BComponent> _defaults
           
protected  BComponent _focus
           
protected  java.util.ArrayList<BGeomView> _geomviews
           
protected  java.util.ArrayList<EventListener> _globals
           
protected  BComponent _hcomponent
           
protected  float _lastMoveTime
           
protected  float _lastTipTime
           
protected  com.jme.renderer.ColorRGBA _modalShade
           
protected  int _modifiers
           
protected  int _mouseX
           
protected  int _mouseY
           
protected  float _tipTime
           
protected  int _tipWidth
           
protected  BWindow _tipwin
           
protected  java.util.ArrayList<BWindow> _windows
           
protected static float TIP_MODE_RESET
           
 
Fields inherited from class com.jme.scene.Geometry
binormalBuf, bound, castsShadows, colorBuf, compVect, defaultColor, displayListID, enabled, fogBuf, hasDirtyVertices, normBuf, states, tangentBuf, texBuf, vboInfo, vertBuf, vertQuantity
 
Fields inherited from class com.jme.scene.Spatial
cullHint, frustrumIntersects, geometricalControllers, isCollidable, lightCombineMode, localRotation, localScale, localTranslation, LOCKED_BOUNDS, LOCKED_BRANCH, LOCKED_MESH_DATA, LOCKED_NONE, LOCKED_SHADOWS, LOCKED_TRANSFORMS, lockedMode, name, normalsMode, parent, queueDistance, renderQueueMode, renderStateList, textureCombineMode, worldBound, worldRotation, worldScale, worldTranslation, 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(com.jme.renderer.Renderer renderer)
           
 void findCollisions(com.jme.scene.Spatial scene, com.jme.intersection.CollisionResults results)
           
 java.util.ArrayList<BWindow> getAllWindows()
           
 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(com.jme.scene.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(com.jme.renderer.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(com.jme.renderer.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.
 java.lang.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
addTextureCoordinates, addTextureCoordinates, applyRenderState, checkTextureCoordinates, clearBuffers, clearTextureBuffers, copyTextureCoordinates, findPick, getBinormalBuffer, getColorBuffer, getDefaultColor, getDisplayListID, getFogBuffer, getLightState, getModelBound, getNormalBuffer, getNumberOfUnits, getTangentBuffer, getTextureCoords, getTextureCoords, getTriangleCount, getVBOInfo, getVertexBuffer, getVertexCount, getWorldCoords, getWorldNormals, hasDirtyVertices, isCastsShadows, lockMeshes, postdraw, predraw, randomVertex, read, reconstruct, resizeTextureIds, rotateNormals, rotatePoints, scaleTextureCoordinates, scaleTextureCoordinates, setBinormalBuffer, setCastsShadows, setColorBuffer, setDefaultColor, setDisplayListID, setFogCoordBuffer, setHasDirtyVertices, setLightState, setModelBound, setNormalBuffer, setRandomColors, setSolidColor, setTangentBuffer, setTextureCoords, setTextureCoords, setTextureCoords, setVBOInfo, setVertexBuffer, setVertexCount, sortLights, translatePoints, translatePoints, unlockMeshes, updateModelBound, updateWorldBound, write
 
Methods inherited from class com.jme.scene.Spatial
addController, calculateCollisions, calculatePick, clearControllers, clearRenderState, clearRenderState, getClassTag, getController, getControllerCount, getControllers, getCullHint, getLastFrustumIntersection, getLightCombineMode, getLocalCullHint, getLocalLightCombineMode, getLocalNormalsMode, getLocalRenderQueueMode, getLocalRotation, getLocalScale, getLocalTextureCombineMode, getLocalToWorldMatrix, getLocalTranslation, getLocks, getName, getNormalsMode, getParent, getRenderQueueMode, getRenderState, getRenderState, getTextureCombineMode, getUserData, getWorldBound, getWorldRotation, getWorldScale, getWorldTranslation, getZOrder, hasAncestor, isCollidable, localToWorld, lock, lock, lockBounds, lockBranch, lockMeshes, lockShadows, lockTransforms, lookAt, propagateBoundToRoot, propagateStatesFromRoot, removeController, removeController, removeFromParent, removeUserData, rotateUpTo, setCullHint, setIsCollidable, setLastFrustumIntersection, setLightCombineMode, setLocalRotation, setLocalRotation, setLocalScale, setLocalScale, setLocalTranslation, setLocalTranslation, setLocks, setLocks, setName, setNormalsMode, setParent, setRenderQueueMode, setRenderState, setTextureCombineMode, setUserData, setZOrder, setZOrder, unlock, unlock, unlockBounds, unlockBranch, unlockMeshes, unlockShadows, unlockTransforms, updateRenderState, updateRenderState, updateWorldData, updateWorldRotation, updateWorldScale, updateWorldTranslation, updateWorldVectors, updateWorldVectors, worldToLocal
 
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 com.jme.renderer.ColorRGBA _modalShade

_windows

protected java.util.ArrayList<BWindow> _windows

_hcomponent

protected BComponent _hcomponent

_ccomponent

protected BComponent _ccomponent

_focus

protected BComponent _focus

_defaults

protected java.util.ArrayList<BComponent> _defaults

_geomviews

protected java.util.ArrayList<BGeomView> _geomviews

_globals

protected java.util.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.

Returns:
long tickstamp

addWindow

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

Parameters:
window - BWindow

addWindow

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

Parameters:
window - BWindow
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.


getAllWindows

public java.util.ArrayList<BWindow> getAllWindows()

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 java.lang.String toString()
Generates a string representation of this instance.

Overrides:
toString in class com.jme.scene.Spatial

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 com.jme.scene.Spatial

onDraw

public void onDraw(com.jme.renderer.Renderer renderer)
Overrides:
onDraw in class com.jme.scene.Spatial

draw

public void draw(com.jme.renderer.Renderer renderer)
Overrides:
draw in class com.jme.scene.Geometry

findCollisions

public void findCollisions(com.jme.scene.Spatial scene,
                           com.jme.intersection.CollisionResults results)
Specified by:
findCollisions in class com.jme.scene.Spatial

hasCollision

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

setModalShade

public void setModalShade(com.jme.renderer.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 © 2011 Michael Bayne. All Rights Reserved.