public class GuiControl extends AbstractNodeControl<GuiControl> implements FocusTarget, FocusTraversal
FocusTraversal.TraversalDirection
Constructor and Description |
---|
GuiControl(GuiComponent... components) |
GuiControl(java.lang.String... layerOrder) |
Modifier and Type | Method and Description |
---|---|
<T extends GuiComponent> |
addComponent(T c) |
void |
addFocusChangeListener(FocusChangeListener l) |
void |
addListener(GuiControlListener l) |
void |
addUpdateListener(GuiUpdateListener l) |
protected void |
attach() |
protected void |
controlUpdate(float tpf) |
protected void |
detach() |
void |
focusGained()
Notifies this focus target that is has gained focus.
|
void |
focusLost()
Notifies this focus target that is has lost focus.
|
<T extends GuiComponent> |
getComponent(java.lang.String key) |
int |
getComponentIndex(GuiComponent c) |
java.util.List<GuiComponent> |
getComponents() |
com.jme3.scene.Spatial |
getDefaultFocus()
Returns the focusable element that should receive focus when first
entering this container level.
|
<T extends GuiLayout> |
getLayout() |
com.jme3.scene.Node |
getNode() |
com.jme3.math.Vector3f |
getPreferredSize() |
com.jme3.scene.Spatial |
getRelativeFocus(com.jme3.scene.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.
|
com.jme3.math.Vector3f |
getSize() |
protected boolean |
hasParent() |
void |
invalidate() |
protected boolean |
isChild() |
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.
|
boolean |
isFocused()
Returns true if this focus target currently has the focus.
|
boolean |
isFocusRoot()
Returns true if this is the root of a focus container hierarchy and
navigation should not be permitted out of the container.
|
boolean |
removeComponent(GuiComponent c) |
<T extends GuiComponent> |
removeComponent(java.lang.String key) |
void |
removeFocusChangeListener(FocusChangeListener l) |
void |
removeListener(GuiControlListener l) |
void |
removeUpdateListener(GuiUpdateListener l) |
protected void |
revalidate() |
<T extends GuiComponent> |
setComponent(java.lang.String key,
T component)
Sets a new component to the specified layer and returns THAT component,
not the previous value.
|
void |
setFocusable(boolean b)
Sets the focusable state to true for this control even
if none of the child components are focusable.
|
void |
setLayerOrder(java.lang.String... layers) |
void |
setLayout(GuiLayout l) |
void |
setPreferredSize(com.jme3.math.Vector3f pref) |
void |
setSize(com.jme3.math.Vector3f size) |
controlRender, setSpatial
public GuiControl(GuiComponent... components)
public GuiControl(java.lang.String... layerOrder)
public com.jme3.scene.Node getNode()
getNode
in class AbstractNodeControl<GuiControl>
public void addListener(GuiControlListener l)
public void removeListener(GuiControlListener l)
public void addFocusChangeListener(FocusChangeListener l)
public void removeFocusChangeListener(FocusChangeListener l)
public void addUpdateListener(GuiUpdateListener l)
public void removeUpdateListener(GuiUpdateListener l)
public boolean isFocused()
FocusTarget
isFocused
in interface FocusTarget
public void setFocusable(boolean b)
public boolean isFocusable()
isFocusable
in interface FocusTarget
public void focusGained()
FocusTarget
focusGained
in interface FocusTarget
public void focusLost()
FocusTarget
focusLost
in interface FocusTarget
public com.jme3.scene.Spatial getDefaultFocus()
FocusTraversal
getDefaultFocus
in interface FocusTraversal
public com.jme3.scene.Spatial getRelativeFocus(com.jme3.scene.Spatial from, FocusTraversal.TraversalDirection direction)
FocusTraversal
getRelativeFocus
in interface FocusTraversal
public boolean isFocusRoot()
FocusTraversal
isFocusRoot
in interface FocusTraversal
public void setLayerOrder(java.lang.String... layers)
public void setLayout(GuiLayout l)
public <T extends GuiLayout> T getLayout()
public void setPreferredSize(com.jme3.math.Vector3f pref)
public com.jme3.math.Vector3f getPreferredSize()
public void setSize(com.jme3.math.Vector3f size)
public com.jme3.math.Vector3f getSize()
public java.util.List<GuiComponent> getComponents()
public <T extends GuiComponent> T addComponent(T c)
public int getComponentIndex(GuiComponent c)
public <T extends GuiComponent> T setComponent(java.lang.String key, T component)
public <T extends GuiComponent> T getComponent(java.lang.String key)
public <T extends GuiComponent> T removeComponent(java.lang.String key)
public boolean removeComponent(GuiComponent c)
protected void attach()
attach
in class AbstractNodeControl<GuiControl>
protected void controlUpdate(float tpf)
controlUpdate
in class AbstractNodeControl<GuiControl>
protected boolean hasParent()
protected boolean isChild()
protected void revalidate()
public void invalidate()
protected void detach()
detach
in class AbstractNodeControl<GuiControl>