Ejemplo n.º 1
0
 @Override
 public void onPointerEnd(float x, float y) {
   pressed = false;
   if (pointInButton(x, y) && clickHandler != null) {
     ClickEvent click = new ClickEvent();
     click.sender = this;
     clickHandler.onClick(click);
   }
 }
Ejemplo n.º 2
0
 /**
  * Implements the method to handle requests as defined by the <code>ClickHandler</code> interface.
  * The request is only handled here. if the CTRL key was pressed.
  *
  * @see ClickHandler
  */
 public void handleClick(Click click) {
   System.out.println("Panel is asked to handle the request...");
   if (click.hasCtrlMask()) {
     System.out.println("Panel handles the request.");
   } else {
     if (successor == null) {
       throw new RuntimeException("request unhandled (end of chain reached)");
     } else {
       successor.handleClick(click);
     }
   }
 }