rails.ui.swing
Class ORUIManager

java.lang.Object
  extended by rails.ui.swing.ORUIManager
All Implemented Interfaces:
DialogOwner
Direct Known Subclasses:
ORUIManager_18AL

public class ORUIManager
extends java.lang.Object
implements DialogOwner


Field Summary
 java.util.List<LayTile> allowedTileLays
           
 java.util.List<LayToken> allowedTokenLays
           
static int CONFIRM_TOKEN
           
 GameUIManager gameUIManager
           
static int INACTIVE
           
protected  boolean localAction
          Will be set true if a cancelled action does not need to be reported to the server, because it does not change the OR turn step.
protected static org.apache.log4j.Logger log
           
static int MAP_CORRECTION
           
 java.util.List<PossibleAction> mapRelatedActions
           
protected static java.lang.String[] messageKey
           
protected  ORPanel orPanel
           
protected  ORWindow orWindow
           
protected  PossibleActions possibleActions
           
static int ROTATE_OR_CONFIRM_TILE
           
static int SELECT_HEX_FOR_TILE
           
static int SELECT_HEX_FOR_TOKEN
           
static int SELECT_PAYOUT
           
static int SELECT_TILE
           
static int SELECT_TOKEN
           
static int SET_REVENUE
           
protected  TileManager tileManager
           
 java.util.List<TileI> tileUpgrades
           
 java.util.List<? extends TokenI> tokenLays
           
 
Constructor Summary
ORUIManager()
           
 
Method Summary
 void addDetail(java.lang.String detailText)
           
 void addInformation(java.lang.String infoText)
           
 void buyPrivate()
           
 void buyTrain()
           
 void cancelUpgrade()
           
protected  void checkForGameSpecificActions()
          Stub, can be overridden by game-specific subclasses
protected  void checkORCompanySequence(PublicCompanyI[] oldCompanies, java.util.List<PublicCompanyI> newCompanies)
          Redraw the ORPanel if the company operating order has changed
 void dialogActionPerformed()
           
 void executeUpgrade()
           
 void finish()
           
 javax.swing.JDialog getCurrentDialog()
           
 PossibleAction getCurrentDialogAction()
           
 GameUIManager getGameUIManager()
           
 HexMap getMap()
           
 MapPanel getMapPanel()
           
 ORWindow getORWindow()
           
 TileManager getTileManager()
           
 void hexClicked(GUIHex clickedHex, GUIHex selectedHex)
           
 void init(ORWindow orWindow)
           
 void initOR(OperatingRound or)
           
protected  boolean isUnconnectedTileLayTarget(GUIHex hex)
           
 void layBaseToken(LayBaseToken action)
           
 void layBonusToken(PossibleAction action)
          Lay Token finished.
 void operatingCosts()
           
 void processAction(java.lang.String command, java.util.List<PossibleAction> actions)
          Processes button presses and menu selection actions
protected  void processCorrectionAction(CorrectionAction action)
           
protected  boolean processGameSpecificActions(java.util.List<PossibleAction> actions)
          Stub, can be overridden in subclasses
protected  void reachDestinations(ReachDestinations action)
           
protected  void relayBaseTokens(LayTile action)
          Manually relay the tokens.
protected  void repayLoans(RepayLoans action)
           
 void setCurrentDialog(javax.swing.JDialog dialog, PossibleAction action)
           
 void setGameUIManager(GameUIManager gameUIManager)
           
 void setLocalAction(boolean value)
           
 void setLocalStep(int localStep)
           
<T extends PossibleAction>
void
setMapRelatedActions(java.util.List<T> actions)
           
 void setMessage(java.lang.String message)
           
 void setORCompanyTurn(int orCompIndex)
           
protected  void takeLoans(TakeLoans action)
          Default implementation.
 void tileSelected(int tileId)
           
 void tokenSelected(LayToken tokenAllowance)
           
 void updateMessage()
           
 void updateStatus(boolean myTurn)
           
 void updateStatus(PossibleAction actionToComplete, boolean myTurn)
           
 void updateUpgradesPanel()
           
 void updateUpgradesPanel(MapCorrectionAction action)
           
protected  void useSpecialProperty(UseSpecialProperty action)
          Used to process some special properties from the 'Special' menu
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

orWindow

protected ORWindow orWindow

orPanel

protected ORPanel orPanel

gameUIManager

public GameUIManager gameUIManager

tileManager

protected TileManager tileManager

possibleActions

protected PossibleActions possibleActions

mapRelatedActions

public java.util.List<PossibleAction> mapRelatedActions

allowedTileLays

public java.util.List<LayTile> allowedTileLays

tileUpgrades

public java.util.List<TileI> tileUpgrades

allowedTokenLays

public java.util.List<LayToken> allowedTokenLays

tokenLays

public java.util.List<? extends TokenI> tokenLays

localAction

protected boolean localAction
Will be set true if a cancelled action does not need to be reported to the server, because it does not change the OR turn step. For instance, if a bonus token lay is locally initiated but cancelled.


INACTIVE

public static final int INACTIVE
See Also:
Constant Field Values

SELECT_HEX_FOR_TILE

public static final int SELECT_HEX_FOR_TILE
See Also:
Constant Field Values

SELECT_TILE

public static final int SELECT_TILE
See Also:
Constant Field Values

ROTATE_OR_CONFIRM_TILE

public static final int ROTATE_OR_CONFIRM_TILE
See Also:
Constant Field Values

SELECT_HEX_FOR_TOKEN

public static final int SELECT_HEX_FOR_TOKEN
See Also:
Constant Field Values

SELECT_TOKEN

public static final int SELECT_TOKEN
See Also:
Constant Field Values

CONFIRM_TOKEN

public static final int CONFIRM_TOKEN
See Also:
Constant Field Values

SET_REVENUE

public static final int SET_REVENUE
See Also:
Constant Field Values

SELECT_PAYOUT

public static final int SELECT_PAYOUT
See Also:
Constant Field Values

MAP_CORRECTION

public static final int MAP_CORRECTION
See Also:
Constant Field Values

messageKey

protected static final java.lang.String[] messageKey

log

protected static org.apache.log4j.Logger log
Constructor Detail

ORUIManager

public ORUIManager()
Method Detail

setGameUIManager

public void setGameUIManager(GameUIManager gameUIManager)

init

public void init(ORWindow orWindow)

initOR

public void initOR(OperatingRound or)

finish

public void finish()

setMapRelatedActions

public <T extends PossibleAction> void setMapRelatedActions(java.util.List<T> actions)

updateMessage

public void updateMessage()

processAction

public void processAction(java.lang.String command,
                          java.util.List<PossibleAction> actions)
Processes button presses and menu selection actions

Parameters:
command -
actions -

processGameSpecificActions

protected boolean processGameSpecificActions(java.util.List<PossibleAction> actions)
Stub, can be overridden in subclasses


reachDestinations

protected void reachDestinations(ReachDestinations action)

dialogActionPerformed

public void dialogActionPerformed()
Specified by:
dialogActionPerformed in interface DialogOwner

getCurrentDialog

public javax.swing.JDialog getCurrentDialog()
Specified by:
getCurrentDialog in interface DialogOwner

getCurrentDialogAction

public PossibleAction getCurrentDialogAction()
Specified by:
getCurrentDialogAction in interface DialogOwner

setCurrentDialog

public void setCurrentDialog(javax.swing.JDialog dialog,
                             PossibleAction action)
Specified by:
setCurrentDialog in interface DialogOwner

hexClicked

public void hexClicked(GUIHex clickedHex,
                       GUIHex selectedHex)

tileSelected

public void tileSelected(int tileId)

isUnconnectedTileLayTarget

protected boolean isUnconnectedTileLayTarget(GUIHex hex)

tokenSelected

public void tokenSelected(LayToken tokenAllowance)

layBaseToken

public void layBaseToken(LayBaseToken action)

relayBaseTokens

protected void relayBaseTokens(LayTile action)
Manually relay the tokens. This is only needed in special cases, such as the 1830 Erie home token. If applicable, the TileSet entry for the old tile should specify relayBaseTokens="yes" as an attribute in the Upgrade tag.

Parameters:
action - The LayTile PossibleAction.

layBonusToken

public void layBonusToken(PossibleAction action)
Lay Token finished.

Parameters:
action - The LayBonusToken action object of the laid token.

operatingCosts

public void operatingCosts()

buyTrain

public void buyTrain()

buyPrivate

public void buyPrivate()

executeUpgrade

public void executeUpgrade()

cancelUpgrade

public void cancelUpgrade()

takeLoans

protected void takeLoans(TakeLoans action)
Default implementation. The <Loans> attributes number and value must have been configured in CompanyManager.xml


repayLoans

protected void repayLoans(RepayLoans action)

useSpecialProperty

protected void useSpecialProperty(UseSpecialProperty action)
Used to process some special properties from the 'Special' menu


processCorrectionAction

protected void processCorrectionAction(CorrectionAction action)

updateStatus

public void updateStatus(boolean myTurn)

updateStatus

public void updateStatus(PossibleAction actionToComplete,
                         boolean myTurn)

checkForGameSpecificActions

protected void checkForGameSpecificActions()
Stub, can be overridden by game-specific subclasses


checkORCompanySequence

protected void checkORCompanySequence(PublicCompanyI[] oldCompanies,
                                      java.util.List<PublicCompanyI> newCompanies)
Redraw the ORPanel if the company operating order has changed


setORCompanyTurn

public void setORCompanyTurn(int orCompIndex)

setLocalStep

public void setLocalStep(int localStep)

updateUpgradesPanel

public void updateUpgradesPanel()

updateUpgradesPanel

public void updateUpgradesPanel(MapCorrectionAction action)

setMessage

public void setMessage(java.lang.String message)

addInformation

public void addInformation(java.lang.String infoText)

addDetail

public void addDetail(java.lang.String detailText)

setLocalAction

public void setLocalAction(boolean value)

getORWindow

public ORWindow getORWindow()

getMapPanel

public MapPanel getMapPanel()

getMap

public HexMap getMap()

getGameUIManager

public GameUIManager getGameUIManager()

getTileManager

public TileManager getTileManager()