Xj3D 2.0 VRML/X3D Code API

org.web3d.vrml.nodes
Interface VRMLSurfaceChildNodeType

All Superinterfaces:
FrameStateListener, VRMLNode, VRMLNodeType
All Known Subinterfaces:
VRMLSurfaceLayoutNodeType

public interface VRMLSurfaceChildNodeType
extends VRMLNodeType

A legal child for an OverlayNodeType parent.

An overlay child node describes one item of an overlay. This item may be 2D or 3D and can be organised with a position on the surface using a series of relationships nodes that control how this node works with the rest of the renderable surface.

Each overlay child node has a visibility state that controls whether it is rendered or not. When a child is not visible, it does not take part in any layout organisation. If the child is a layout node, then the visibility state controls all its children. If the layout is made not-visible then none of its children are rendered.

Version:
$Revision: 1.5 $
Author:
Justin Couch

Method Summary
 float[] getBboxSize()
          Get the value of the 2D bounding box size of this overlay.
 boolean getParentVisible()
          Request the node's current parent visibility state.
 java.awt.Rectangle getRealBounds()
          Get the current value of the 2D bounding box of this overlay.
 boolean isVisible()
          Get the current visibility state of this node.
 void setLayoutListener(VRMLSurfaceLayoutListener l)
          Set the layout listener for this node.
 void setLocation(int x, int y)
          Tell this overlay that it's position in window coordinates has been changed to this new value.
 void setParentVisible(boolean state)
          Notification from the parent node about this node's visiblity state.
 void setVisible(boolean state)
          Set the visibility state of the surface.
 
Methods inherited from interface org.web3d.vrml.nodes.VRMLNodeType
addNodeListener, clearRemovedLayerIds, getFieldValue, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, hasFieldChanged, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, sendRoute, setDEF, setFrameStateManager, setMetadataObject, setupFinished, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCount
 
Methods inherited from interface org.web3d.vrml.lang.VRMLNode
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, getPrimaryType, getSecondaryType, getUserData, getVRMLNodeName, isDEF, setErrorReporter, setUserData, setVersion
 
Methods inherited from interface org.web3d.vrml.nodes.FrameStateListener
allEventsComplete
 

Method Detail

isVisible

boolean isVisible()
Get the current visibility state of this node.

Returns:
true if the node is current visible, false otherwise

setVisible

void setVisible(boolean state)
Set the visibility state of the surface. A non-visible surface will still take events and update, just not be rendered.

Parameters:
state - true to make this node visible, false to hide

setParentVisible

void setParentVisible(boolean state)
Notification from the parent node about this node's visiblity state. Used to control the rendering so that if a parent is not visible it can inform this node that it is also not visible without needing to stuff with the local visibility state.

Parameters:
state - true to make this node visible, false to hide

getParentVisible

boolean getParentVisible()
Request the node's current parent visibility state. Mainly used for proto copying.

Returns:
state true to make this node visible, false to hide

getBboxSize

float[] getBboxSize()
Get the value of the 2D bounding box size of this overlay. The bounds are given in pixel coordinates relative to the center of this overlay. Although the return values are always floats, the values will alway be integer based and will not contain fractional values.

Returns:
The current bounds

getRealBounds

java.awt.Rectangle getRealBounds()
Get the current value of the 2D bounding box of this overlay. The bounds are given in pixel coordinates relative to the top left corner.

Returns:
The current bounds [x, y, width, height]

setLocation

void setLocation(int x,
                 int y)
Tell this overlay that it's position in window coordinates has been changed to this new value. The position is always that of the top-left corner of the bounding box in screen coordinate space. Values are in pixels.

Parameters:
x - The x location of the window in pixels
y - The y location of the window in pixels

setLayoutListener

void setLayoutListener(VRMLSurfaceLayoutListener l)
Set the layout listener for this node. Setting a value of null clears the current listener instance.

Parameters:
l - The new listener to use or null

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium