@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); } }
@Override public boolean isToggle() { return model.isToggle(); }
@Override public void setToggle(boolean t) { model.setToggle(t); }
@Override public boolean isSelected() { return model.isSelected(); }
@Override public void setSelected(boolean s) { model.setSelected(s); }
@Override public void setEnabled(boolean e) { model.setEnabled(e); }
@Override public boolean isEnabled() { return model.isEnabled(); }
@Override public boolean isPressed() { return model.isPressed(); }
@Override public boolean isRollover() { return model.isRollover(); }
@Override public boolean consumePress() { return model.consumePress(); }