com.threerings.parlor.game.client
Class SwingGameConfigurator

java.lang.Object
  extended by com.threerings.parlor.game.client.GameConfigurator
      extended by com.threerings.parlor.game.client.SwingGameConfigurator

public abstract class SwingGameConfigurator
extends GameConfigurator

Provides the base from which interfaces can be built to configure games prior to starting them. Derived classes would extend the base configurator adding interface elements and wiring them up properly to allow the user to configure an instance of their game.

Clients that use the game configurator will want to instantiate one based on the class returned from the GameConfig and then initialize it with a call to GameConfigurator.init(com.threerings.parlor.util.ParlorContext).


Field Summary
protected  Insets _controlInsets
          Insets for configuration controls.
protected  Insets _labelInsets
          Insets for configuration labels.
protected  JPanel _panel
          The panel on which the config options are placed.
 
Fields inherited from class com.threerings.parlor.game.client.GameConfigurator
_config, _ctx
 
Constructor Summary
SwingGameConfigurator()
           
 
Method Summary
 void addControl(JComponent label, JComponent control)
          Add a control to the interface.
 void addWideControl(JComponent control)
          Add a control to the interface.
 JPanel getPanel()
          Get the Swing JPanel that contains the UI elements for this configurator.
 
Methods inherited from class com.threerings.parlor.game.client.GameConfigurator
createConfigInterface, flushGameConfig, getGameConfig, gotGameConfig, init, setGameConfig
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_panel

protected JPanel _panel
The panel on which the config options are placed.


_labelInsets

protected Insets _labelInsets
Insets for configuration labels.


_controlInsets

protected Insets _controlInsets
Insets for configuration controls.

Constructor Detail

SwingGameConfigurator

public SwingGameConfigurator()
Method Detail

getPanel

public JPanel getPanel()
Get the Swing JPanel that contains the UI elements for this configurator.


addControl

public void addControl(JComponent label,
                       JComponent control)
Add a control to the interface. This should be the standard way that configurator controls are added, but note also that external entities may add their own controls that are related to the game, but do not directly alter the game config, so that all the controls are added in a uniform manner and are well aligned.


addWideControl

public void addWideControl(JComponent control)
Add a control to the interface. This should be the standard way that configurator controls are added, but note also that external entities may add their own controls that are related to the game, but do not directly alter the game config, so that all the controls are added in a uniform manner and are well aligned. This version adds a single component spanning the entire width.