jfreerails.client.view
Class ServerControlModel
java.lang.Object
jfreerails.client.view.ServerControlModel
- All Implemented Interfaces:
- ModelRootListener
public class ServerControlModel
- extends java.lang.Object
- implements ModelRootListener
Exposes the ServerControlInterface to client UI implementations.
- Author:
- rob, Luke, MystiqueAgent
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
loadGameAction
private final javax.swing.Action loadGameAction
modelRoot
private ModelRootImpl modelRoot
newGameAction
private final javax.swing.Action newGameAction
saveGameAction
private final javax.swing.Action saveGameAction
selectMapActions
private ActionAdapter selectMapActions
speedActions
private final ServerControlModel.SetTargetTicksPerSecondAction[] speedActions
targetTicksPerSecondActions
private final ActionAdapter targetTicksPerSecondActions
dbc
private DialogueBoxController dbc
ServerControlModel
public ServerControlModel(ModelRootImpl mr)
getGameSpeedDesc
public java.lang.String getGameSpeedDesc(int tickPerSecond)
- Returns human readable string description of
tickPerSecond
number. Looks for tickPerSecond
in
targetTicksPerSecondActions
. If appropriate action is not
found returns first greater value or the greatest value.
- Parameters:
tickPerSecond
- int
- Returns:
- String human readable description
getLoadGameAction
public javax.swing.Action getLoadGameAction()
- Returns:
- an action to load a game.
getMapNames
public ActionAdapter getMapNames()
- Returns:
- an ActionAdapter representing a list of actions representing
valid map names.
getNewGameAction
public javax.swing.Action getNewGameAction()
- When calling this action, set the action command string to the desired
map name, or call the appropriate selectMapAction.
- Returns:
- an action to start a new game
getSaveGameAction
public javax.swing.Action getSaveGameAction()
- Returns:
- an action to save a game TODO The action produces a file selector
dialog to save the game
getSetTargetTickPerSecondActions
public ActionAdapter getSetTargetTickPerSecondActions()
- Returns:
- an action adapter to set the target ticks per second
getTargetTicksPerSecond
public int getTargetTicksPerSecond()
propertyChange
public void propertyChange(ModelRoot.Property p,
java.lang.Object oldValue,
java.lang.Object newValue)
- Specified by:
propertyChange
in interface ModelRootListener
setup
public void setup(ModelRootImpl modelRoot,
DialogueBoxController dbc)
setServerControlInterface
public void setServerControlInterface()