rails.ui.swing
Class ORPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by rails.ui.swing.GridPanel
                      extended by rails.ui.swing.ORPanel
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.KeyListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, RevenueListener

public class ORPanel
extends GridPanel
implements java.awt.event.ActionListener, java.awt.event.KeyListener, RevenueListener

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class rails.ui.swing.GridPanel
GridPanel.RowVisibility
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static java.lang.String BUY_PRIVATE_CMD
           
static java.lang.String BUY_TRAIN_CMD
           
protected static org.apache.log4j.Logger log
           
static java.lang.String OPERATING_COST_CMD
           
(package private)  ORUIManager orUIManager
           
(package private)  ORWindow orWindow
           
static java.lang.String PAYOUT_CMD
           
static java.lang.String REM_TILES_CMD
           
static java.lang.String REPAY_LOANS_CMD
           
static java.lang.String SET_REVENUE_CMD
           
static java.lang.String TAKE_LOANS_CMD
           
 
Fields inherited from class rails.ui.swing.GridPanel
buttonHighlight, c, companies, f, fields, gb, gbc, gridPanel, menuItemsToReset, NARROW_GAP, nc, np, observers, parentFrame, players, round, rowVisibilityObservers, WIDE_BOTTOM, WIDE_GAP, WIDE_LEFT, WIDE_RIGHT, WIDE_TOP
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ORPanel(ORWindow parent, ORUIManager orUIManager)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent actor)
           
protected  void addCompanyInfo()
           
protected  void addNetworkInfo()
           
protected  void addPhasesInfo()
           
 void addSpecialAction(PossibleAction action, java.lang.String text)
           
protected  void addTrainsInfo()
           
 void enableDone(NullAction action)
           
 void enableLoanRepayment(RepayLoans action)
           
 void enableLoanTaking(TakeLoans action)
           
 void enableRedo(GameAction action)
           
 void enableUndo(GameAction action)
           
protected  void executeNetworkInfo(java.lang.String companyName)
           
 void finish()
           
 void finishORCompanyTurn(int orCompIndex)
           
 PublicCompanyI[] getOperatingCompanies()
           
 PublicCompanyI getORComp()
           
 java.lang.String getORPlayer()
           
 int getRevenue(int orCompIndex)
           
 void initOperatingCosts(boolean enabled)
           
 void initORCompanyTurn(PublicCompanyI orComp, int orCompIndex)
           
 void initPayoutStep(int orCompIndex, SetDividend action, boolean withhold, boolean split, boolean payout)
           
 void initPrivateBuying(boolean enabled)
           
 void initRevenueEntryStep(int orCompIndex, SetDividend action)
           
 void initSpecialActions()
           
 void initTileLayingStep()
           
 void initTokenLayingStep()
           
 void initTrainBuying(boolean enabled)
           
 void recreate(OperatingRound or)
           
 void resetActions()
           
 void resetCurrentRevenueDisplay()
           
 void resetORCompanyTurn(int orCompIndex)
           
 void revenueUpdate(int bestRevenue, boolean finalResult)
           
 void setRevenue(int orCompIndex, int amount)
           
 void stopRevenueUpdate()
           
 
Methods inherited from class rails.ui.swing.GridPanel
addField, addField, deRegisterObservers, keyPressed, keyReleased, keyTyped, redisplay, setRowVisibility
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.event.KeyListener
keyPressed, keyReleased, keyTyped
 

Field Detail

OPERATING_COST_CMD

public static final java.lang.String OPERATING_COST_CMD
See Also:
Constant Field Values

BUY_PRIVATE_CMD

public static final java.lang.String BUY_PRIVATE_CMD
See Also:
Constant Field Values

BUY_TRAIN_CMD

public static final java.lang.String BUY_TRAIN_CMD
See Also:
Constant Field Values

PAYOUT_CMD

public static final java.lang.String PAYOUT_CMD
See Also:
Constant Field Values

SET_REVENUE_CMD

public static final java.lang.String SET_REVENUE_CMD
See Also:
Constant Field Values

REM_TILES_CMD

public static final java.lang.String REM_TILES_CMD
See Also:
Constant Field Values

TAKE_LOANS_CMD

public static final java.lang.String TAKE_LOANS_CMD
See Also:
Constant Field Values

REPAY_LOANS_CMD

public static final java.lang.String REPAY_LOANS_CMD
See Also:
Constant Field Values

orWindow

ORWindow orWindow

orUIManager

ORUIManager orUIManager

log

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

ORPanel

public ORPanel(ORWindow parent,
               ORUIManager orUIManager)
Method Detail

recreate

public void recreate(OperatingRound or)

addCompanyInfo

protected void addCompanyInfo()

addTrainsInfo

protected void addTrainsInfo()

addPhasesInfo

protected void addPhasesInfo()

addNetworkInfo

protected void addNetworkInfo()

executeNetworkInfo

protected void executeNetworkInfo(java.lang.String companyName)

finish

public void finish()

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent actor)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

getRevenue

public int getRevenue(int orCompIndex)

setRevenue

public void setRevenue(int orCompIndex,
                       int amount)

resetActions

public void resetActions()

resetORCompanyTurn

public void resetORCompanyTurn(int orCompIndex)

resetCurrentRevenueDisplay

public void resetCurrentRevenueDisplay()

initORCompanyTurn

public void initORCompanyTurn(PublicCompanyI orComp,
                              int orCompIndex)

initTileLayingStep

public void initTileLayingStep()

initTokenLayingStep

public void initTokenLayingStep()

initRevenueEntryStep

public void initRevenueEntryStep(int orCompIndex,
                                 SetDividend action)

revenueUpdate

public void revenueUpdate(int bestRevenue,
                          boolean finalResult)
Specified by:
revenueUpdate in interface RevenueListener

stopRevenueUpdate

public void stopRevenueUpdate()

initPayoutStep

public void initPayoutStep(int orCompIndex,
                           SetDividend action,
                           boolean withhold,
                           boolean split,
                           boolean payout)

initTrainBuying

public void initTrainBuying(boolean enabled)

initOperatingCosts

public void initOperatingCosts(boolean enabled)

initPrivateBuying

public void initPrivateBuying(boolean enabled)

initSpecialActions

public void initSpecialActions()

addSpecialAction

public void addSpecialAction(PossibleAction action,
                             java.lang.String text)

enableDone

public void enableDone(NullAction action)

enableUndo

public void enableUndo(GameAction action)

enableRedo

public void enableRedo(GameAction action)

enableLoanTaking

public void enableLoanTaking(TakeLoans action)

enableLoanRepayment

public void enableLoanRepayment(RepayLoans action)

finishORCompanyTurn

public void finishORCompanyTurn(int orCompIndex)

getORComp

public PublicCompanyI getORComp()

getORPlayer

public java.lang.String getORPlayer()

getOperatingCompanies

public PublicCompanyI[] getOperatingCompanies()