com.threerings.opengl.gui
Class UserInterfaceWindow

java.lang.Object
  extended by com.threerings.opengl.gui.Component
      extended by com.threerings.opengl.gui.Container
          extended by com.threerings.opengl.gui.Window
              extended by com.threerings.opengl.gui.UserInterfaceWindow
All Implemented Interfaces:
ConfigUpdateListener<ManagedConfig>, Renderer.Observer, Comparable<Window>

public class UserInterfaceWindow
extends Window
implements Renderer.Observer

A window that contains a user interface.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.threerings.opengl.gui.Container
Container.ChildOp
 
Field Summary
protected  UserInterface _interface
          The contained user interface.
protected  DynamicScope _scope
          The window scope.
protected  boolean _stretch
          Whether or not to stretch the window across the entire display.
 
Fields inherited from class com.threerings.opengl.gui.Window
_layer, _modal, _parentWindow, _root, _savedFocus
 
Fields inherited from class com.threerings.opengl.gui.Container
_children, _layout
 
Fields inherited from class com.threerings.opengl.gui.Component
_alpha, _backgrounds, _borders, _colors, _ctx, _cursor, _enabled, _height, _hover, _hoverable, _insets, _listeners, _parent, _preferredSize, _properties, _rect, _styleConfigs, _tipmouse, _tiptext, _tooltipStyle, _transferHandler, _valid, _visible, _width, _x, _y, DEFAULT, DISABLED, HOVER, STATE_COUNT, STATE_PCLASSES
 
Constructor Summary
UserInterfaceWindow(GlContext ctx, boolean stretch)
          Creates a new user interface window.
UserInterfaceWindow(GlContext ctx, boolean stretch, ConfigReference<UserInterfaceConfig> ref)
          Creates a new user interface window.
UserInterfaceWindow(GlContext ctx, boolean stretch, String name)
          Creates a new interface window with the named configuration.
UserInterfaceWindow(GlContext ctx, boolean stretch, String name, String firstKey, Object firstValue, Object... otherArgs)
          Creates a new interface with the named configuration and arguments.
 
Method Summary
protected  UserInterface createInterface()
          Creates the user interface for the window.
 Component getComponent(String name)
          A shortcut method for retrieving a component registered by name from the interface.
 UserInterface getInterface()
          Returns a reference to the user interface component.
 DynamicScope getScope()
          Returns a reference to the window scope.
 void sizeChanged(int width, int height)
          Notes that the size of the renderer's drawable surface has changed.
protected  void wasAdded()
          This method is called when we are added to a hierarchy that is connected to a top-level window (at which point we can rely on having a look and feel and can set ourselves up).
protected  void wasRemoved()
          This method is called when we are removed from a hierarchy that is connected to a top-level window.
 
Methods inherited from class com.threerings.opengl.gui.Window
center, compareTo, dismiss, getDefaultStyleConfig, getLayer, getParentWindow, getRoot, gotFocus, invalidate, isAdded, isModal, isOverlay, pack, pack, requestFocus, setBounds, setLayer, setModal, setParent, setParentWindow, setRoot, shouldShadeBehind
 
Methods inherited from class com.threerings.opengl.gui.Container
add, add, add, add, applyOperation, computePreferredSize, getComponent, getComponentCount, getComponentIndex, getFirstDescendantFocus, getHitComponent, getLastDescendantFocus, getLayoutManager, getNextFocus, getPreviousFocus, layout, remove, remove, removeAll, renderComponent, replace, setAlpha, setEnabled, setHoverable, setLayoutManager, validate
 
Methods inherited from class com.threerings.opengl.gui.Component
acceptsFocus, addListener, boundsToString, changeCursor, configUpdated, contains, createDefaultTooltipComponent, createDefaultTooltipComponent, createTooltipComponent, dispatchEvent, emitEvent, getAbsoluteX, getAbsoluteY, getAlpha, getBackground, getBorder, getBounds, getColor, getContext, getCursor, getFallbackState, getFocusTarget, getHeight, getInsets, getNextFocus, getParent, getPreferredSize, getPreviousFocus, getProperty, getState, getStateCount, getStatePseudoClass, getStyleConfigs, getTooltipText, getTooltipTimeout, getTooltipWindowStyle, getTransferHandler, getWidth, getWindow, getX, getY, hasFocus, intersectScissor, isEnabled, isHoverable, isShowing, isTooltipRelativeToMouse, isValid, isVisible, removeAllListeners, removeAllListeners, removeListener, render, renderBackground, renderBorder, requestFocus, scrollRectToVisible, scrollRectToVisible, setBackground, setCursor, setLocation, setPreferredSize, setPreferredSize, setProperty, setSize, setStyleConfig, setStyleConfig, setStyleConfig, setStyleConfigs, setTooltipRelativeToMouse, setTooltipText, setTransferHandler, setVisible, stateDidChange, updateCursor, updateFromStyleConfig, updateFromStyleConfig
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_scope

protected DynamicScope _scope
The window scope.


_interface

protected UserInterface _interface
The contained user interface.


_stretch

protected boolean _stretch
Whether or not to stretch the window across the entire display.

Constructor Detail

UserInterfaceWindow

public UserInterfaceWindow(GlContext ctx,
                           boolean stretch)
Creates a new user interface window.

Parameters:
stretch - whether or not to stretch the window across the entire screen.

UserInterfaceWindow

public UserInterfaceWindow(GlContext ctx,
                           boolean stretch,
                           String name)
Creates a new interface window with the named configuration.

Parameters:
stretch - whether or not to stretch the window across the entire screen.

UserInterfaceWindow

public UserInterfaceWindow(GlContext ctx,
                           boolean stretch,
                           String name,
                           String firstKey,
                           Object firstValue,
                           Object... otherArgs)
Creates a new interface with the named configuration and arguments.

Parameters:
stretch - whether or not to stretch the window across the entire screen.

UserInterfaceWindow

public UserInterfaceWindow(GlContext ctx,
                           boolean stretch,
                           ConfigReference<UserInterfaceConfig> ref)
Creates a new user interface window.

Parameters:
stretch - whether or not to stretch the window across the entire screen.
Method Detail

getScope

public DynamicScope getScope()
Returns a reference to the window scope.


getInterface

public UserInterface getInterface()
Returns a reference to the user interface component.


getComponent

public Component getComponent(String name)
A shortcut method for retrieving a component registered by name from the interface.


sizeChanged

public void sizeChanged(int width,
                        int height)
Description copied from interface: Renderer.Observer
Notes that the size of the renderer's drawable surface has changed.

Specified by:
sizeChanged in interface Renderer.Observer

wasAdded

protected void wasAdded()
Description copied from class: Component
This method is called when we are added to a hierarchy that is connected to a top-level window (at which point we can rely on having a look and feel and can set ourselves up).

Overrides:
wasAdded in class Container

wasRemoved

protected void wasRemoved()
Description copied from class: Component
This method is called when we are removed from a hierarchy that is connected to a top-level window. If we wish to clean up after things done in Component.wasAdded(), this is a fine place to do so.

Overrides:
wasRemoved in class Container

createInterface

protected UserInterface createInterface()
Creates the user interface for the window.