APIdia Launch Partner
Top Description Inners Constructors Methods
com.badlogic.gdx.scenes.scene2d.utils

public abstract Class FocusListener

extends Object
implements EventListener
Class Inheritance
All Implemented Interfaces
com.badlogic.gdx.scenes.scene2d.EventListener
Imports
com.badlogic.gdx.scenes.scene2d.Actor, .Event, .EventListener, com.badlogic.gdx.utils.Null

Listener for FocusEvent.
Author
Nathan Sweet

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
FocusListener.FocusEvent

Fired when an actor gains or loses keyboard or scroll focus.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
handle(Event event)

Implements com.badlogic.gdx.scenes.scene2d.EventListener.handle.

Try to handle the given event, if it is applicable.

public void
keyboardFocusChanged(FocusListener.FocusEvent event, Actor
The event target, which is the actor that emitted the focus event.
actor
,
boolean focused)

public void
scrollFocusChanged(FocusListener.FocusEvent event, Actor
The event target, which is the actor that emitted the focus event.
actor
,
boolean focused)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

FocusListenerback to summary
public FocusListener()

Method Detail

handleback to summary
public boolean handle(Event event)

Implements com.badlogic.gdx.scenes.scene2d.EventListener.handle.

Doc from com.badlogic.gdx.scenes.scene2d.EventListener.handle.

Try to handle the given event, if it is applicable.

keyboardFocusChangedback to summary
public void keyboardFocusChanged(FocusListener.FocusEvent event, Actor actor, boolean focused)
Parameters
actor:Actor

The event target, which is the actor that emitted the focus event.

scrollFocusChangedback to summary
public void scrollFocusChanged(FocusListener.FocusEvent event, Actor actor, boolean focused)
Parameters
actor:Actor

The event target, which is the actor that emitted the focus event.

com.badlogic.gdx.scenes.scene2d.utils back to summary

public Class FocusListener.FocusEvent

extends Event
Class Inheritance

Fired when an actor gains or loses keyboard or scroll focus. Can be cancelled to prevent losing or gaining focus.
Author
Nathan Sweet

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum

Field Summary

Modifier and TypeField and Description
private boolean
private Actor
private FocusListener.FocusEvent.Type

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Actor
getRelatedActor()

The actor related to the event.

public FocusListener.FocusEvent.Type
public boolean
public void
public void
setFocused(boolean focused)

public void
setRelatedActor(Actor
May be null.
relatedActor
)

public void
Inherited from com.badlogic.gdx.scenes.scene2d.Event:
cancelgetBubblesgetListenerActorgetStagegetTargethandleisCancelledisCaptureisHandledisStoppedsetBubblessetCapturesetListenerActorsetStagesetTargetstop

Field Detail

focusedback to summary
private boolean focused
relatedActorback to summary
private Actor relatedActor
typeback to summary
private FocusListener.FocusEvent.Type type

Constructor Detail

FocusEventback to summary
public FocusEvent()

Method Detail

getRelatedActorback to summary
public Actor getRelatedActor()

The actor related to the event. When focus is lost, this is the new actor being focused, or null. When focus is gained, this is the previous actor that was focused, or null.

Annotations
@Null
getTypeback to summary
public FocusListener.FocusEvent.Type getType()
isFocusedback to summary
public boolean isFocused()
resetback to summary
public void reset()

Overrides com.badlogic.gdx.scenes.scene2d.Event.reset.

Implements com.badlogic.gdx.utils.Pool.Poolable.reset.

Doc from com.badlogic.gdx.utils.Pool.Poolable.reset.

Resets the object for reuse. Object references should be nulled and fields may be set to default values.

setFocusedback to summary
public void setFocused(boolean focused)
setRelatedActorback to summary
public void setRelatedActor(Actor relatedActor)
Parameters
relatedActor:Actor

May be null.

setTypeback to summary
public void setType(FocusListener.FocusEvent.Type focusType)
com.badlogic.gdx.scenes.scene2d.utils back to summary

public final Enum FocusListener.FocusEvent.Type

extends Enum<FocusListener.FocusEvent.Type>
Class Inheritance

Author
Nathan Sweet

Field Summary

Modifier and TypeField and Description
public static final FocusListener.FocusEvent.Type
public static final FocusListener.FocusEvent.Type

Constructor Summary

AccessConstructor and Description
private
Type()

Field Detail

keyboardback to summary
public static final FocusListener.FocusEvent.Type keyboard
scrollback to summary
public static final FocusListener.FocusEvent.Type scroll

Constructor Detail

Typeback to summary
private Type()

Method Detail

valueOfback to summary
public static FocusListener.FocusEvent.Type valueOf(String name)
valuesback to summary
public static FocusListener.FocusEvent.Type[] values()