public abstract class

BaseMenuItemDecorator

extends Object
implements IMenuItem
java.lang.Object
   ↳ org.andengine.entity.scene.menu.item.decorator.BaseMenuItemDecorator
Known Direct Subclasses

Class Overview

I HATE THIS CLASS! (c) 2010 Nicolas Gramlich (c) 2011 Zynga Inc.

Summary

[Expand]
Inherited Constants
From interface org.andengine.entity.shape.IShape
Fields
protected final IMenuItem mMenuItem
Public Constructors
BaseMenuItemDecorator(IMenuItem pMenuItem)
Public Methods
boolean attachChild(IEntity pEntity, int pIndex)
void attachChild(IEntity pEntity)
void callOnChildren(IEntityParameterCallable pEntityParameterCallable, IEntityMatcher pEntityMatcher)
void callOnChildren(IEntityParameterCallable pEntityParameterCallable)
void clearEntityModifiers()
void clearUpdateHandlers()
boolean collidesWith(IShape pOtherShape)
boolean contains(float pX, float pY)
float[] convertLocalToSceneCoordinates(float[] pCoordinates, float[] pReuse)
float[] convertLocalToSceneCoordinates(float[] pCoordinates)
float[] convertLocalToSceneCoordinates(float pX, float pY)
float[] convertLocalToSceneCoordinates(float pX, float pY, float[] pReuse)
float[] convertSceneToLocalCoordinates(float pX, float pY)
float[] convertSceneToLocalCoordinates(float[] pCoordinates)
float[] convertSceneToLocalCoordinates(float pX, float pY, float[] pReuse)
float[] convertSceneToLocalCoordinates(float[] pCoordinates, float[] pReuse)
boolean detachChild(IEntity pEntity)
WARNING: This function should be called from within postRunnable(Runnable) which is registered to a Scene or the Engine itself, because otherwise it may throw an IndexOutOfBoundsException in the Update-Thread or the GL-Thread!
IEntity detachChild(IEntityMatcher pEntityMatcher)
WARNING: This function should be called from within postRunnable(Runnable) which is registered to a Scene or the Engine itself, because otherwise it may throw an IndexOutOfBoundsException in the Update-Thread or the GL-Thread!
boolean detachChildren(IEntityMatcher pEntityMatcher)
WARNING: This function should be called from within postRunnable(Runnable) which is registered to a Scene or the Engine itself, because otherwise it may throw an IndexOutOfBoundsException in the Update-Thread or the GL-Thread!
void detachChildren()
boolean detachSelf()
void dispose()
float getAlpha()
float getBaseHeight()
float getBaseWidth()
float getBlue()
IEntity getChild(int pIndex)
IEntity getChild(IEntityMatcher pEntityMatcher)
int getChildCount()
int getChildIndex(IEntity pEntity)
Color getColor()
int getDestinationBlendFunction()
IEntity getFirstChild()
float getGreen()
float getHeight()
float getHeightScaled()
int getID()
float getInitialX()
float getInitialY()
IEntity getLastChild()
Transformation getLocalToParentTransformation()
Transformation getLocalToSceneTransformation()
IEntity getParent()
Transformation getParentToLocalTransformation()
float getRed()
float getRotation()
float getRotationCenterX()
float getRotationCenterY()
float getScaleCenterX()
float getScaleCenterY()
float getScaleX()
float getScaleY()
float[] getSceneCenterCoordinates()
Transformation getSceneToLocalTransformation()
ShaderProgram getShaderProgram()
float getSkewCenterX()
float getSkewCenterY()
float getSkewX()
float getSkewY()
int getSourceBlendFunction()
Object getUserData()
IVertexBufferObject getVertexBufferObject()
VertexBufferObjectManager getVertexBufferObjectManager()
float getWidth()
float getWidthScaled()
float getX()
float getY()
int getZIndex()
boolean hasParent()
boolean isBlendingEnabled()
boolean isChildrenIgnoreUpdate()
boolean isChildrenVisible()
boolean isCulled(Camera pCamera)
Will only be performed if isCullingEnabled() is true.
boolean isCullingEnabled()
boolean isDisposed()
boolean isIgnoreUpdate()
boolean isRotated()
boolean isRotatedOrScaledOrSkewed()
boolean isScaled()
boolean isSkewed()
boolean isVisible()
boolean onAreaTouched(TouchEvent pSceneTouchEvent, float pTouchAreaLocalX, float pTouchAreaLocalY)
This method only fires if this Scene.ITouchArea is registered to the Scene via registerTouchArea(ITouchArea).
void onAttached()
void onDetached()
void onDraw(GLState pGLState, Camera pCamera)
final void onSelected()
final void onUnselected()
void onUpdate(float pSecondsElapsed)
<L extends List<IEntity>> L query(IEntityMatcher pEntityMatcher, L pResult)
ArrayList<IEntity> query(IEntityMatcher pEntityMatcher)
<L extends List<S extends T>, S> L queryForSubclass(IEntityMatcher pEntityMatcher, L pResult)
<S extends IEntity> ArrayList<S> queryForSubclass(IEntityMatcher pEntityMatcher)
void registerEntityModifier(IEntityModifier pEntityModifier)
void registerUpdateHandler(IUpdateHandler pUpdateHandler)
void reset()
void setAlpha(float pAlpha)
void setBlendFunction(int pSourceBlendFunction, int pDestinationBlendFunction)
void setBlendingEnabled(boolean pBlendingEnabled)
boolean setChildIndex(IEntity pEntity, int pIndex)
void setChildrenIgnoreUpdate(boolean pChildrenIgnoreUpdate)
void setChildrenVisible(boolean pChildrenVisible)
void setColor(float pRed, float pGreen, float pBlue)
void setColor(Color pColor)
void setColor(float pRed, float pGreen, float pBlue, float pAlpha)
void setCullingEnabled(boolean pCullingEnabled)
void setHeight(float pHeight)
void setIgnoreUpdate(boolean pIgnoreUpdate)
void setInitialPosition()
void setParent(IEntity pEntity)
void setPosition(IEntity pOtherEntity)
void setPosition(float pX, float pY)
void setRotation(float pRotation)
void setRotationCenter(float pRotationCenterX, float pRotationCenterY)
void setRotationCenterX(float pRotationCenterX)
void setRotationCenterY(float pRotationCenterY)
void setScale(float pScale)
void setScale(float pScaleX, float pScaleY)
void setScaleCenter(float pScaleCenterX, float pScaleCenterY)
void setScaleCenterX(float pScaleCenterX)
void setScaleCenterY(float pScaleCenterY)
void setScaleX(float pScaleX)
void setScaleY(float pScaleY)
void setShaderProgram(ShaderProgram pShaderProgram)
void setSize(float pWidth, float pHeight)
void setSkew(float pSkew)
void setSkew(float pSkewX, float pSkewY)
void setSkewCenter(float pSkewCenterX, float pSkewCenterY)
void setSkewCenterX(float pSkewCenterX)
void setSkewCenterY(float pSkewCenterY)
void setSkewX(float pSkewX)
void setSkewY(float pSkewY)
void setUserData(Object pUserData)
void setVisible(boolean pVisible)
void setWidth(float pWidth)
void setZIndex(int pZIndex)
void sortChildren()
Immediately sorts the IEntitys based on their ZIndex.
void sortChildren(Comparator<IEntity> pEntityComparator)
Sorts the IEntitys based on the Comparator supplied.
void sortChildren(boolean pImmediate)
Sorts the IEntitys based on their ZIndex.
boolean swapChildren(int pIndexA, int pIndexB)
boolean swapChildren(IEntity pEntityA, IEntity pEntityB)
void toString(StringBuilder pStringBuilder)
boolean unregisterEntityModifier(IEntityModifier pEntityModifier)
boolean unregisterEntityModifiers(IEntityModifier.IEntityModifierMatcher pEntityModifierMatcher)
boolean unregisterUpdateHandler(IUpdateHandler pUpdateHandler)
boolean unregisterUpdateHandlers(IUpdateHandler.IUpdateHandlerMatcher pUpdateHandlerMatcher)
Protected Methods
abstract void onMenuItemReset(IMenuItem pMenuItem)
abstract void onMenuItemSelected(IMenuItem pMenuItem)
abstract void onMenuItemUnselected(IMenuItem pMenuItem)
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.andengine.engine.handler.IDrawHandler
From interface org.andengine.engine.handler.IUpdateHandler
From interface org.andengine.entity.IEntity
From interface org.andengine.entity.scene.Scene.ITouchArea
From interface org.andengine.entity.scene.menu.item.IMenuItem
From interface org.andengine.entity.shape.IAreaShape
From interface org.andengine.entity.shape.IShape
From interface org.andengine.util.IDisposable

Fields

protected final IMenuItem mMenuItem

Public Constructors

public BaseMenuItemDecorator (IMenuItem pMenuItem)

Public Methods

public boolean attachChild (IEntity pEntity, int pIndex)

public void attachChild (IEntity pEntity)

public void callOnChildren (IEntityParameterCallable pEntityParameterCallable, IEntityMatcher pEntityMatcher)

public void callOnChildren (IEntityParameterCallable pEntityParameterCallable)

public void clearEntityModifiers ()

public void clearUpdateHandlers ()

public boolean collidesWith (IShape pOtherShape)

public boolean contains (float pX, float pY)

public float[] convertLocalToSceneCoordinates (float[] pCoordinates, float[] pReuse)

public float[] convertLocalToSceneCoordinates (float[] pCoordinates)

public float[] convertLocalToSceneCoordinates (float pX, float pY)

public float[] convertLocalToSceneCoordinates (float pX, float pY, float[] pReuse)

public float[] convertSceneToLocalCoordinates (float pX, float pY)

public float[] convertSceneToLocalCoordinates (float[] pCoordinates)

public float[] convertSceneToLocalCoordinates (float pX, float pY, float[] pReuse)

public float[] convertSceneToLocalCoordinates (float[] pCoordinates, float[] pReuse)

public boolean detachChild (IEntity pEntity)

WARNING: This function should be called from within postRunnable(Runnable) which is registered to a Scene or the Engine itself, because otherwise it may throw an IndexOutOfBoundsException in the Update-Thread or the GL-Thread!

public IEntity detachChild (IEntityMatcher pEntityMatcher)

WARNING: This function should be called from within postRunnable(Runnable) which is registered to a Scene or the Engine itself, because otherwise it may throw an IndexOutOfBoundsException in the Update-Thread or the GL-Thread!

public boolean detachChildren (IEntityMatcher pEntityMatcher)

WARNING: This function should be called from within postRunnable(Runnable) which is registered to a Scene or the Engine itself, because otherwise it may throw an IndexOutOfBoundsException in the Update-Thread or the GL-Thread!

public void detachChildren ()

public boolean detachSelf ()

public void dispose ()

public float getAlpha ()

public float getBaseHeight ()

public float getBaseWidth ()

public float getBlue ()

public IEntity getChild (int pIndex)

public IEntity getChild (IEntityMatcher pEntityMatcher)

public int getChildCount ()

public int getChildIndex (IEntity pEntity)

public Color getColor ()

public int getDestinationBlendFunction ()

public IEntity getFirstChild ()

public float getGreen ()

public float getHeight ()

public float getHeightScaled ()

public int getID ()

public float getInitialX ()

public float getInitialY ()

public IEntity getLastChild ()

public Transformation getLocalToParentTransformation ()

public Transformation getLocalToSceneTransformation ()

public IEntity getParent ()

public Transformation getParentToLocalTransformation ()

public float getRed ()

public float getRotation ()

public float getRotationCenterX ()

public float getRotationCenterY ()

public float getScaleCenterX ()

public float getScaleCenterY ()

public float getScaleX ()

public float getScaleY ()

public float[] getSceneCenterCoordinates ()

public Transformation getSceneToLocalTransformation ()

public ShaderProgram getShaderProgram ()

public float getSkewCenterX ()

public float getSkewCenterY ()

public float getSkewX ()

public float getSkewY ()

public int getSourceBlendFunction ()

public Object getUserData ()

public IVertexBufferObject getVertexBufferObject ()

public VertexBufferObjectManager getVertexBufferObjectManager ()

public float getWidth ()

public float getWidthScaled ()

public float getX ()

public float getY ()

public int getZIndex ()

public boolean hasParent ()

public boolean isBlendingEnabled ()

public boolean isChildrenIgnoreUpdate ()

public boolean isChildrenVisible ()

public boolean isCulled (Camera pCamera)

Will only be performed if isCullingEnabled() is true.

Parameters
pCamera the currently active camera to perform culling checks against.
Returns
  • true when this object is visible by the Camera, false otherwise.

public boolean isCullingEnabled ()

public boolean isDisposed ()

public boolean isIgnoreUpdate ()

public boolean isRotated ()

public boolean isRotatedOrScaledOrSkewed ()

public boolean isScaled ()

public boolean isSkewed ()

public boolean isVisible ()

public boolean onAreaTouched (TouchEvent pSceneTouchEvent, float pTouchAreaLocalX, float pTouchAreaLocalY)

This method only fires if this Scene.ITouchArea is registered to the Scene via registerTouchArea(ITouchArea).

Returns

public void onAttached ()

public void onDetached ()

public void onDraw (GLState pGLState, Camera pCamera)

public final void onSelected ()

public final void onUnselected ()

public void onUpdate (float pSecondsElapsed)

public L query (IEntityMatcher pEntityMatcher, L pResult)

public ArrayList<IEntity> query (IEntityMatcher pEntityMatcher)

public L queryForSubclass (IEntityMatcher pEntityMatcher, L pResult)

public ArrayList<S> queryForSubclass (IEntityMatcher pEntityMatcher)

public void registerEntityModifier (IEntityModifier pEntityModifier)

public void registerUpdateHandler (IUpdateHandler pUpdateHandler)

public void reset ()

public void setAlpha (float pAlpha)

public void setBlendFunction (int pSourceBlendFunction, int pDestinationBlendFunction)

public void setBlendingEnabled (boolean pBlendingEnabled)

public boolean setChildIndex (IEntity pEntity, int pIndex)

public void setChildrenIgnoreUpdate (boolean pChildrenIgnoreUpdate)

public void setChildrenVisible (boolean pChildrenVisible)

public void setColor (float pRed, float pGreen, float pBlue)

public void setColor (Color pColor)

public void setColor (float pRed, float pGreen, float pBlue, float pAlpha)

public void setCullingEnabled (boolean pCullingEnabled)

public void setHeight (float pHeight)

public void setIgnoreUpdate (boolean pIgnoreUpdate)

public void setInitialPosition ()

public void setParent (IEntity pEntity)

public void setPosition (IEntity pOtherEntity)

public void setPosition (float pX, float pY)

public void setRotation (float pRotation)

public void setRotationCenter (float pRotationCenterX, float pRotationCenterY)

public void setRotationCenterX (float pRotationCenterX)

public void setRotationCenterY (float pRotationCenterY)

public void setScale (float pScale)

public void setScale (float pScaleX, float pScaleY)

public void setScaleCenter (float pScaleCenterX, float pScaleCenterY)

public void setScaleCenterX (float pScaleCenterX)

public void setScaleCenterY (float pScaleCenterY)

public void setScaleX (float pScaleX)

public void setScaleY (float pScaleY)

public void setShaderProgram (ShaderProgram pShaderProgram)

public void setSize (float pWidth, float pHeight)

public void setSkew (float pSkew)

public void setSkew (float pSkewX, float pSkewY)

public void setSkewCenter (float pSkewCenterX, float pSkewCenterY)

public void setSkewCenterX (float pSkewCenterX)

public void setSkewCenterY (float pSkewCenterY)

public void setSkewX (float pSkewX)

public void setSkewY (float pSkewY)

public void setUserData (Object pUserData)

public void setVisible (boolean pVisible)

public void setWidth (float pWidth)

public void setZIndex (int pZIndex)

public void sortChildren ()

Immediately sorts the IEntitys based on their ZIndex. Sort is stable.

public void sortChildren (Comparator<IEntity> pEntityComparator)

Sorts the IEntitys based on the Comparator supplied. Sort is stable.

public void sortChildren (boolean pImmediate)

Sorts the IEntitys based on their ZIndex. Sort is stable. In contrast to sortChildren() this method is particularly useful to avoid multiple sorts per frame.

Parameters
pImmediate if true, the sorting is executed immediately. If false the sorting is executed before the next (visible) drawing of the children of this IEntity.

public boolean swapChildren (int pIndexA, int pIndexB)

public boolean swapChildren (IEntity pEntityA, IEntity pEntityB)

public void toString (StringBuilder pStringBuilder)

public boolean unregisterEntityModifier (IEntityModifier pEntityModifier)

public boolean unregisterEntityModifiers (IEntityModifier.IEntityModifierMatcher pEntityModifierMatcher)

public boolean unregisterUpdateHandler (IUpdateHandler pUpdateHandler)

public boolean unregisterUpdateHandlers (IUpdateHandler.IUpdateHandlerMatcher pUpdateHandlerMatcher)

Protected Methods

protected abstract void onMenuItemReset (IMenuItem pMenuItem)

protected abstract void onMenuItemSelected (IMenuItem pMenuItem)

protected abstract void onMenuItemUnselected (IMenuItem pMenuItem)