/** Removes the touch, keyboard, and scroll focus for the specified actor and any descendants. */ public void unfocus (Actor actor) { cancelTouchFocus(actor); if (scrollFocus != null && scrollFocus.isDescendantOf(actor)) setScrollFocus(null); if (keyboardFocus != null && keyboardFocus.isDescendantOf(actor)) setKeyboardFocus(null); }
/** Removes the touch, keyboard, and scroll focus for the specified actor and any descendants. */ public void unfocus (Actor actor) { cancelTouchFocus(actor); if (scrollFocus != null && scrollFocus.isDescendantOf(actor)) setScrollFocus(null); if (keyboardFocus != null && keyboardFocus.isDescendantOf(actor)) setKeyboardFocus(null); }
/** Returns true if the specified position is over the specified actor or within the tap square. */ public boolean isOver (Actor actor, float x, float y) { Actor hit = actor.hit(x, y, true); if (hit == null || !hit.isDescendantOf(actor)) return inTapSquare(x, y); return true; }
public void exit (InputEvent event, float x, float y, int pointer, Actor toActor) { super.exit(event, x, y, pointer, toActor); if (toActor == null || !toActor.isDescendantOf(Tree.this)) setOverNode(null); } });
/** Returns true if the specified position is over the specified actor or within the tap square. */ public boolean isOver (Actor actor, float x, float y) { Actor hit = actor.hit(x, y, true); if (hit == null || !hit.isDescendantOf(actor)) return inTapSquare(x, y); return true; }
public void exit (InputEvent event, float x, float y, int pointer, Actor toActor) { super.exit(event, x, y, pointer, toActor); if (toActor == null || !toActor.isDescendantOf(Tree.this)) setOverNode(null); } });
public void exit (InputEvent event, float x, float y, int pointer, Actor toActor) { if (toActor != null && toActor.isDescendantOf(event.getListenerActor())) return; hide(); }
public void exit (InputEvent event, float x, float y, int pointer, Actor toActor) { if (toActor != null && toActor.isDescendantOf(event.getListenerActor())) return; hide(); }
public void enter (InputEvent event, float x, float y, int pointer, Actor fromActor) { if (pointer != -1) return; if (Gdx.input.isTouched()) return; Actor actor = event.getListenerActor(); if (fromActor != null && fromActor.isDescendantOf(actor)) return; setContainerPosition(actor, x, y); manager.enter(this); }
public void enter (InputEvent event, float x, float y, int pointer, Actor fromActor) { if (pointer != -1) return; if (Gdx.input.isTouched()) return; Actor actor = event.getListenerActor(); if (fromActor != null && fromActor.isDescendantOf(actor)) return; setContainerPosition(actor, x, y); manager.enter(this); }
private void focusChanged (FocusEvent event) { Stage stage = getStage(); if (isModal && stage != null && stage.getRoot().getChildren().size > 0 && stage.getRoot().getChildren().peek() == Dialog.this) { // Dialog is top most actor. Actor newFocusedActor = event.getRelatedActor(); if (newFocusedActor != null && !newFocusedActor.isDescendantOf(Dialog.this) && !(newFocusedActor.equals(previousKeyboardFocus) || newFocusedActor.equals(previousScrollFocus))) event.cancel(); } } };
private void focusChanged (FocusEvent event) { Stage stage = getStage(); if (isModal && stage != null && stage.getRoot().getChildren().size > 0 && stage.getRoot().getChildren().peek() == Dialog.this) { // Dialog is top most actor. Actor newFocusedActor = event.getRelatedActor(); if (newFocusedActor != null && !newFocusedActor.isDescendantOf(Dialog.this) && !(newFocusedActor.equals(previousKeyboardFocus) || newFocusedActor.equals(previousScrollFocus))) event.cancel(); } } };
/** {@link #pack() Packs} the dialog (but doesn't set the position), adds it to the stage, sets it as the keyboard and scroll * focus, clears any actions on the dialog, and adds the specified action to it. The previous keyboard and scroll focus are * remembered so they can be restored when the dialog is hidden. * @param action May be null. */ public Dialog show (Stage stage, Action action) { clearActions(); removeCaptureListener(ignoreTouchDown); previousKeyboardFocus = null; Actor actor = stage.getKeyboardFocus(); if (actor != null && !actor.isDescendantOf(this)) previousKeyboardFocus = actor; previousScrollFocus = null; actor = stage.getScrollFocus(); if (actor != null && !actor.isDescendantOf(this)) previousScrollFocus = actor; pack(); stage.addActor(this); stage.cancelTouchFocus(); stage.setKeyboardFocus(this); stage.setScrollFocus(this); if (action != null) addAction(action); return this; }
/** {@link #pack() Packs} the dialog (but doesn't set the position), adds it to the stage, sets it as the keyboard and scroll * focus, clears any actions on the dialog, and adds the specified action to it. The previous keyboard and scroll focus are * remembered so they can be restored when the dialog is hidden. * @param action May be null. */ public Dialog show (Stage stage, Action action) { clearActions(); removeCaptureListener(ignoreTouchDown); previousKeyboardFocus = null; Actor actor = stage.getKeyboardFocus(); if (actor != null && !actor.isDescendantOf(this)) previousKeyboardFocus = actor; previousScrollFocus = null; actor = stage.getScrollFocus(); if (actor != null && !actor.isDescendantOf(this)) previousScrollFocus = actor; pack(); stage.addActor(this); stage.cancelTouchFocus(); stage.setKeyboardFocus(this); stage.setScrollFocus(this); if (action != null) addAction(action); return this; }
/** Removes the dialog from the stage, restoring the previous keyboard and scroll focus, and adds the specified action to the * dialog. * @param action If null, the dialog is removed immediately. Otherwise, the dialog is removed when the action completes. The * dialog will not respond to touch down events during the action. */ public void hide (Action action) { Stage stage = getStage(); if (stage != null) { removeListener(focusListener); if (previousKeyboardFocus != null && previousKeyboardFocus.getStage() == null) previousKeyboardFocus = null; Actor actor = stage.getKeyboardFocus(); if (actor == null || actor.isDescendantOf(this)) stage.setKeyboardFocus(previousKeyboardFocus); if (previousScrollFocus != null && previousScrollFocus.getStage() == null) previousScrollFocus = null; actor = stage.getScrollFocus(); if (actor == null || actor.isDescendantOf(this)) stage.setScrollFocus(previousScrollFocus); } if (action != null) { addCaptureListener(ignoreTouchDown); addAction(sequence(action, Actions.removeListener(ignoreTouchDown, true), Actions.removeActor())); } else remove(); }
/** Removes the dialog from the stage, restoring the previous keyboard and scroll focus, and adds the specified action to the * dialog. * @param action If null, the dialog is removed immediately. Otherwise, the dialog is removed when the action completes. The * dialog will not respond to touch down events during the action. */ public void hide (Action action) { Stage stage = getStage(); if (stage != null) { removeListener(focusListener); if (previousKeyboardFocus != null && previousKeyboardFocus.getStage() == null) previousKeyboardFocus = null; Actor actor = stage.getKeyboardFocus(); if (actor == null || actor.isDescendantOf(this)) stage.setKeyboardFocus(previousKeyboardFocus); if (previousScrollFocus != null && previousScrollFocus.getStage() == null) previousScrollFocus = null; actor = stage.getScrollFocus(); if (actor == null || actor.isDescendantOf(this)) stage.setScrollFocus(previousScrollFocus); } if (action != null) { addCaptureListener(ignoreTouchDown); addAction(sequence(action, Actions.removeListener(ignoreTouchDown, true), Actions.removeActor())); } else remove(); }
if (actor != null && !actor.isDescendantOf(this)) previousScrollFocus = actor; stage.setScrollFocus(this);
if (actor != null && !actor.isDescendantOf(this)) previousScrollFocus = actor; stage.setScrollFocus(this);
@Override public void exit (InputEvent event, float x, float y, int pointer, Actor toActor) { super.exit(event, x, y, pointer, toActor); if (pointer == -1 && (toActor == null || toActor.isDescendantOf(owner) == false)) { clearCustomCursor(); } }
public void enter (InputEvent event, float x, float y, int pointer, Actor fromActor) { if (pointer != -1) return; if (Gdx.input.isTouched()) return; Actor actor = event.getListenerActor(); if (fromActor != null && fromActor.isDescendantOf(actor)) return; setContainerPosition(actor, x, y); manager.enter(this); }