com.jme3.scene
Class AssetLinkNode

java.lang.Object
  extended by com.jme3.scene.Spatial
      extended by com.jme3.scene.Node
          extended by com.jme3.scene.AssetLinkNode
All Implemented Interfaces:
CloneableSmartAsset, Collidable, Savable, java.lang.Cloneable

public class AssetLinkNode
extends Node

The AssetLinkNode does not store its children when exported to file. Instead, you can add a list of AssetKeys that will be loaded and attached when the AssetLinkNode is restored.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.jme3.scene.Spatial
Spatial.BatchHint, Spatial.CullHint
 
Field Summary
protected  java.util.Map<ModelKey,Spatial> assetChildren
           
protected  java.util.ArrayList<ModelKey> assetLoaderKeys
           
 
Fields inherited from class com.jme3.scene.Node
children
 
Fields inherited from class com.jme3.scene.Spatial
batchHint, controls, cullHint, frustrumIntersects, key, localLights, localTransform, name, parent, queueBucket, queueDistance, refreshFlags, RF_BOUND, RF_LIGHTLIST, RF_TRANSFORM, shadowMode, userData, worldBound, worldLights, worldTransform
 
Constructor Summary
AssetLinkNode()
           
AssetLinkNode(ModelKey key)
           
AssetLinkNode(java.lang.String name, ModelKey key)
           
 
Method Summary
 void addLinkedChild(ModelKey key)
          Add a "linked" child.
 void attachLinkedChild(AssetManager manager, ModelKey key)
           
 void attachLinkedChild(Spatial spat, ModelKey key)
           
 void attachLinkedChildren(AssetManager manager)
          Loads the linked children AssetKeys from the AssetManager and attaches them to the Node
If they are already attached, they will be reloaded.
 void detachLinkedChild(ModelKey key)
           
 void detachLinkedChild(Spatial child, ModelKey key)
           
 void detachLinkedChildren()
           
 java.util.ArrayList<ModelKey> getAssetLoaderKeys()
           
 void read(JmeImporter e)
           
 void removeLinkedChild(ModelKey key)
           
 void write(JmeExporter e)
           
 
Methods inherited from class com.jme3.scene.Node
attachChild, attachChildAt, breadthFirstTraversal, clone, collideWith, deepClone, depthFirstTraversal, descendantMatches, descendantMatches, descendantMatches, detachAllChildren, detachChild, detachChildAt, detachChildNamed, getChild, getChild, getChildIndex, getChildren, getQuantity, getTriangleCount, getVertexCount, hasChild, setLightListRefresh, setLodLevel, setMaterial, setModelBound, setTransformRefresh, swapChildren, updateGeometricState, updateLogicalState, updateModelBound, updateWorldBound
 
Methods inherited from class com.jme3.scene.Spatial
addControl, addLight, breadthFirstTraversal, center, checkCulling, clone, getBatchHint, getControl, getControl, getCullHint, getKey, getLastFrustumIntersection, getLocalBatchHint, getLocalCullHint, getLocalLightList, getLocalQueueBucket, getLocalRotation, getLocalScale, getLocalShadowMode, getLocalToWorldMatrix, getLocalTransform, getLocalTranslation, getName, getNumControls, getParent, getQueueBucket, getShadowMode, getUserData, getUserDataKeys, getWorldBound, getWorldLightList, getWorldRotation, getWorldScale, getWorldTransform, getWorldTranslation, hasAncestor, localToWorld, lookAt, matches, move, move, removeControl, removeControl, removeFromParent, removeLight, rotate, rotate, rotateUpTo, runControlRender, scale, scale, setBatchHint, setBoundRefresh, setCullHint, setKey, setLastFrustumIntersection, setLocalRotation, setLocalRotation, setLocalScale, setLocalScale, setLocalScale, setLocalTransform, setLocalTranslation, setLocalTranslation, setName, setParent, setQueueBucket, setShadowMode, setUserData, toString, updateWorldLightList, updateWorldTransforms, worldToLocal
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

assetLoaderKeys

protected java.util.ArrayList<ModelKey> assetLoaderKeys

assetChildren

protected java.util.Map<ModelKey,Spatial> assetChildren
Constructor Detail

AssetLinkNode

public AssetLinkNode()

AssetLinkNode

public AssetLinkNode(ModelKey key)

AssetLinkNode

public AssetLinkNode(java.lang.String name,
                     ModelKey key)
Method Detail

addLinkedChild

public void addLinkedChild(ModelKey key)
Add a "linked" child. These are loaded from the assetManager when the AssetLinkNode is loaded from a binary file.

Parameters:
key -

removeLinkedChild

public void removeLinkedChild(ModelKey key)

getAssetLoaderKeys

public java.util.ArrayList<ModelKey> getAssetLoaderKeys()

attachLinkedChild

public void attachLinkedChild(AssetManager manager,
                              ModelKey key)

attachLinkedChild

public void attachLinkedChild(Spatial spat,
                              ModelKey key)

detachLinkedChild

public void detachLinkedChild(ModelKey key)

detachLinkedChild

public void detachLinkedChild(Spatial child,
                              ModelKey key)

attachLinkedChildren

public void attachLinkedChildren(AssetManager manager)
Loads the linked children AssetKeys from the AssetManager and attaches them to the Node
If they are already attached, they will be reloaded.

Parameters:
manager -

detachLinkedChildren

public void detachLinkedChildren()

read

public void read(JmeImporter e)
          throws java.io.IOException
Specified by:
read in interface Savable
Overrides:
read in class Node
Throws:
java.io.IOException

write

public void write(JmeExporter e)
           throws java.io.IOException
Specified by:
write in interface Savable
Overrides:
write in class Node
Throws:
java.io.IOException