gt:         if (isRunning_) {
context: package org.cocos2d.nodes;
  
  import java.util.ArrayList;
  import java.util.Collections;
  import java.util.Comparator;
  import java.util.List;
  
  import javax.microedition.khronos.opengles.GL10;
  
  import org.cocos2d.actions.CCActionManager;
  import org.cocos2d.actions.CCScheduler;
  import org.cocos2d.actions.UpdateCallback;
  import org.cocos2d.actions.base.CCAction;
  import org.cocos2d.config.ccConfig;
  import org.cocos2d.config.ccMacros;
  import org.cocos2d.grid.CCGridBase;
  import org.cocos2d.opengl.CCCamera;
  import org.cocos2d.types.CGAffineTransform;
  import org.cocos2d.types.CGPoint;
  import org.cocos2d.types.CGRect;
  import org.cocos2d.types.CGSize;
  import org.cocos2d.types.util.CGAffineTransformUtil;
  import org.cocos2d.types.util.CGPointUtil;
  import org.cocos2d.types.util.PoolHolder;
  import org.cocos2d.utils.Util5;
  import org.cocos2d.utils.pool.OneClassPool;
  
  import android.os.Build;
  import android.util.Log;
  import android.view.MotionEvent;
  
  /** CCNode is the main element. 
   Anything thats gets drawn or contains things that get drawn is a CCNode.
   The most popular CCNodes are: CCScene, CCLayer, CCSprite, CCMenu.
   
   The main features of a CCNode are:
   - They can contain other CCNode nodes (addChild, getChildByTag, removeChild, etc)
   - They can schedule periodic callback (schedule, unschedule, etc)
   - They can execute actions (runAction, stopAction, etc)
   
   Some CCNode nodes provide extra functionality for them or their children.
   
   Subclassing a CCNode usually means (one/all) of:
   - overriding init to initialize resources and schedule callbacks
   - create callbacks to handle the advancement of time
   - overriding draw to render the node
   
   Features of CCNode:
   - position
   - scale (x, y)
   - rotation (in degrees, clockwise)
   - CCCamera (an interface to gluLookAt )
   - CCGridBase (to do mesh transformations)
   - anchor point
   - size
   - visible
   - z-order
   - openGL z position
   
   Default values:
    - rotation: 0
    - position: (x=0,y=0)
    - scale: (x=1,y=1)
    - contentSize: (x=0,y=0)
    - anchorPoint: (x=0,y=0)
   
   Limitations:
   - A CCNode is a "void" object. It doesn't have a texture
   
   Order in transformations with grid disabled
   -# The node will be translated (position)
   -# The node will be rotated (rotation)
   -# The node will be scaled (scale)
   -# The node will be moved according to the camera values (camera)
   
   Order in transformations with grid enabled
   -# The node will be translated (position)
   -# The node will be rotated (rotation)
   -# The node will be scaled (scale)
   -# The grid will capture the screen
   -# The node will be moved according to the camera values (camera)
   -# The grid will render the captured screen
   
   Camera:
   - Each node has a camera. By default it points to the center of the CCNode.
  */ 
  public class CCNode {
      private static final String LOG_TAG = CCNode.class.getSimpleName();
  
      // private static final boolean COCOSNODE_DEBUG = false;
  
      public static final int kCCNodeTagInvalid = -1;
  
  	// rotation angle
      protected float rotation_;
  
      /** The rotation (angle) of the node in degrees.
       0 is the default rotation angle. Positive values rotate node CW.
      */
      public float getRotation() {
          return rotation_;
      }
  
      // getters synthesized, setters explicit
      public void setRotation(float rot) {
          rotation_ = rot;
          isTransformDirty_ = isInverseDirty_ = true;
          if (ccConfig.CC_NODE_TRANSFORM_USING_AFFINE_MATRIX) {
              isTransformGLDirty_ = true;
          }
      }
  
  	// scaling factors
      protected float scaleX_;
      protected float scaleY_;
  
      /** The scale factor of the node. 
         1.0 is the default scale factor. It only modifies the X scale factor.
      */
      public float getScaleX() {
          return scaleX_;
      }
  
      public void setScaleX(float sx) {
          scaleX_ = sx;
          isTransformDirty_ = isInverseDirty_ = true;
          if (ccConfig.CC_NODE_TRANSFORM_USING_AFFINE_MATRIX) {
              isTransformGLDirty_ = true;
          }
      }
  
      /** The scale factor of the node. 
          1.0 is the default scale factor. It only modifies the Y scale factor.
      */
      public float getScaleY() {
          return scaleY_;
      }
  
      public void setScaleY(float sy) {
          scaleY_ = sy;
          isTransformDirty_ = isInverseDirty_ = true;
          if (ccConfig.CC_NODE_TRANSFORM_USING_AFFINE_MATRIX) {
              isTransformGLDirty_ = true;
          }	
      }
  
      /** The scale factor of the node.
          1.0 is the default scale factor. It modifies the X and Y scale at the same time.
      */
      public void setScale(float s) {
          scaleX_ = scaleY_ = s;
          isTransformDirty_ = isInverseDirty_ = true;
          if (ccConfig.CC_NODE_TRANSFORM_USING_AFFINE_MATRIX) {
              isTransformGLDirty_ = true;
          }
      }
  
      public float getScale() {
          if (scaleX_ == scaleY_) {
              return scaleX_;
          } else {
              Log.w(LOG_TAG, "CCNode#scale. ScaleX != ScaleY. Don't know which one to return");
          }
          return 0;
      }
  
  	// anchor point in pixels
  	protected CGPoint anchorPointInPixels_;	
  
      /** The anchorPoint in absolute pixels.
        Since v0.8 you can only read it. If you wish to modify it, use anchorPoint instead
      */
      public CGPoint getAnchorPointInPixels() {
          return CGPoint.make(anchorPointInPixels_.x, anchorPointInPixels_.y);
      }
      
  	// If YES the transformtions will be relative to (-transform.x, -transform.y).
  	// Sprites, Labels and any other "small" object uses it.
  	// Scenes, Layers and other "whole screen" object don't use it.
      private boolean isRelativeAnchorPoint_;
  
      /** If YES the transformtions will be relative to it's anchor point.
         Sprites, Labels and any other sizeble object use it have it enabled by default.
         Scenes, Layers and other "whole screen" object don't use it, have it disabled by default.
      */
      public void setRelativeAnchorPoint(boolean newValue) {
          isRelativeAnchorPoint_ = newValue;
          isTransformDirty_ = isInverseDirty_ = true;
          if (ccConfig.CC_NODE_TRANSFORM_USING_AFFINE_MATRIX) {
              isTransformGLDirty_ = true;
          }
      }
  
      public boolean getRelativeAnchorPoint() {
          return isRelativeAnchorPoint_;
      }
  
  	// anchor point normalized
      protected CGPoint anchorPoint_;
  
  	// untransformed size of the node
      protected CGSize contentSize_;
  
      /** The untransformed size of the node.
       The contentSize remains the same no matter the node is scaled or rotated.
       All nodes has a size. Layer and Scene has the same size of the screen.
       @since v0.8
       */
      public void setContentSize(CGSize size) {
      	setContentSize(size.width, size.height);
      }
  	
  	public void setContentSize(float w, float h) {
          if ( !(contentSize_.width == w && contentSize_.height == h) ) {
              contentSize_.set(w, h);// = CGSize.make(size.width, size.height);
              anchorPointInPixels_.set(contentSize_.width * anchorPoint_.x,
                                                contentSize_.height * anchorPoint_.y);
              isTransformDirty_ = isInverseDirty_ = true;
              if (ccConfig.CC_NODE_TRANSFORM_USING_AFFINE_MATRIX) {
                  isTransformGLDirty_ = true;
              }
  
          }
      }
  	
      public CGSize getContentSize() {
          return CGSize.make(contentSize_.width, contentSize_.height);
      }
      
      public CGSize getContentSizeRef() {
          return contentSize_;
      }
  
      /** anchorPoint is the point around which all transformations and positioning manipulations take place.
        It's like a pin in the node where it is "attached" to its parent.
        The anchorPoint is normalized, like a percentage.
          (0,0) means the bottom-left corner and (1,1) means the top-right corner.
        But you can use values higher than (1,1) and lower than (0,0) too.
        The default anchorPoint is (0.5,0.5), so it starts in the center of the node.
        @since v0.8
      */
      public void setAnchorPoint(CGPoint pnt) {
      	setAnchorPoint(pnt.x, pnt.y);
      }
      
      public void setAnchorPoint(float x, float y) {
          if (!(x == anchorPoint_.x && y == anchorPoint_.y)) {
              anchorPoint_.set(x, y);// = CGPoint.make(pnt.x, pnt.y);
              anchorPointInPixels_.set(contentSize_.width * anchorPoint_.x,// = CGPoint.ccp(contentSize_.width * anchorPoint_.x, 
              						contentSize_.height * anchorPoint_.y);//   contentSize_.height * anchorPoint_.y);
  
              isTransformDirty_ = isInverseDirty_ = true;
              if (ccConfig.CC_NODE_TRANSFORM_USING_AFFINE_MATRIX) {
                  isTransformGLDirty_ = true;
              }
          }
      }
     
      public CGPoint getAnchorPoint() {
          return CGPoint.make(anchorPoint_.x, anchorPoint_.y);
      }
      
      public CGPoint getAnchorPointRef() {
          return anchorPoint_;
      }
      
      // #if	CC_NODE_TRANSFORM_USING_AFFINE_MATRIX
  	private float []	transformGL_; // [16];
  	
      // #endif
      private CGAffineTransform transform_, inverse_;
  
  	// To reduce memory, place BOOLs that are not properties here:
      private boolean isTransformDirty_;
      private boolean isInverseDirty_;
  
      //#if	CC_NODE_TRANSFORM_USING_AFFINE_MATRIX
  	private boolean isTransformGLDirty_;
      //#endif
  
      /** returns a "local" axis aligned bounding box of the node.
        The returned box is relative only to its parent.
        @since v0.8.2
      */
      public CGRect getBoundingBox() {
          CGRect rect = CGRect.make(0, 0, contentSize_.width, contentSize_.height);
          return CGRect.applyAffineTransform(rect, nodeToParentTransform());
      }
  
  	// position of the node
      protected CGPoint position_;
  
      /** Position (x,y) of the node in OpenGL coordinates.
        (0,0) is the left-bottom corner.
      */
      public CGPoint getPosition() {
          return CGPoint.make(position_.x, position_.y);
      }
  
      public CGPoint getPositionRef() {
          return position_;
      }
      
      public void setPosition(CGPoint pnt) {
      	setPosition(pnt.x, pnt.y);
      }
      
  	public void setPosition(float x, float y) {
          position_.set(x, y);// = CGPoint.make(pnt.x, pnt.y);
          isTransformDirty_ = isInverseDirty_ = true;
          if (ccConfig.CC_NODE_TRANSFORM_USING_AFFINE_MATRIX) {
              isTransformGLDirty_ = true;
          }
      }	
  	
      /** A CCCamera object that lets you move the node using a gluLookAt */
      private CCCamera camera_;
  
      // camera: lazy alloc
      public CCCamera getCamera() {
          if (camera_ == null)
              camera_ = new CCCamera();
  
  		// by default, center camera at the Sprite's anchor point
  		//		[camera_ setCenterX:anchorPointInPixels_.x centerY:anchorPointInPixels_.y centerZ:0];
  		//		[camera_ setEyeX:anchorPointInPixels_.x eyeY:anchorPointInPixels_.y eyeZ:1];
  		
  		//		[camera_ setCenterX:0 centerY:0 centerZ:0];
  		//		[camera_ setEyeX:0 eyeY:0 eyeZ:1];
  	
          return camera_;
      }
  
  	// a Grid
      protected CCGridBase grid_;
  
      /** A CCGrid object that is used when applying effects */
      public CCGridBase getGrid() {
          return grid_;
      }
  
      public void setGrid(CCGridBase grid) {
          this.grid_ = grid;
      }
  
  	// is visible
      protected boolean visible_;
  
      /** Whether of not the node is visible. Default is YES */
      public boolean getVisible() {
          return visible_;
      }
  
      public void setVisible(boolean visible) {
          this.visible_ = visible;
      }
  
  	// weakref to parent
      protected CCNode parent_;
  
      /** A weak reference to the parent */
      public CCNode getParent() {
          return parent_;
      }
  
      public void setParent(CCNode parent) {
          parent_ = parent;
      }
  
  	// a tag. any number you want to assign to the node
      private int tag_;
  
      /** A tag used to identify the node easily */
      public int getTag() {
          return tag_;
      }
  
      public void setTag(int tag) {
          tag_ = tag;
      }
  
  	// openGL real Z vertex
      protected float vertexZ_;
  
      /** The real openGL Z vertex.
       Differences between openGL Z vertex and cocos2d Z order:
         - OpenGL Z modifies the Z vertex, and not the Z order in the relation between parent-children
         - OpenGL Z might require to set 2D projection
         - cocos2d Z order works OK if all the nodes uses the same openGL Z vertex. eg: vertexZ = 0
       @warning: Use it at your own risk since it might break the cocos2d parent-children z order
       @since v0.8
       */
      public float getVertexZ() {
          return vertexZ_;
      }
  
      public void setVertexZ(float z) {
          vertexZ_ = z;
      }
  
  
  	// z-order value
      private int zOrder_;
  
      /** The z order of the node relative to it's "brothers": children of the same parent */
      public int getZOrder() {
          return zOrder_;
      }
  
      // used internally to alter the zOrder variable. DON'T call this method manually
      private void _setZOrder(int z) {
          zOrder_ = z;
      }
  
  	// array of children
      protected List<CCNode> children_;
  
      public List<CCNode> getChildren() {
          return children_;
      }
  
      // user data field
      private Object userData;
  
      /** A custom user data pointer */
      public Object getUserData() {
          return userData;
      }
  
      public void setUserData(Object data) {
          userData = data;
      }
  
  	// Is running
      private boolean isRunning_;
  
      /** whether or not the node is running */
      public boolean isRunning() {
          return isRunning_;
      }
  
      // initializators
      /** allocates and initializes a node.
        The node will be created as "autorelease".
      */
      public static CCNode node() {
          return new CCNode();
      }
  
      /** initializes the node */
      protected CCNode() {
      	transformGL_ = new float[16];
      	
          isRunning_ = false;
  
          rotation_ = 0.0f;
          scaleX_ = 1.0f;
          scaleY_ = 1.0f;
          position_ = CGPoint.ccp(0, 0);
  
          transform_ = CGAffineTransform.identity();
          inverse_ = CGAffineTransform.identity();
          
          // "whole screen" objects. like Scenes and Layers, should set relativeAnchorPoint to false        
          isRelativeAnchorPoint_ = true;
  
  		anchorPointInPixels_ = CGPoint.ccp(0,0);
          anchorPoint_ = CGPoint.ccp(0,0);
          contentSize_ = CGSize.zero();
  
          isTransformDirty_ = isInverseDirty_ = true;
  	
          if (ccConfig.CC_NODE_TRANSFORM_USING_AFFINE_MATRIX) {
  		    isTransformGLDirty_ = true;
          }	
  		
  		zOrder_ = 0;
          vertexZ_ = 0;
          grid_ = null;
          visible_ = true;
  		tag_ = kCCNodeTagInvalid;
  
  		// lazy alloc
          camera_ = null;
          
  		// children (lazy allocs)
          children_ = null;
  
  		// userData is always inited as nil
          userData = null;
      }
  
  
      /** Adds a child to the container with z order and tag
        It returns self, so you can chain several addChilds.
        @since v0.7.1
      */
      /* "add" logic MUST only be on this method
       * If a class want's to extend the 'addChild' behaviour it only needs
       * to override this method
       */
      public CCNode addChild(CCNode child, int z, int tag) {
  	    assert child != null : "Argument must be non-nil";
  	    assert child.parent_ == null: "child already added. It can't be added again";
  
          if (children_ == null)
              childrenAlloc();
  
          insertChild(child, z);
          child.tag_ = tag;
          child.setParent(this);
  