Beispiel #1
0
 /**
  * Allow this window to process pointer input. The type of pointer input will be press, release,
  * drag, etc. The x and y coordinates will identify the point at which the pointer event occurred
  * in the coordinate system of this window. This window will translate the coordinates
  * appropriately for each layer contained in this window. This method will return true if the
  * event was processed by this window or one of its layers, false otherwise.
  *
  * @param type the type of pointer event (press, release, drag)
  * @param x the x coordinate of the location of the event
  * @param y the y coordinate of the location of the event
  * @return true if this window or one of its layers processed the event
  */
 public boolean pointerInput(int type, int x, int y) {
   CLayer layer;
   synchronized (layers) {
     for (CLayerElement le = layers.getTop(); le != null; le = le.getLower()) {
       layer = le.getLayer();
       if (layer.visible && layer.supportsInput && layer.handlePoint(x, y)) {
         // If the layer is visible, supports input, and
         // contains the point of the pointer press, we translate
         // the point into the layer's coordinate space and
         // pass on the input
         if (layer.pointerInput(type, x - layer.bounds[X], y - layer.bounds[Y])) {
           return true;
         }
       }
     }
   } // sync
   return false;
 }