public abstract class BaseMenuItemDecorator extends java.lang.Object implements IMenuItem
IUpdateHandler.IUpdateHandlerMatcherIDisposable.AlreadyDisposedExceptionITouchArea.ITouchAreaMatcher| Modifier and Type | Field and Description |
|---|---|
protected IMenuItem |
mMenuItem |
BLENDFUNCTION_DESTINATION_DEFAULT, BLENDFUNCTION_DESTINATION_PREMULTIPLYALPHA_DEFAULT, BLENDFUNCTION_SOURCE_DEFAULT, BLENDFUNCTION_SOURCE_PREMULTIPLYALPHA_DEFAULTTAG_INVALID| Constructor and Description |
|---|
BaseMenuItemDecorator(IMenuItem pMenuItem) |
| Modifier and Type | Method and Description |
|---|---|
void |
attachChild(IEntity pEntity) |
void |
callOnChildren(IEntityParameterCallable pEntityParameterCallable) |
void |
callOnChildren(IEntityParameterCallable pEntityParameterCallable,
IEntityMatcher pEntityMatcher) |
void |
clearEntityModifiers() |
void |
clearUpdateHandlers() |
boolean |
collidesWith(IShape pOtherShape) |
boolean |
contains(float pX,
float pY) |
float[] |
convertLocalToSceneCoordinates(float[] pCoordinates) |
float[] |
convertLocalToSceneCoordinates(float[] pCoordinates,
float[] pReuse) |
float[] |
convertLocalToSceneCoordinates(float pX,
float pY) |
float[] |
convertLocalToSceneCoordinates(float pX,
float pY,
float[] pReuse) |
float[] |
convertSceneToLocalCoordinates(float[] pCoordinates) |
float[] |
convertSceneToLocalCoordinates(float[] pCoordinates,
float[] pReuse) |
float[] |
convertSceneToLocalCoordinates(float pX,
float pY) |
float[] |
convertSceneToLocalCoordinates(float pX,
float pY,
float[] pReuse) |
boolean |
detachChild(IEntity pEntity)
WARNING: This function should be called from within
RunnableHandler.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
RunnableHandler.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(int pTag)
WARNING: This function should be called from within
RunnableHandler.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 |
detachChildren(IEntityMatcher pEntityMatcher)
WARNING: This function should be called from within
RunnableHandler.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 |
detachSelf() |
void |
dispose() |
float |
getAlpha() |
int |
getBlendFunctionDestination() |
int |
getBlendFunctionSource() |
float |
getBlue() |
IEntity |
getChildByIndex(int pIndex) |
IEntity |
getChildByMatcher(IEntityMatcher pEntityMatcher) |
IEntity |
getChildByTag(int pTag) |
int |
getChildCount() |
Color |
getColor() |
int |
getEntityModifierCount() |
IEntity |
getFirstChild() |
float |
getGreen() |
float |
getHeight() |
float |
getHeightScaled() |
int |
getID() |
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() |
float[] |
getSceneCenterCoordinates(float[] pReuse) |
Transformation |
getSceneToLocalTransformation() |
ShaderProgram |
getShaderProgram() |
float |
getSkewCenterX() |
float |
getSkewCenterY() |
float |
getSkewX() |
float |
getSkewY() |
int |
getTag() |
int |
getUpdateHandlerCount() |
java.lang.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
IEntity.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
ITouchArea is registered to the Scene via Scene.registerTouchArea(ITouchArea). |
void |
onAttached() |
void |
onDetached() |
void |
onDraw(GLState pGLState,
Camera pCamera) |
protected abstract void |
onMenuItemReset(IMenuItem pMenuItem) |
protected abstract void |
onMenuItemSelected(IMenuItem pMenuItem) |
protected abstract void |
onMenuItemUnselected(IMenuItem pMenuItem) |
void |
onSelected() |
void |
onUnselected() |
void |
onUpdate(float pSecondsElapsed) |
java.util.ArrayList<IEntity> |
query(IEntityMatcher pEntityMatcher) |
<L extends java.util.List<IEntity>> |
query(IEntityMatcher pEntityMatcher,
L pResult) |
IEntity |
queryFirst(IEntityMatcher pEntityMatcher) |
<S extends IEntity> |
queryFirstForSubclass(IEntityMatcher pEntityMatcher) |
<S extends IEntity> |
queryForSubclass(IEntityMatcher pEntityMatcher) |
<L extends java.util.List<S>,S extends IEntity> |
queryForSubclass(IEntityMatcher pEntityMatcher,
L pResult) |
void |
registerEntityModifier(IEntityModifier pEntityModifier) |
void |
registerUpdateHandler(IUpdateHandler pUpdateHandler) |
void |
reset() |
void |
setAlpha(float pAlpha) |
void |
setBlendFunction(int pBlendFunctionSource,
int pBlendFunctionDestination) |
void |
setBlendFunctionDestination(int pBlendFunctionDestination) |
void |
setBlendFunctionSource(int pBlendFunctionSource) |
void |
setBlendingEnabled(boolean pBlendingEnabled) |
void |
setBlue(float pBlue) |
void |
setChildrenIgnoreUpdate(boolean pChildrenIgnoreUpdate) |
void |
setChildrenVisible(boolean pChildrenVisible) |
void |
setColor(Color pColor) |
void |
setColor(float pRed,
float pGreen,
float pBlue) |
void |
setColor(float pRed,
float pGreen,
float pBlue,
float pAlpha) |
void |
setCullingEnabled(boolean pCullingEnabled) |
void |
setGreen(float pGreen) |
void |
setHeight(float pHeight) |
void |
setIgnoreUpdate(boolean pIgnoreUpdate) |
void |
setParent(IEntity pEntity) |
void |
setPosition(float pX,
float pY) |
void |
setPosition(IEntity pOtherEntity) |
void |
setRed(float pRed) |
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 |
setTag(int pTag) |
void |
setUserData(java.lang.Object pUserData) |
void |
setVisible(boolean pVisible) |
void |
setWidth(float pWidth) |
void |
setX(float pX) |
void |
setY(float pY) |
void |
setZIndex(int pZIndex) |
void |
sortChildren()
Immediately sorts the
IEntitys based on their ZIndex. |
void |
sortChildren(boolean pImmediate)
Sorts the
IEntitys based on their ZIndex. |
void |
sortChildren(IEntityComparator pEntityComparator)
Sorts the
IEntitys based on the Comparator supplied. |
void |
toString(java.lang.StringBuilder pStringBuilder) |
boolean |
unregisterEntityModifier(IEntityModifier pEntityModifier) |
boolean |
unregisterEntityModifiers(IEntityModifier.IEntityModifierMatcher pEntityModifierMatcher) |
boolean |
unregisterUpdateHandler(IUpdateHandler pUpdateHandler) |
boolean |
unregisterUpdateHandlers(IUpdateHandler.IUpdateHandlerMatcher pUpdateHandlerMatcher) |
protected final IMenuItem mMenuItem
public BaseMenuItemDecorator(IMenuItem pMenuItem)
protected abstract void onMenuItemSelected(IMenuItem pMenuItem)
protected abstract void onMenuItemUnselected(IMenuItem pMenuItem)
protected abstract void onMenuItemReset(IMenuItem pMenuItem)
public VertexBufferObjectManager getVertexBufferObjectManager()
getVertexBufferObjectManager in interface IShapepublic IVertexBufferObject getVertexBufferObject()
getVertexBufferObject in interface IShapepublic final void onSelected()
onSelected in interface IMenuItempublic final void onUnselected()
onUnselected in interface IMenuItempublic void setPosition(IEntity pOtherEntity)
setPosition in interface IEntitypublic void setPosition(float pX,
float pY)
setPosition in interface IEntitypublic float getWidth()
getWidth in interface IAreaShapepublic float getWidthScaled()
getWidthScaled in interface IAreaShapepublic float getHeight()
getHeight in interface IAreaShapepublic float getHeightScaled()
getHeightScaled in interface IAreaShapepublic void setWidth(float pWidth)
setWidth in interface IAreaShapepublic void setHeight(float pHeight)
setHeight in interface IAreaShapepublic void setSize(float pWidth,
float pHeight)
setSize in interface IAreaShapepublic void setColor(float pRed,
float pGreen,
float pBlue)
public void setColor(float pRed,
float pGreen,
float pBlue,
float pAlpha)
public float getRotation()
getRotation in interface IEntitypublic void setRotation(float pRotation)
setRotation in interface IEntitypublic float getRotationCenterX()
getRotationCenterX in interface IEntitypublic float getRotationCenterY()
getRotationCenterY in interface IEntitypublic void setRotationCenterX(float pRotationCenterX)
setRotationCenterX in interface IEntitypublic void setRotationCenterY(float pRotationCenterY)
setRotationCenterY in interface IEntitypublic void setRotationCenter(float pRotationCenterX,
float pRotationCenterY)
setRotationCenter in interface IEntitypublic void setScale(float pScaleX,
float pScaleY)
public float getScaleCenterX()
getScaleCenterX in interface IEntitypublic float getScaleCenterY()
getScaleCenterY in interface IEntitypublic void setScaleCenterX(float pScaleCenterX)
setScaleCenterX in interface IEntitypublic void setScaleCenterY(float pScaleCenterY)
setScaleCenterY in interface IEntitypublic void setScaleCenter(float pScaleCenterX,
float pScaleCenterY)
setScaleCenter in interface IEntitypublic float getSkewCenterX()
getSkewCenterX in interface IEntitypublic float getSkewCenterY()
getSkewCenterY in interface IEntitypublic void setSkewCenterX(float pSkewCenterX)
setSkewCenterX in interface IEntitypublic void setSkewCenterY(float pSkewCenterY)
setSkewCenterY in interface IEntitypublic void setSkewCenter(float pSkewCenterX,
float pSkewCenterY)
setSkewCenter in interface IEntitypublic boolean isRotatedOrScaledOrSkewed()
isRotatedOrScaledOrSkewed in interface IEntitypublic boolean collidesWith(IShape pOtherShape)
collidesWith in interface IShapepublic float[] getSceneCenterCoordinates()
getSceneCenterCoordinates in interface IEntitypublic float[] getSceneCenterCoordinates(float[] pReuse)
getSceneCenterCoordinates in interface IEntitypReuse - must be of length 2.pReuse as a convenience.public boolean isCullingEnabled()
isCullingEnabled in interface IEntitypublic void registerEntityModifier(IEntityModifier pEntityModifier)
registerEntityModifier in interface IEntitypublic boolean unregisterEntityModifier(IEntityModifier pEntityModifier)
unregisterEntityModifier in interface IEntitypublic boolean unregisterEntityModifiers(IEntityModifier.IEntityModifierMatcher pEntityModifierMatcher)
unregisterEntityModifiers in interface IEntitypublic int getEntityModifierCount()
getEntityModifierCount in interface IEntitypublic void clearEntityModifiers()
clearEntityModifiers in interface IEntitypublic boolean isBlendingEnabled()
isBlendingEnabled in interface IShapepublic void setBlendingEnabled(boolean pBlendingEnabled)
setBlendingEnabled in interface IShapepublic int getBlendFunctionSource()
getBlendFunctionSource in interface IShapepublic void setBlendFunctionSource(int pBlendFunctionSource)
setBlendFunctionSource in interface IShapepublic int getBlendFunctionDestination()
getBlendFunctionDestination in interface IShapepublic void setBlendFunctionDestination(int pBlendFunctionDestination)
setBlendFunctionDestination in interface IShapepublic void setBlendFunction(int pBlendFunctionSource,
int pBlendFunctionDestination)
setBlendFunction in interface IShapepublic void setCullingEnabled(boolean pCullingEnabled)
setCullingEnabled in interface IEntitypublic ShaderProgram getShaderProgram()
getShaderProgram in interface IShapepublic void setShaderProgram(ShaderProgram pShaderProgram)
setShaderProgram in interface IShapepublic void onDraw(GLState pGLState, Camera pCamera)
onDraw in interface IDrawHandlerpublic void onUpdate(float pSecondsElapsed)
onUpdate in interface IUpdateHandlerpublic void reset()
reset in interface IUpdateHandlerpublic boolean isDisposed()
isDisposed in interface IDisposablepublic void dispose()
dispose in interface IDisposablepublic boolean contains(float pX,
float pY)
contains in interface ITouchAreapublic float[] convertLocalToSceneCoordinates(float pX,
float pY)
convertLocalToSceneCoordinates in interface IEntityconvertLocalToSceneCoordinates in interface ITouchAreapublic float[] convertLocalToSceneCoordinates(float pX,
float pY,
float[] pReuse)
convertLocalToSceneCoordinates in interface IEntitypReuse - must be of length 2.pReuse as a convenience.public float[] convertLocalToSceneCoordinates(float[] pCoordinates)
convertLocalToSceneCoordinates in interface IEntitypCoordinates - must be of length 2.public float[] convertLocalToSceneCoordinates(float[] pCoordinates,
float[] pReuse)
convertLocalToSceneCoordinates in interface IEntitypCoordinates - must be of length 2.pReuse - must be of length 2.pReuse as a convenience.public float[] convertSceneToLocalCoordinates(float pX,
float pY)
convertSceneToLocalCoordinates in interface IEntityconvertSceneToLocalCoordinates in interface ITouchAreapublic float[] convertSceneToLocalCoordinates(float pX,
float pY,
float[] pReuse)
convertSceneToLocalCoordinates in interface IEntitypReuse - must be of length 2.pReuse as a convenience.public float[] convertSceneToLocalCoordinates(float[] pCoordinates)
convertSceneToLocalCoordinates in interface IEntitypCoordinates - must be of length 2.public float[] convertSceneToLocalCoordinates(float[] pCoordinates,
float[] pReuse)
convertSceneToLocalCoordinates in interface IEntitypCoordinates - must be of length 2.pReuse - must be of length 2.pReuse as a convenience.public boolean onAreaTouched(TouchEvent pSceneTouchEvent, float pTouchAreaLocalX, float pTouchAreaLocalY)
ITouchAreaITouchArea is registered to the Scene via Scene.registerTouchArea(ITouchArea).onAreaTouched in interface ITouchAreatrue if the event was handled (that means IOnAreaTouchListener of the Scene will not be fired!), otherwise false.public int getChildCount()
getChildCount in interface IEntitypublic void attachChild(IEntity pEntity)
attachChild in interface IEntitypublic IEntity getFirstChild()
getFirstChild in interface IEntitypublic IEntity getLastChild()
getLastChild in interface IEntitypublic IEntity getChildByTag(int pTag)
getChildByTag in interface IEntitypublic IEntity getChildByIndex(int pIndex)
getChildByIndex in interface IEntitypublic IEntity getChildByMatcher(IEntityMatcher pEntityMatcher)
getChildByMatcher in interface IEntitypublic java.util.ArrayList<IEntity> query(IEntityMatcher pEntityMatcher)
query in interface IEntityIEntityMatcher.public IEntity queryFirst(IEntityMatcher pEntityMatcher)
queryFirst in interface IEntityIEntityMatcher or null if none matches..public <L extends java.util.List<IEntity>> L query(IEntityMatcher pEntityMatcher, L pResult)
query in interface IEntitypResult - the List to put the result into.IEntityMatcher.public <S extends IEntity> S queryFirstForSubclass(IEntityMatcher pEntityMatcher)
queryFirstForSubclass in interface IEntityIEntityMatcher or null if none matches..public <S extends IEntity> java.util.ArrayList<S> queryForSubclass(IEntityMatcher pEntityMatcher) throws java.lang.ClassCastException
queryForSubclass in interface IEntityIEntityMatcher.java.lang.ClassCastException - when the supplied IEntityMatcher matched an IEntity that was not of the requested subtype.public <L extends java.util.List<S>,S extends IEntity> L queryForSubclass(IEntityMatcher pEntityMatcher, L pResult) throws java.lang.ClassCastException
queryForSubclass in interface IEntitypResult - the List to put the result into.IEntityMatcher.java.lang.ClassCastException - when the supplied IEntityMatcher matched an IEntity that was not of the requested subtype.public void sortChildren()
IEntityIEntitys based on their ZIndex. Sort is stable.sortChildren in interface IEntitypublic void sortChildren(boolean pImmediate)
IEntityIEntitys based on their ZIndex. Sort is stable.
In contrast to IEntity.sortChildren() this method is particularly useful to avoid multiple sorts per frame.sortChildren in interface IEntitypImmediate - 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 void sortChildren(IEntityComparator pEntityComparator)
IEntityIEntitys based on the Comparator supplied. Sort is stable.sortChildren in interface IEntitypublic boolean detachSelf()
detachSelf in interface IEntitypublic boolean detachChild(IEntity pEntity)
IEntityRunnableHandler.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!detachChild in interface IEntitypublic IEntity detachChild(int pTag)
IEntityRunnableHandler.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!detachChild in interface IEntitypublic IEntity detachChild(IEntityMatcher pEntityMatcher)
IEntityRunnableHandler.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!detachChild in interface IEntitypublic boolean detachChildren(IEntityMatcher pEntityMatcher)
IEntityRunnableHandler.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!detachChildren in interface IEntitypublic void detachChildren()
detachChildren in interface IEntitypublic void callOnChildren(IEntityParameterCallable pEntityParameterCallable)
callOnChildren in interface IEntitypublic void callOnChildren(IEntityParameterCallable pEntityParameterCallable, IEntityMatcher pEntityMatcher)
callOnChildren in interface IEntitypublic Transformation getLocalToSceneTransformation()
getLocalToSceneTransformation in interface IEntitypublic Transformation getSceneToLocalTransformation()
getSceneToLocalTransformation in interface IEntitypublic Transformation getLocalToParentTransformation()
getLocalToParentTransformation in interface IEntitypublic Transformation getParentToLocalTransformation()
getParentToLocalTransformation in interface IEntitypublic void setVisible(boolean pVisible)
setVisible in interface IEntitypublic boolean isCulled(Camera pCamera)
IEntityIEntity.isCullingEnabled() is true.public boolean isChildrenVisible()
isChildrenVisible in interface IEntitypublic void setChildrenVisible(boolean pChildrenVisible)
setChildrenVisible in interface IEntitypublic boolean isIgnoreUpdate()
isIgnoreUpdate in interface IEntitypublic void setIgnoreUpdate(boolean pIgnoreUpdate)
setIgnoreUpdate in interface IEntitypublic boolean isChildrenIgnoreUpdate()
isChildrenIgnoreUpdate in interface IEntitypublic void setChildrenIgnoreUpdate(boolean pChildrenIgnoreUpdate)
setChildrenIgnoreUpdate in interface IEntitypublic void setUserData(java.lang.Object pUserData)
setUserData in interface IEntitypublic java.lang.Object getUserData()
getUserData in interface IEntitypublic void onAttached()
onAttached in interface IEntitypublic void onDetached()
onDetached in interface IEntitypublic void registerUpdateHandler(IUpdateHandler pUpdateHandler)
registerUpdateHandler in interface IEntitypublic boolean unregisterUpdateHandler(IUpdateHandler pUpdateHandler)
unregisterUpdateHandler in interface IEntitypublic int getUpdateHandlerCount()
getUpdateHandlerCount in interface IEntitypublic void clearUpdateHandlers()
clearUpdateHandlers in interface IEntitypublic boolean unregisterUpdateHandlers(IUpdateHandler.IUpdateHandlerMatcher pUpdateHandlerMatcher)
unregisterUpdateHandlers in interface IEntity