Methapolis  0.27
 All Classes Namespaces Files Functions Variables Enumerator
micropolisj.gui.MainWindow Class Reference
Inheritance diagram for micropolisj.gui.MainWindow:
Collaboration diagram for micropolisj.gui.MainWindow:

Classes

class  EarthquakeStepper

Public Member Functions

 MainWindow ()
 MainWindow (Micropolis engine)
void setEngine (Micropolis newEngine)
void onLoadGameClicked ()
void doNewCity (boolean firstTime)
void showToolResult (CityLocation loc, ToolResult result)
void earthquakeStarted ()
void cityMessage (MicropolisMessage m, CityLocation p)
void fundsChanged ()
void optionsChanged ()
void citySound (Sound sound, CityLocation loc)
void censusChanged ()
void demandChanged ()
void evaluationChanged ()
boolean dispatchKeyEvent (KeyEvent e)
void onCountdown (int count)
void onEnd ()

Static Public Member Functions

static String formatFunds (int funds)
static String formatGameDate (int cityTime)

Public Attributes

Map< MicropolisTool,
JToggleButton > 
toolBtns

Private Member Functions

void setupKeys (JMenu menu, String prefix)
void setupKeys (JMenuItem menuItem, String prefix)
void makeMenu ()
Micropolis getEngine ()
void onAutoBudgetClicked ()
void onAutoBulldozeClicked ()
void onDisastersClicked ()
void onSoundClicked ()
boolean onSaveCityClicked ()
boolean onSaveCityAsClicked ()
JToggleButton makeToolBtn (final MicropolisTool tool)
JToolBar makeToolbar ()
void selectTool (MicropolisTool newTool)
void onNewCityClicked ()
void doZoom (int dir, Point mousePt)
void doZoom (int dir)
void onMouseWheelMoved (MouseWheelEvent evt)
void onToolDown (MouseEvent ev)
void onToolUp (MouseEvent ev)
void onEscapePressed ()
void onToolDrag (MouseEvent ev)
void onToolHover (MouseEvent ev)
void onToolExited (MouseEvent ev)
void updateDateLabel ()
void startTimer ()
void showErrorMessage (Throwable e)
void stopTimer ()
void onWindowClosed (WindowEvent ev)
void onDifficultyClicked (int newDifficulty)
void onPriorityClicked (Speed newSpeed)
void onInvokeDisasterClicked (Disaster disaster)
void reloadFunds ()
void reloadOptions ()
void showAutoBudget ()
void showBudgetWindow (boolean isEndOfYear)
JMenuItem makeMapStateMenuItem (String stringPrefix, final MapState state)
void setMapState (MapState state)
void setMapLegend (MapState state)
void onLaunchTranslationToolClicked ()
void onAboutClicked ()

Static Private Attributes

static final int SCROLLING_SPEED = 100

Detailed Description

Definition at line 95 of file MainWindow.java.

Constructor & Destructor Documentation

micropolisj.gui.MainWindow.MainWindow ( )

Definition at line 135 of file MainWindow.java.

micropolisj.gui.MainWindow.MainWindow ( Micropolis  engine)

Definition at line 139 of file MainWindow.java.

References micropolisj.engine.Micropolis.addEarthquakeListener(), micropolisj.engine.Micropolis.addListener(), micropolisj.engine.Micropolis.addTempelListener(), micropolisj.engine.MapState.ALL, micropolisj.engine.Sound.BG_MUSIC, micropolisj.engine.MapState.COMMERCIAL, micropolisj.gui.OverlayMapView.connectView(), micropolisj.engine.MapState.CRIME_OVERLAY, micropolisj.gui.MainWindow.doZoom(), micropolisj.engine.MapState.FIRE_OVERLAY, micropolisj.engine.Micropolis.getPlayerInfo(), micropolisj.engine.MapState.GROWTHRATE_OVERLAY, micropolisj.engine.MapState.INDUSTRIAL, micropolisj.engine.MapState.LANDVALUE_OVERLAY, micropolisj.engine.Micropolis.mainWindow, micropolisj.gui.MainWindow.makeMapStateMenuItem(), micropolisj.gui.MainWindow.makeMenu(), micropolisj.gui.MainWindow.makeToolbar(), micropolisj.gui.MainWindow.onEscapePressed(), micropolisj.gui.MainWindow.onMouseWheelMoved(), micropolisj.gui.MainWindow.onToolDown(), micropolisj.gui.MainWindow.onToolDrag(), micropolisj.gui.MainWindow.onToolExited(), micropolisj.gui.MainWindow.onToolHover(), micropolisj.gui.MainWindow.onToolUp(), micropolisj.gui.MainWindow.onWindowClosed(), micropolisj.engine.Micropolis.playerInfo, micropolisj.engine.MapState.POLICE_OVERLAY, micropolisj.engine.MapState.POLLUTE_OVERLAY, micropolisj.engine.MapState.POPDEN_OVERLAY, micropolisj.engine.MapState.POWER_OVERLAY, micropolisj.gui.MainWindow.reloadFunds(), micropolisj.gui.MainWindow.reloadOptions(), micropolisj.engine.PlayerInfo.researchState, micropolisj.engine.MapState.RESIDENTIAL, micropolisj.engine.MicropolisTool.ROCKET, micropolisj.gui.OverlayMapView.setEngine(), micropolisj.gui.MainWindow.setMapState(), micropolisj.research.ResearchState.setToolBtns(), micropolisj.gui.MainWindow.setupKeys(), micropolisj.gui.MainWindow.showErrorMessage(), micropolisj.gui.MainWindow.startTimer(), micropolisj.gui.MainWindow.toolBtns, micropolisj.engine.MapState.TRAFFIC_OVERLAY, and micropolisj.engine.MapState.TRANSPORT.

Here is the call graph for this function:

Member Function Documentation

void micropolisj.gui.MainWindow.censusChanged ( )

Fired whenever the "census" is taken, and the various historical counters have been updated. (Once a month in game.)

Implements micropolisj.engine.Micropolis.Listener.

Definition at line 1633 of file MainWindow.java.

void micropolisj.gui.MainWindow.demandChanged ( )

Fired whenever playerInfo.resValve, playerInfo.comValve, or playerInfo.indValve changes. (Twice a month in game.)

Implements micropolisj.engine.Micropolis.Listener.

Definition at line 1636 of file MainWindow.java.

boolean micropolisj.gui.MainWindow.dispatchKeyEvent ( KeyEvent  e)

called whenever a key is pressed in mainwindow

Definition at line 1746 of file MainWindow.java.

References micropolisj.util.Utilities.moveRectangle(), micropolisj.gui.MainWindow.SCROLLING_SPEED, and micropolisj.gui.MainWindow.toolBtns.

Here is the call graph for this function:

void micropolisj.gui.MainWindow.doZoom ( int  dir,
Point  mousePt 
)
private
void micropolisj.gui.MainWindow.doZoom ( int  dir)
private

Definition at line 1183 of file MainWindow.java.

References micropolisj.gui.MainWindow.doZoom().

Here is the call graph for this function:

void micropolisj.gui.MainWindow.earthquakeStarted ( )

Implements micropolisj.engine.EarthquakeListener.

Definition at line 1489 of file MainWindow.java.

References micropolisj.gui.MainWindow.startTimer(), and micropolisj.gui.MainWindow.stopTimer().

Here is the call graph for this function:

void micropolisj.gui.MainWindow.evaluationChanged ( )

Fired whenever the city playerInfo.evaluation is recalculated. (Once a year.)

Implements micropolisj.engine.Micropolis.Listener.

Definition at line 1639 of file MainWindow.java.

static String micropolisj.gui.MainWindow.formatFunds ( int  funds)
static
static String micropolisj.gui.MainWindow.formatGameDate ( int  cityTime)
static

Definition at line 1365 of file MainWindow.java.

Referenced by micropolisj.gui.MainWindow.updateDateLabel().

void micropolisj.gui.MainWindow.fundsChanged ( )

Fired whenever the mayor's money changes.

Implements micropolisj.engine.Micropolis.Listener.

Definition at line 1582 of file MainWindow.java.

References micropolisj.gui.MainWindow.reloadFunds().

Here is the call graph for this function:

JMenuItem micropolisj.gui.MainWindow.makeMapStateMenuItem ( String  stringPrefix,
final MapState  state 
)
private

Definition at line 1685 of file MainWindow.java.

References micropolisj.gui.MainWindow.setMapState(), and micropolisj.gui.MainWindow.setupKeys().

Referenced by micropolisj.gui.MainWindow.MainWindow().

Here is the call graph for this function:

JToggleButton micropolisj.gui.MainWindow.makeToolBtn ( final MicropolisTool  tool)
private

Definition at line 992 of file MainWindow.java.

References micropolisj.gui.MainWindow.selectTool(), and micropolisj.gui.MainWindow.toolBtns.

Referenced by micropolisj.gui.MainWindow.makeToolbar().

Here is the call graph for this function:

void micropolisj.gui.MainWindow.onAboutClicked ( )
private

Definition at line 1728 of file MainWindow.java.

Referenced by micropolisj.gui.MainWindow.makeMenu().

void micropolisj.gui.MainWindow.onAutoBudgetClicked ( )
private

Definition at line 834 of file MainWindow.java.

References micropolisj.gui.MainWindow.getEngine(), and micropolisj.engine.Micropolis.toggleAutoBudget().

Referenced by micropolisj.gui.MainWindow.makeMenu().

Here is the call graph for this function:

void micropolisj.gui.MainWindow.onAutoBulldozeClicked ( )
private

Definition at line 839 of file MainWindow.java.

References micropolisj.gui.MainWindow.getEngine(), and micropolisj.engine.Micropolis.toggleAutoBulldoze().

Referenced by micropolisj.gui.MainWindow.makeMenu().

Here is the call graph for this function:

void micropolisj.gui.MainWindow.onCountdown ( int  count)

Implements micropolisj.engine.TempelListener.

Definition at line 1777 of file MainWindow.java.

void micropolisj.gui.MainWindow.onDifficultyClicked ( int  newDifficulty)
private

Definition at line 1527 of file MainWindow.java.

References micropolisj.gui.MainWindow.getEngine(), and micropolisj.engine.Micropolis.setGameLevel().

Referenced by micropolisj.gui.MainWindow.makeMenu().

Here is the call graph for this function:

void micropolisj.gui.MainWindow.onDisastersClicked ( )
private

Definition at line 844 of file MainWindow.java.

References micropolisj.gui.MainWindow.getEngine(), and micropolisj.engine.Micropolis.toggleDisasters().

Referenced by micropolisj.gui.MainWindow.makeMenu().

Here is the call graph for this function:

void micropolisj.gui.MainWindow.onEnd ( )

Implements micropolisj.engine.TempelListener.

Definition at line 1783 of file MainWindow.java.

void micropolisj.gui.MainWindow.onEscapePressed ( )
private
void micropolisj.gui.MainWindow.onLaunchTranslationToolClicked ( )
private

Definition at line 1720 of file MainWindow.java.

Referenced by micropolisj.gui.MainWindow.makeMenu().

void micropolisj.gui.MainWindow.onMouseWheelMoved ( MouseWheelEvent  evt)
private

Definition at line 1188 of file MainWindow.java.

References micropolisj.gui.MainWindow.doZoom().

Referenced by micropolisj.gui.MainWindow.MainWindow().

Here is the call graph for this function:

void micropolisj.gui.MainWindow.onNewCityClicked ( )
private

Definition at line 1133 of file MainWindow.java.

References micropolisj.gui.MainWindow.doNewCity().

Referenced by micropolisj.gui.MainWindow.makeMenu().

Here is the call graph for this function:

void micropolisj.gui.MainWindow.onPriorityClicked ( Speed  newSpeed)
private
boolean micropolisj.gui.MainWindow.onSaveCityAsClicked ( )
private
boolean micropolisj.gui.MainWindow.onSaveCityClicked ( )
private
void micropolisj.gui.MainWindow.onSoundClicked ( )
private

Definition at line 852 of file MainWindow.java.

References micropolisj.util.MP3.close(), micropolisj.util.MP3.play(), and micropolisj.gui.MainWindow.reloadOptions().

Referenced by micropolisj.gui.MainWindow.makeMenu().

Here is the call graph for this function:

void micropolisj.gui.MainWindow.onToolDown ( MouseEvent  ev)
private
void micropolisj.gui.MainWindow.onToolExited ( MouseEvent  ev)
private

Definition at line 1333 of file MainWindow.java.

References micropolisj.gui.MicropolisDrawingArea.setToolCursor().

Referenced by micropolisj.gui.MainWindow.MainWindow().

Here is the call graph for this function:

void micropolisj.gui.MainWindow.onWindowClosed ( WindowEvent  ev)
private

Definition at line 1521 of file MainWindow.java.

References micropolisj.gui.MainWindow.stopTimer().

Referenced by micropolisj.gui.MainWindow.MainWindow().

Here is the call graph for this function:

void micropolisj.gui.MainWindow.optionsChanged ( )

Fired whenever autoBulldoze, autoBudget, noDisasters, or simSpeed change.

Implements micropolisj.engine.Micropolis.Listener.

Definition at line 1587 of file MainWindow.java.

References micropolisj.gui.MainWindow.reloadOptions().

Here is the call graph for this function:

void micropolisj.gui.MainWindow.reloadFunds ( )
private
void micropolisj.gui.MainWindow.selectTool ( MicropolisTool  newTool)
private
void micropolisj.gui.MainWindow.setMapLegend ( MapState  state)
private

Definition at line 1705 of file MainWindow.java.

Referenced by micropolisj.gui.MainWindow.setMapState().

void micropolisj.gui.MainWindow.setMapState ( MapState  state)
private
void micropolisj.gui.MainWindow.setupKeys ( JMenu  menu,
String  prefix 
)
private
void micropolisj.gui.MainWindow.setupKeys ( JMenuItem  menuItem,
String  prefix 
)
private

Definition at line 505 of file MainWindow.java.

void micropolisj.gui.MainWindow.showAutoBudget ( )
private

Definition at line 1661 of file MainWindow.java.

References micropolisj.gui.MainWindow.showBudgetWindow().

Referenced by micropolisj.gui.MainWindow.startTimer().

Here is the call graph for this function:

void micropolisj.gui.MainWindow.showBudgetWindow ( boolean  isEndOfYear)
private
void micropolisj.gui.MainWindow.showErrorMessage ( Throwable  e)
private

Definition at line 1440 of file MainWindow.java.

Referenced by micropolisj.gui.MainWindow.MainWindow().

void micropolisj.gui.MainWindow.updateDateLabel ( )
private

Member Data Documentation

final int micropolisj.gui.MainWindow.SCROLLING_SPEED = 100
staticprivate

Definition at line 125 of file MainWindow.java.

Referenced by micropolisj.gui.MainWindow.dispatchKeyEvent().


The documentation for this class was generated from the following file: