| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrle.core.GameContextBase
public class GameContextBase
Basic implemention of GameContext.
| Field Summary | |
|---|---|
| protected  CommandSet | commandSet | 
| protected  java.util.HashSet<GameContextListener> | contextListeners | 
| protected  Board | currentBoard | 
| protected  java.lang.String | currentLanguage | 
| protected  Perspective | currentPerspective | 
| protected  Player | currentPlayer | 
| protected  InfoGroupView | data | 
| protected  GameClock | gameClock | 
| protected  GameThread | gameThread | 
| protected  MessageQueue | messageQueue | 
| protected  boolean | playing | 
| protected  javax.swing.RootPaneContainer | rootPaneContainer | 
| protected  SchemaBean | schema | 
| protected  Variant | variant | 
| protected  World | world | 
| Constructor Summary | |
|---|---|
| GameContextBase() | |
| Method Summary | |
|---|---|
|  void | addGameContextListener(GameContextListener cl)Register a listener for changes to the GameContext. | 
|  CommandSet | commandSet()Return the current command set. | 
|  PlugIn | createPlugIn(java.lang.String path)Create a Plug-in for key "plugindata" without explicitly lookup up the node designated by path. | 
|  PlugIn | createPlugIn(java.lang.String path,
             java.lang.String key)Create a Plug-in for a key without explicitly lookup up the node designated by path. | 
|  java.util.List<PlugIn> | createPlugIns(java.lang.String path)Create a Plug-in for key "plugindata" for each child node at path. | 
|  Board | currentBoard()The current board. | 
|  java.lang.String | currentLanguage()The current language. | 
|  Perspective | currentPerspective()The current Perspective. | 
|  Player | currentPlayer()The current player. | 
|  InfoGroupView | data()Returns a view of the root node of the Variant Manager data tree. | 
| protected  void | fireBoardChange(Board leaving,
                Board entering)Notify listeners that the board has changed. | 
| protected  void | fireCommandSetChange(CommandSet oldSet,
                     CommandSet newSet)Notify listeners that the CommandSet has changed. | 
| protected  void | fireLanguageChange()Notify listeners that the language has changed. | 
|  GameClock | gameClock()The game clock. | 
|  GameThread | gameThread() | 
|  boolean | isPlaying() | 
| protected  InfoGroupView | loadData(Variant variant)Create a root node from the data file for this variant. | 
|  MessageQueue | messageQueue()The message queue. | 
|  void | removeGameContextListener(GameContextListener cl)Remove a listener. | 
|  javax.swing.RootPaneContainer | rootPaneContainer()The JFrame/Frame/Applet window. | 
|  void | setCommandSet(CommandSet commandSet)Set the current command set. | 
|  void | setCurrentBoard(Board currentBoard)Changes the current board and fires a BoardChangeEvent. | 
|  void | setCurrentLanguage(java.lang.String currentLanguage)Changes the current language and fires a LanguageChangeEvent. | 
|  void | setCurrentPerspective(Perspective currentPerspective) | 
|  void | setCurrentPlayer(Player currentPlayer) | 
|  void | setGameClock(GameClock gameClock) | 
|  void | setGameThread(GameThread gt) | 
|  void | setMessageQueue(MessageQueue mq) | 
|  void | setPlaying(boolean b) | 
|  void | setRootPaneContainer(javax.swing.RootPaneContainer c) | 
|  void | setVariant(Variant variant) | 
|  void | setWorld(World world) | 
|  java.lang.String | translation(java.lang.String path)Convenience method to retrieve a translation at the given path for key "message". | 
|  java.lang.String | translation(java.lang.String path,
            java.lang.String key)Convenience method to retrieve a translation at the given path for the given key. | 
|  Variant | variant()Returns a view of the current Variant. | 
|  World | world()The world. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected javax.swing.RootPaneContainer rootPaneContainer
protected Variant variant
protected InfoGroupView data
protected SchemaBean schema
protected Board currentBoard
protected Player currentPlayer
protected Perspective currentPerspective
protected java.lang.String currentLanguage
protected GameClock gameClock
protected World world
protected CommandSet commandSet
protected MessageQueue messageQueue
protected GameThread gameThread
protected boolean playing
protected java.util.HashSet<GameContextListener> contextListeners
| Constructor Detail | 
|---|
public GameContextBase()
| Method Detail | 
|---|
public GameThread gameThread()
gameThread in interface GameContextpublic void setGameThread(GameThread gt)
public void setRootPaneContainer(javax.swing.RootPaneContainer c)
public javax.swing.RootPaneContainer rootPaneContainer()
GameContext
rootPaneContainer in interface GameContextpublic boolean isPlaying()
isPlaying in interface GameContextpublic void setPlaying(boolean b)
public void setVariant(Variant variant)
public Variant variant()
variant in interface GameContextprotected InfoGroupView loadData(Variant variant)
variant - 
public InfoGroupView data()
data in interface GameContextpublic Board currentBoard()
GameContext
currentBoard in interface GameContextpublic Player currentPlayer()
GameContext
currentPlayer in interface GameContextpublic Perspective currentPerspective()
GameContext
currentPerspective in interface GameContextpublic java.lang.String currentLanguage()
GameContext
currentLanguage in interface GameContextpublic GameClock gameClock()
GameContext
gameClock in interface GameContextpublic World world()
world in interface GameContextpublic MessageQueue messageQueue()
GameContext
messageQueue in interface GameContextpublic void setGameClock(GameClock gameClock)
public void setWorld(World world)
public void setCurrentBoard(Board currentBoard)
public void setCurrentLanguage(java.lang.String currentLanguage)
public void setCurrentPerspective(Perspective currentPerspective)
public void setCurrentPlayer(Player currentPlayer)
public void addGameContextListener(GameContextListener cl)
GameContext
addGameContextListener in interface GameContextpublic void removeGameContextListener(GameContextListener cl)
GameContext
removeGameContextListener in interface GameContextprotected void fireLanguageChange()
protected void fireBoardChange(Board leaving,
                               Board entering)
protected void fireCommandSetChange(CommandSet oldSet,
                                    CommandSet newSet)
public CommandSet commandSet()
commandSet in interface GameContextpublic void setCommandSet(CommandSet commandSet)
setCommandSet in interface GameContextpublic void setMessageQueue(MessageQueue mq)
public java.util.List<PlugIn> createPlugIns(java.lang.String path)
createPlugIns in interface GameContextpublic PlugIn createPlugIn(java.lang.String path)
createPlugIn in interface GameContext
public PlugIn createPlugIn(java.lang.String path,
                           java.lang.String key)
createPlugIn in interface GameContextpublic java.lang.String translation(java.lang.String path)
translation in interface GameContext
public java.lang.String translation(java.lang.String path,
                                    java.lang.String key)
translation in interface GameContext| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||