예제 #1
0
  @Override
  public void handleInput(Matrix parentTransform, IInput input) {
    super.handleInput(parentTransform, input);

    Vec2 pointerPos = input.getPointerPos(parentTransform);

    boolean enabled = isEnabled() && isVisible(alphaEnableThreshold);
    boolean mouseContains = enabled && contains(pointerPos.x, pointerPos.y);

    if (enabled) {
      model.setRollover(mouseContains);
      if (mouseContains && input.consumePress(VKey.MOUSE_LEFT)) {
        model.setPressed(true);
      }
      if (!input.isPressed(VKey.MOUSE_LEFT, true)) {
        model.setPressed(false);
      }
    } else {
      model.setRollover(false);
      model.setPressed(false);
    }

    if (clickHandler != null && model.consumePress()) {
      eventDispatcher.addEvent(clickHandler);
    }
  }
예제 #2
0
 @Override
 public boolean isToggle() {
   return model.isToggle();
 }
예제 #3
0
 @Override
 public void setToggle(boolean t) {
   model.setToggle(t);
 }
예제 #4
0
 @Override
 public boolean isSelected() {
   return model.isSelected();
 }
예제 #5
0
 @Override
 public void setSelected(boolean s) {
   model.setSelected(s);
 }
예제 #6
0
 @Override
 public void setEnabled(boolean e) {
   model.setEnabled(e);
 }
예제 #7
0
 @Override
 public boolean isEnabled() {
   return model.isEnabled();
 }
예제 #8
0
 @Override
 public boolean isPressed() {
   return model.isPressed();
 }
예제 #9
0
 @Override
 public boolean isRollover() {
   return model.isRollover();
 }
예제 #10
0
 @Override
 public boolean consumePress() {
   return model.consumePress();
 }