Package com.simsilica.lemur.core
Class GuiControl
- All Implemented Interfaces:
Savable,Control,JmeCloneable,FocusTarget,FocusTraversal,Cloneable
public class GuiControl
extends AbstractNodeControl<GuiControl>
implements FocusTarget, FocusTraversal
Manages a component stack, the parent/child relationship, and other
standard GuiControl functionality.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.simsilica.lemur.focus.FocusTraversal
FocusTraversal.TraversalDirection -
Field Summary
Fields inherited from class com.jme3.scene.control.AbstractControl
enabled, spatial -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends GuiComponent>
TaddComponent(T c) voidvoidvoidprotected voidattach()protected voidcontrolUpdate(float tpf) To be implemented in subclass.protected voiddetach()voidNotifies this focus target that is has gained focus.voidNotifies this focus target that is has lost focus.<T extends GuiComponent>
TgetComponent(String key) intReturns the focusable element that should receive focus when first entering this container level.<T extends GuiLayout>
TgetNode()getRelativeFocus(Spatial from, FocusTraversal.TraversalDirection direction) Returns the relative focusable element from the specified element in the specified direction as defined by this focus container's implementation of that direction's policy.getSize()protected booleanvoidprotected booleanisChild()booleanReturns true if this control is focusable, either because one of its child components/layout is focusable or because setFocusable(true) was called.booleanReturns true if this focus target currently has the focus.booleanReturns true if this is the root of a focus container hierarchy and navigation should not be permitted out of the container.boolean<T extends GuiComponent>
TremoveComponent(String key) voidvoidvoidprotected void<T extends GuiComponent>
TsetComponent(String key, T component) Sets a new component to the specified layer and returns THAT component, not the previous value.voidsetFocusable(boolean b) Sets the focusable state to true for this control even if none of the child components are focusable.voidsetLayerOrder(String... layers) voidvoidsetPreferredSize(Vector3f pref) voidMethods inherited from class com.simsilica.lemur.core.AbstractNodeControl
controlRender, setSpatialMethods inherited from class com.jme3.scene.control.AbstractControl
cloneFields, cloneForSpatial, getSpatial, isEnabled, jmeClone, read, render, setEnabled, update, write
-
Constructor Details
-
GuiControl
-
GuiControl
-
-
Method Details
-
getNode
- Overrides:
getNodein classAbstractNodeControl<GuiControl>
-
addListener
-
removeListener
-
addFocusChangeListener
-
removeFocusChangeListener
-
addUpdateListener
-
removeUpdateListener
-
isFocused
public boolean isFocused()Description copied from interface:FocusTargetReturns true if this focus target currently has the focus.- Specified by:
isFocusedin interfaceFocusTarget
-
setFocusable
public void setFocusable(boolean b) Sets the focusable state to true for this control even if none of the child components are focusable. -
isFocusable
public boolean isFocusable()Returns true if this control is focusable, either because one of its child components/layout is focusable or because setFocusable(true) was called.- Specified by:
isFocusablein interfaceFocusTarget
-
focusGained
public void focusGained()Description copied from interface:FocusTargetNotifies this focus target that is has gained focus.- Specified by:
focusGainedin interfaceFocusTarget
-
focusLost
public void focusLost()Description copied from interface:FocusTargetNotifies this focus target that is has lost focus.- Specified by:
focusLostin interfaceFocusTarget
-
getDefaultFocus
Description copied from interface:FocusTraversalReturns the focusable element that should receive focus when first entering this container level.- Specified by:
getDefaultFocusin interfaceFocusTraversal
-
getRelativeFocus
Description copied from interface:FocusTraversalReturns the relative focusable element from the specified element in the specified direction as defined by this focus container's implementation of that direction's policy.- Specified by:
getRelativeFocusin interfaceFocusTraversal
-
isFocusRoot
public boolean isFocusRoot()Description copied from interface:FocusTraversalReturns true if this is the root of a focus container hierarchy and navigation should not be permitted out of the container. This is commonly used for root-level windows are any container where the user must initiate a specific action to change contexts.- Specified by:
isFocusRootin interfaceFocusTraversal
-
setLayerOrder
-
setLayout
-
getLayout
-
setPreferredSize
-
getPreferredSize
-
setSize
-
getSize
-
getComponents
-
addComponent
-
getComponentIndex
-
setComponent
Sets a new component to the specified layer and returns THAT component, not the previous value. This is so that it works like addComponent() in that you can set it and grab it at the same time. -
getComponent
-
removeComponent
-
removeComponent
-
attach
protected void attach()- Specified by:
attachin classAbstractNodeControl<GuiControl>
-
controlUpdate
protected void controlUpdate(float tpf) Description copied from class:AbstractControlTo be implemented in subclass.- Overrides:
controlUpdatein classAbstractNodeControl<GuiControl>- Parameters:
tpf- time per frame (in seconds)
-
hasParent
protected boolean hasParent() -
isChild
protected boolean isChild() -
revalidate
protected void revalidate() -
invalidate
public void invalidate() -
detach
protected void detach()- Specified by:
detachin classAbstractNodeControl<GuiControl>
-