public abstract class JMEItem extends com.jme3.scene.Node implements IItem, IInitable
com.jme3.scene.Spatial.CullHint
INestable.IChildrenChangedListener
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
KEY_JMEITEMDATA
The Constant KEY_JMEITEMDATA.
|
Constructor and Description |
---|
JMEItem(java.lang.String name,
java.util.UUID uuid)
Instantiates a new JME item.
|
Modifier and Type | Method and Description |
---|---|
void |
addItem(IItem item)
Adds the item.
|
void |
addItemListener(IItemListener itemListener)
Adds the item listener.
|
void |
behaviourAdded(IBehaviour behaviour)
Behaviour added.
|
void |
centerItem()
Center item.
|
com.jme3.math.Vector2f |
convertWorldVelocityToLocalVelocity(com.jme3.math.Vector2f loc)
Convert world velocity to local velocity.
|
void |
deRegisterChildrenChangedListener(INestable.IChildrenChangedListener listener)
De register children changed listener.
|
java.util.List<IBehaviour> |
getBehaviours()
Gets the behaviours.
|
<T extends IBehaviour> |
getBehaviours(java.lang.Class<T> clazz)
Gets the behaviours.
|
java.util.List<IItem> |
getChildItems()
Gets the child items.
|
int |
getChildrenCount()
Gets the children count.
|
java.util.List<IItem> |
getItemChildren()
Gets the item children.
|
java.util.List<IItemListener> |
getItemListeners()
Gets the item listeners.
|
java.lang.String |
getItemName()
Gets the item name.
|
MultiTouchEventDispatcher |
getMultiTouchDispatcher()
Gets the multi touch dispatcher.
|
java.lang.String |
getName()
Gets the name.
|
IItem |
getParentItem()
Gets the parent item.
|
com.jme3.math.Vector2f |
getRelativeLocation()
Gets the relative location.
|
com.jme3.math.Vector2f |
getRelativeLocationOfWorldLocation(com.jme3.math.Vector2f worldloc)
Converts an arbitrary location in world coordinates into local
coordinates relative to this item.
|
float |
getRelativeRotation()
Gets the relative rotation.
|
float |
getRelativeScale()
Gets the relative scale.
|
java.util.UUID |
getUUID()
Gets the uuid.
|
com.jme3.math.Vector2f |
getWorldLocation()
Gets the world location.
|
com.jme3.math.Vector2f |
getWorldLocation(com.jme3.math.Vector2f v)
Get the world location of an arbitrary point, where the arbitrary point
is given in relative coordinates to this item.
|
float |
getWorldRotationDegrees()
Gets the world rotation degrees.
|
int |
getZOrder()
Gets the z order.
|
IZOrderManager |
getZOrderManager()
Gets the z order manager.
|
boolean |
hasChildren()
Checks for children.
|
boolean |
isVisible()
Checks if is visible.
|
void |
registerChildrenChangedListener(INestable.IChildrenChangedListener listener)
Register children changed listener.
|
void |
removeAllItems(boolean recursive)
Removes the all items.
|
void |
removeItem(IItem item)
Removes the item.
|
void |
removeItemListener(IItemListener itemListener)
Removes the item listener.
|
void |
setInteractionEnabled(boolean b)
Sets the interaction enabled.
|
void |
setItemListeners(java.util.List<IItemListener> itemListeners)
Sets the item listeners.
|
void |
setItemName(java.lang.String itemName)
Sets the item name.
|
void |
setParentItem(IItem parent)
Sets the parent item.
|
void |
setRelativeLocation(com.jme3.math.Vector2f newLoc)
Sets the relative location.
|
void |
setRelativeRotation(float angle)
Sets the relative rotation.
|
void |
setRelativeScale(float scale)
Sets the relative scale.
|
void |
setVisible(boolean isVisible)
Sets the visible.
|
void |
setWorldLocation(com.jme3.math.Vector2f loc)
Puts the item to a location on screen, given by screen coordinates
|
void |
setZOrder(int zOrder)
Sets the z order.
|
java.lang.String |
toString() |
attachChild, attachChildAt, childChange, clone, collideWith, deepClone, depthFirstTraversal, descendantMatches, descendantMatches, descendantMatches, detachAllChildren, detachChild, detachChildAt, detachChildNamed, getChild, getChild, getChildIndex, getChildren, getQuantity, getTriangleCount, getVertexCount, hasChild, read, setLodLevel, setMaterial, setModelBound, swapChildren, updateGeometricState, updateLogicalState, updateModelBound, write
addControl, addLight, breadthFirstTraversal, center, checkCulling, clone, getControl, getControl, getCullHint, getLastFrustumIntersection, getLocalCullHint, getLocalLightList, getLocalQueueBucket, getLocalRotation, getLocalScale, getLocalShadowMode, getLocalToWorldMatrix, getLocalTransform, getLocalTranslation, 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, setCullHint, setLastFrustumIntersection, setLocalRotation, setLocalRotation, setLocalScale, setLocalScale, setLocalScale, setLocalTransform, setLocalTranslation, setLocalTranslation, setName, setQueueBucket, setShadowMode, setUserData, worldToLocal
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getManipulableSpatial
initializeGeometry
public static final java.lang.String KEY_JMEITEMDATA
public JMEItem(java.lang.String name, java.util.UUID uuid)
name
- the nameuuid
- the uuidpublic void addItemListener(IItemListener itemListener)
IItem
addItemListener
in interface IItem
itemListener
- the item listenerpublic void behaviourAdded(IBehaviour behaviour)
IItem
behaviourAdded
in interface IItem
behaviour
- the behaviourpublic void centerItem()
IItem
centerItem
in interface IItem
public com.jme3.math.Vector2f convertWorldVelocityToLocalVelocity(com.jme3.math.Vector2f loc)
IItem
convertWorldVelocityToLocalVelocity
in interface IItem
loc
- the locpublic void deRegisterChildrenChangedListener(INestable.IChildrenChangedListener listener)
INestable
deRegisterChildrenChangedListener
in interface INestable
listener
- the listenerpublic java.util.List<IBehaviour> getBehaviours()
IItem
getBehaviours
in interface IItem
public <T extends IBehaviour> java.util.List<T> getBehaviours(java.lang.Class<T> clazz)
IItem
getBehaviours
in interface IItem
T
- the generic typeclazz
- the clazzpublic java.util.List<IItem> getChildItems()
INestable
getChildItems
in interface INestable
public int getChildrenCount()
INestable
getChildrenCount
in interface INestable
public java.util.List<IItem> getItemChildren()
public java.util.List<IItemListener> getItemListeners()
IItem
getItemListeners
in interface IItem
public java.lang.String getItemName()
public MultiTouchEventDispatcher getMultiTouchDispatcher()
IItem
getMultiTouchDispatcher
in interface IItem
public java.lang.String getName()
IItem
public IItem getParentItem()
IItem
getParentItem
in interface IItem
public com.jme3.math.Vector2f getRelativeLocation()
IItem
getRelativeLocation
in interface IItem
public com.jme3.math.Vector2f getRelativeLocationOfWorldLocation(com.jme3.math.Vector2f worldloc)
getRelativeLocationOfWorldLocation
in interface IItem
worldloc
- the worldlocpublic float getRelativeRotation()
IItem
getRelativeRotation
in interface IItem
public float getRelativeScale()
IItem
getRelativeScale
in interface IItem
public java.util.UUID getUUID()
IItem
public com.jme3.math.Vector2f getWorldLocation()
IItem
getWorldLocation
in interface IItem
public com.jme3.math.Vector2f getWorldLocation(com.jme3.math.Vector2f v)
IItem
getWorldLocation
in interface IItem
public float getWorldRotationDegrees()
IItem
getWorldRotationDegrees
in interface IItem
public int getZOrder()
IItem
public IZOrderManager getZOrderManager()
INestable
getZOrderManager
in interface INestable
getZOrderManager
in interface IItem
public boolean hasChildren()
INestable
hasChildren
in interface INestable
public boolean isVisible()
IItem
public void registerChildrenChangedListener(INestable.IChildrenChangedListener listener)
INestable
registerChildrenChangedListener
in interface INestable
listener
- the listenerpublic void removeAllItems(boolean recursive)
INestable
removeAllItems
in interface INestable
recursive
- the recursivepublic void removeItem(IItem item)
INestable
removeItem
in interface INestable
item
- the itempublic void removeItemListener(IItemListener itemListener)
IItem
removeItemListener
in interface IItem
itemListener
- the item listenerpublic void setInteractionEnabled(boolean b)
IItem
setInteractionEnabled
in interface IItem
b
- the new interaction enabledpublic void setItemListeners(java.util.List<IItemListener> itemListeners)
IItem
setItemListeners
in interface IItem
itemListeners
- the new item listenerspublic void setItemName(java.lang.String itemName)
itemName
- the new item namepublic void setParentItem(IItem parent)
IItem
setParentItem
in interface IItem
parent
- the new parent itempublic void setRelativeLocation(com.jme3.math.Vector2f newLoc)
IItem
setRelativeLocation
in interface IItem
newLoc
- the new relative locationpublic void setRelativeRotation(float angle)
IItem
setRelativeRotation
in interface IItem
angle
- the new relative rotationpublic void setRelativeScale(float scale)
IItem
setRelativeScale
in interface IItem
scale
- the new relative scalepublic void setVisible(boolean isVisible)
IItem
setVisible
in interface IItem
isVisible
- the new visiblepublic void setWorldLocation(com.jme3.math.Vector2f loc)
IItem
setWorldLocation
in interface IItem
loc
- a position, in screen coordinatespublic void setZOrder(int zOrder)
IItem
public java.lang.String toString()
toString
in class com.jme3.scene.Spatial