|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.opengl.gui.Component
com.threerings.opengl.gui.Container
com.threerings.opengl.gui.UserInterface
public class UserInterface
A user interface component configured from a resource.
| Field Summary |
|---|
| Fields inherited from class com.threerings.opengl.gui.Component |
|---|
DEFAULT, DISABLED, HOVER |
| Constructor Summary | |
|---|---|
UserInterface(GlContext ctx)
Creates a new user interface. |
|
UserInterface(GlContext ctx,
ConfigReference<UserInterfaceConfig> ref)
Creates a new interface with the referenced configuration. |
|
UserInterface(GlContext ctx,
String name)
Creates a new interface with the named configuration. |
|
UserInterface(GlContext ctx,
String name,
String firstKey,
Object firstValue,
Object... otherArgs)
Creates a new interface with the named configuration and arguments. |
|
UserInterface(GlContext ctx,
UserInterfaceConfig config)
Creates a new interface with the given configuration. |
|
| Method Summary | ||
|---|---|---|
void |
addListener(String tag,
ComponentListener listener)
Shortcut method to add a listener to all components with the specified tag. |
|
void |
configUpdated(ConfigEvent<ManagedConfig> event)
Called when a configuration has been updated. |
|
Component |
getComponent(String tag)
Returns a reference to the first component registered with the specified tag, or null if there are no such components. |
|
|
getComponent(String tag,
Class<C> clazz)
Returns a reference to the first component registered with the specified tag and implementing the specified class or interface, or null if there are
no such components. |
|
Iterable<Component> |
getComponents(String tag)
Returns the Components registered with the specified tag. |
|
|
getComponents(String tag,
Class<C> clazz)
Returns the Components registered with the specified tag. |
|
UserInterfaceConfig |
getConfig()
Returns a reference to the configuration. |
|
DynamicScope |
getScope()
Returns a reference to the interface's scope. |
|
Map<String,Collection<Component>> |
getTagged()
Returns a reference to the tagged component map. |
|
String |
getText(String tag)
Shortcut method for retrieving the text of a tagged TextComponent. |
|
boolean |
isSelected(String tag)
Shortcut method for retrieving the selected state of a tagged ToggleButton. |
|
void |
removeAllListeners(String tag)
Shortcut method to remove all listeners from all components with the specified tag. |
|
void |
removeListener(String tag,
ComponentListener listener)
Shortcut method to remove a listener from all components with the specified tag. |
|
boolean |
replace(String tag,
Component newc)
Replaces the component at the tag with a new component. |
|
void |
setConfig(ConfigReference<UserInterfaceConfig> ref)
Sets the configuration. |
|
void |
setConfig(String name)
Sets the configuration. |
|
void |
setConfig(String name,
String firstKey,
Object firstValue,
Object... otherArgs)
Sets the configuration. |
|
void |
setConfig(UserInterfaceConfig config)
Sets the configuration. |
|
void |
setEnabled(String tag,
boolean enabled)
Shortcut method for setting the enabled status of all components bearing the specified tag. |
|
void |
setText(String tag,
String text)
Shortcut method for setting the text of all TextComponents bearing the specified
tag. |
|
void |
setVisible(String tag,
boolean visible)
Shortcut method for setting the visibility status of all components bearing the specified tag. |
|
| Methods inherited from class com.threerings.opengl.gui.Container |
|---|
add, add, add, add, getComponent, getComponentCount, getComponentIndex, getHitComponent, getLayoutManager, remove, remove, removeAll, replace, setAlpha, setEnabled, setHoverable, setLayoutManager, validate |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UserInterface(GlContext ctx)
public UserInterface(GlContext ctx,
String name)
public UserInterface(GlContext ctx,
String name,
String firstKey,
Object firstValue,
Object... otherArgs)
public UserInterface(GlContext ctx,
ConfigReference<UserInterfaceConfig> ref)
public UserInterface(GlContext ctx,
UserInterfaceConfig config)
| Method Detail |
|---|
public DynamicScope getScope()
public void setConfig(String name)
public void setConfig(ConfigReference<UserInterfaceConfig> ref)
public void setConfig(String name,
String firstKey,
Object firstValue,
Object... otherArgs)
public void setConfig(UserInterfaceConfig config)
public UserInterfaceConfig getConfig()
public void setEnabled(String tag,
boolean enabled)
public void setVisible(String tag,
boolean visible)
public void setText(String tag,
String text)
TextComponents bearing the specified
tag.
public String getText(String tag)
TextComponent.
public boolean isSelected(String tag)
ToggleButton.
public void addListener(String tag,
ComponentListener listener)
public void removeListener(String tag,
ComponentListener listener)
public void removeAllListeners(String tag)
public Component getComponent(String tag)
null if there are no such components.
public <C extends Component> C getComponent(String tag,
Class<C> clazz)
null if there are
no such components.
public <C extends Component> Iterable<C> getComponents(String tag,
Class<C> clazz)
public Iterable<Component> getComponents(String tag)
public Map<String,Collection<Component>> getTagged()
public boolean replace(String tag,
Component newc)
public void configUpdated(ConfigEvent<ManagedConfig> event)
ConfigUpdateListener
configUpdated in interface ConfigUpdateListener<ManagedConfig>configUpdated in class Component
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||