|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjfreerails.client.top.GUIComponentFactoryImpl
public class GUIComponentFactoryImpl
Creates and wires up the GUI components.
Field Summary | |
---|---|
private ActionRoot |
actionRoot
|
private javax.swing.JMenu |
brokerMenu
|
private BuildMenu |
buildMenu
|
private javax.swing.JMenuItem |
callBrokerJMenuItem
|
private CashJLabel |
cashjLabel
|
private static boolean |
CHEAT
Whether to show certain 'cheat' menus used for testing. |
private ClientJFrame |
clientJFrame
|
private DateJLabel |
datejLabel
|
private DialogueBoxController |
dialogueBoxController
|
private javax.swing.JMenu |
displayMenu
|
private javax.swing.JMenu |
helpMenu
|
private boolean |
isSetup
|
private javax.swing.JMenuItem |
leaderBoardJMenuItem
|
private static java.util.logging.Logger |
logger
|
private DetailMapRenderer |
mainMap
|
private javax.swing.JScrollPane |
mainMapScrollPane1
|
private MapViewJComponentConcrete |
mapViewJComponent
|
private ModelRootImpl |
modelRoot
|
private javax.swing.JMenuItem |
networthGraphJMenuItem
|
private MapRenderer |
overviewMap
|
private javax.swing.JPanel |
overviewMapContainer
|
private java.awt.Rectangle |
r
|
private RenderersRoot |
renderers
|
private javax.swing.JMenu |
reportsMenu
|
private ServerControlModel |
sc
|
private ActionAdapter |
speedActions
|
private javax.swing.JMenuItem |
stationInfoJMenuItem
|
private StationTypesPopup |
stationTypesPopup
|
private javax.swing.JMenuItem |
trainListJMenuItem
|
private javax.swing.JMenuItem |
trainOrdersJMenuItem
|
private RHSJTabPane |
trainsJTabPane
This is the panel at the bottom right of the screen. |
private UserInputOnMapController |
userInputOnMapController
|
private UserMessageGenerator |
userMessageGenerator
|
private ReadOnlyWorld |
world
|
Constructor Summary | |
---|---|
GUIComponentFactoryImpl(ModelRootImpl mr,
ActionRoot ar)
|
Method Summary | |
---|---|
private void |
countStations()
|
private void |
countTrains()
|
javax.swing.JMenu |
createBrokerMenu()
|
javax.swing.JMenu |
createBuildMenu()
|
javax.swing.JLabel |
createCashJLabel()
|
javax.swing.JFrame |
createClientJFrame(java.lang.String title)
|
javax.swing.JLabel |
createDateJLabel()
|
javax.swing.JMenu |
createDisplayMenu()
|
javax.swing.JMenu |
createGameMenu()
|
javax.swing.JMenu |
createHelpMenu()
|
javax.swing.JScrollPane |
createMainMap()
|
javax.swing.JPanel |
createOverviewMap()
|
javax.swing.JMenu |
createReportsMenu()
|
javax.swing.JTabbedPane |
createTrainsJTabPane()
|
BuildTrackController |
getBuildTrackController()
|
boolean |
isSetup()
|
void |
itemAdded(KEY key,
int index,
FreerailsPrincipal principal)
|
void |
itemRemoved(KEY key,
int index,
FreerailsPrincipal principal)
|
void |
listUpdated(KEY key,
int index,
FreerailsPrincipal principal)
|
void |
setup(RenderersRoot vl,
ReadOnlyWorld w)
Called when a new game is started or a game is loaded. |
void |
tilesChanged(java.awt.Rectangle tilesChanged)
Listens for changes on the map, for instance when track is built, and refreshes the map views. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final boolean CHEAT
private static final java.util.logging.Logger logger
private final ActionRoot actionRoot
private final BuildMenu buildMenu
private final CashJLabel cashjLabel
private final ClientJFrame clientJFrame
private final DateJLabel datejLabel
private final DialogueBoxController dialogueBoxController
private javax.swing.JMenu displayMenu
private javax.swing.JMenu helpMenu
private javax.swing.JMenu brokerMenu
private boolean isSetup
private javax.swing.JMenuItem leaderBoardJMenuItem
private DetailMapRenderer mainMap
private final javax.swing.JScrollPane mainMapScrollPane1
private final MapViewJComponentConcrete mapViewJComponent
private final ModelRootImpl modelRoot
private javax.swing.JMenuItem networthGraphJMenuItem
private MapRenderer overviewMap
private final javax.swing.JPanel overviewMapContainer
private final java.awt.Rectangle r
private javax.swing.JMenu reportsMenu
private ServerControlModel sc
private ActionAdapter speedActions
private javax.swing.JMenuItem stationInfoJMenuItem
private final StationTypesPopup stationTypesPopup
private javax.swing.JMenuItem trainListJMenuItem
private javax.swing.JMenuItem trainOrdersJMenuItem
private javax.swing.JMenuItem callBrokerJMenuItem
private final RHSJTabPane trainsJTabPane
private final UserInputOnMapController userInputOnMapController
private UserMessageGenerator userMessageGenerator
private RenderersRoot renderers
private ReadOnlyWorld world
Constructor Detail |
---|
public GUIComponentFactoryImpl(ModelRootImpl mr, ActionRoot ar)
Method Detail |
---|
private void countStations()
private void countTrains()
public javax.swing.JMenu createBuildMenu()
createBuildMenu
in interface GUIComponentFactory
public javax.swing.JLabel createCashJLabel()
createCashJLabel
in interface GUIComponentFactory
public javax.swing.JFrame createClientJFrame(java.lang.String title)
public javax.swing.JLabel createDateJLabel()
createDateJLabel
in interface GUIComponentFactory
public javax.swing.JMenu createBrokerMenu()
createBrokerMenu
in interface GUIComponentFactory
public javax.swing.JMenu createDisplayMenu()
createDisplayMenu
in interface GUIComponentFactory
public javax.swing.JMenu createGameMenu()
createGameMenu
in interface GUIComponentFactory
public javax.swing.JMenu createHelpMenu()
createHelpMenu
in interface GUIComponentFactory
public javax.swing.JScrollPane createMainMap()
createMainMap
in interface GUIComponentFactory
public javax.swing.JPanel createOverviewMap()
createOverviewMap
in interface GUIComponentFactory
public javax.swing.JMenu createReportsMenu()
createReportsMenu
in interface GUIComponentFactory
public javax.swing.JTabbedPane createTrainsJTabPane()
createTrainsJTabPane
in interface GUIComponentFactory
public BuildTrackController getBuildTrackController()
public boolean isSetup()
public void itemAdded(KEY key, int index, FreerailsPrincipal principal)
itemAdded
in interface WorldListListener
public void itemRemoved(KEY key, int index, FreerailsPrincipal principal)
itemRemoved
in interface WorldListListener
public void listUpdated(KEY key, int index, FreerailsPrincipal principal)
listUpdated
in interface WorldListListener
public void setup(RenderersRoot vl, ReadOnlyWorld w) throws java.io.IOException
Be extremely careful with the references of objects allocated in this method to avoid memory leaks - see bug 967677 (OutOfMemoryError after starting several new games).
java.io.IOException
public void tilesChanged(java.awt.Rectangle tilesChanged)
tilesChanged
in interface WorldMapListener
tilesChanged
- rectangle containing the tiles that have change; all the
points contained by the rectangle must be within the map's
bounds.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |