Xj3D 2.0 VRML/X3D Code API

org.web3d.vrml.nodes
Interface VRMLLayerNodeType

All Superinterfaces:
FrameStateListener, VRMLNode, VRMLNodeType

public interface VRMLLayerNodeType
extends VRMLNodeType

An abstract representation of a rendering layer concept.

Version:
$Revision: 1.6 $
Author:
Justin Couch

Method Summary
 void addLayerListener(LayerListener listener)
          Add a listener for layer state changes.
 int getLayerId()
          Get the ID of this layer.
 VRMLNodeType getViewport()
          Fetch the viewport node instance that this layer currently has.
 int getViewportType()
          Get the type of viewport layout policy that the contained viewport node represents.
 boolean isPickable()
          See if this layer is currently pickable.
 void removeLayerListener(LayerListener listener)
          Removed a listener for layer state changes.
 void setLayerId(int id)
          Set the ID of this layer.
 void setPickable(boolean enable)
          Set the value of the isPickable field.
 void setViewport(VRMLNodeType node)
          Set the viewport node instance used to control the size of screen real estate to use for this layer.
 
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

addLayerListener

void addLayerListener(LayerListener listener)
Add a listener for layer state changes. Duplicates will be ignored.

Parameters:
listener - The listener

removeLayerListener

void removeLayerListener(LayerListener listener)
Removed a listener for layer state changes.

Parameters:
listener - The listener

isPickable

boolean isPickable()
See if this layer is currently pickable.

Returns:
true if the contents of this layer can be picked

setPickable

void setPickable(boolean enable)
Set the value of the isPickable field.

Parameters:
enable - true if the contents of this layer can be picked

setViewport

void setViewport(VRMLNodeType node)
                 throws InvalidFieldValueException,
                        InvalidFieldAccessException
Set the viewport node instance used to control the size of screen real estate to use for this layer. The node type passed in should be an instance of VRMLViewportNodeType or a proto wrapper thereof.

Parameters:
node - The node instance to use or null to clear
Throws:
InvalidFieldValueException - The node is not a viewport node type
InvalidFieldAccessException - Attempting to write to the field after the setup is complete

getViewport

VRMLNodeType getViewport()
Fetch the viewport node instance that this layer currently has. If no instance is used, returns null.

Returns:
The current node instance

getViewportType

int getViewportType()
Get the type of viewport layout policy that the contained viewport node represents. This is a shortcut to fetching the viewport instance directly, walking the proto heirarchy and so forth.

This determines how the viewport is managed by the system during window resizes etc. It is a fixed value that never changes for the node implementation.

If no viewport node is defined, return VIEWPORT_FULLWINDOW.

If no viewport is yet referenced courtesy of an externproto, this returns VIEWPORT_UNDEFINED until it is updated.

Returns:
One of the VIEWPORT_* constant values

setLayerId

void setLayerId(int id)
Set the ID of this layer. The layer should pass this down to all contained geometry through the updateRefCount() method. This method should only ever be called once, when just after construction.

Parameters:
id - The id of this layer

getLayerId

int getLayerId()
Get the ID of this layer. If none has been set, it should return a value of -1.

Returns:
The ID of this layer or -1 if not yet set

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium