|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.freecol.client.gui.GUI
public class GUI
| Field Summary | |
|---|---|
private Canvas |
canvas
|
private MapViewer |
colonyTileGUI
This is the MapViewer instance used to paint the colony tiles in the ColonyPanel and other panels. |
static java.lang.String |
COPYRIGHT
|
private static int |
DEFAULT_WINDOW_SPACE
The space not being used in windowed mode. |
private javax.swing.JFrame |
frame
|
private FreeColClient |
freeColClient
|
private java.awt.GraphicsDevice |
gd
|
private ImageLibrary |
imageLibrary
|
static java.lang.String |
LICENSE
|
private static java.util.logging.Logger |
logger
|
private MapViewer |
mapViewer
|
static java.lang.String |
REVISION
|
private SoundPlayer |
soundPlayer
|
private javax.swing.JWindow |
splash
|
private java.awt.Rectangle |
windowBounds
|
private boolean |
windowed
|
| Constructor Summary | |
|---|---|
GUI(FreeColClient freeColClient)
|
|
| Method Summary | ||
|---|---|---|
void |
activateGotoPath()
|
|
boolean |
canPlaySound()
Verifies if the client can play sounds. |
|
void |
centerActiveUnit()
|
|
void |
changeWindowedMode(boolean windowed)
Change the windowed mode. |
|
void |
closeMainPanel()
|
|
void |
closeMenus()
|
|
void |
closeStatusPanel()
|
|
boolean |
containsInGameComponents()
|
|
java.awt.Dimension |
determineWindowSize()
|
|
void |
displayChat(java.lang.String senderNme,
java.lang.String message,
boolean privateChat)
|
|
void |
displayChatMessage(java.lang.String message,
boolean privateChat)
Tells the map controls that a chat message was received. |
|
void |
displaySpashScreen(java.lang.String splashFilename)
|
|
void |
errorMessage(java.lang.String messageId)
|
|
void |
errorMessage(java.lang.String messageID,
java.lang.String message)
|
|
void |
executeWithUnitOutForAnimation(Unit unit,
Tile sourceTile,
OutForAnimationCallback r)
|
|
Unit |
getActiveUnit()
|
|
Canvas |
getCanvas()
|
|
MapViewer |
getColonyTileGUI()
|
|
int |
getCurrentViewMode()
|
|
Tile |
getFocus()
|
|
javax.swing.ImageIcon |
getImageIcon(java.lang.Object display,
boolean small)
|
|
ImageLibrary |
getImageLibrary()
|
|
LoadingSavegameDialog |
getLoadingSavegameDialog()
|
|
float |
getMapScale()
|
|
MapViewer |
getMapViewer()
|
|
Tile |
getSelectedTile()
|
|
SoundPlayer |
getSoundPlayer()
|
|
java.awt.Rectangle |
getTileBounds(Tile tile)
|
|
java.awt.Point |
getTilePosition(Tile tile)
|
|
java.awt.Rectangle |
getWindowBounds()
|
|
void |
hideSplashScreen()
|
|
boolean |
isClientOptionsDialogShowing()
|
|
boolean |
isMapboardActionsEnabled()
|
|
boolean |
isShowingSubPanel()
|
|
boolean |
isWindowed()
|
|
void |
moveTileCursor(Map.Direction direction)
|
|
boolean |
onScreen(Tile tileToCheck)
|
|
void |
paintImmediatelyCanvasIn(java.awt.Rectangle rectangle)
|
|
void |
paintImmediatelyCanvasInItsBounds()
|
|
void |
playSound(java.lang.String sound)
Plays some sound. |
|
void |
quit()
|
|
void |
refresh()
|
|
void |
refreshPlayersTable()
|
|
void |
refreshTile(Tile t)
Refreshes the screen at the specified Tile. |
|
void |
removeFromCanvas(java.awt.Component component)
|
|
void |
removeInGameComponents()
|
|
void |
requestFocusForSubPanel()
|
|
boolean |
requestFocusInWindow()
|
|
void |
resetMenuBar()
|
|
void |
returnToTitle()
|
|
void |
scaleMap(float delta)
|
|
void |
setActiveUnit(Unit unitToActivate)
|
|
void |
setFocus(Tile tileToFocus)
|
|
void |
setFocusImmediately(Tile tileToFocus)
|
|
boolean |
setSelectedTile(Tile newTileToSelect,
boolean clearGoToOrders)
|
|
void |
setupInGameMenuBar()
|
|
private void |
setupMapEditorMenuBar()
|
|
void |
setupMenuBarToNull()
|
|
private void |
setupMouseListenerForMapEditor()
|
|
void |
setUpMouseListenersForCanvas()
|
|
void |
setWindowed(boolean windowed)
|
|
void |
showAboutPanel()
|
|
Canvas.ScoutIndianSettlementAction |
showArmedUnitIndianSettlementDialog(IndianSettlement settlement)
|
|
Canvas.BoycottAction |
showBoycottedGoodsDialog(Goods goods,
Europe europe)
|
|
void |
showBuildQueuePanel(Colony colony)
|
|
void |
showBuildQueuePanel(Colony colony,
java.lang.Runnable callBack)
|
|
Canvas.BuyAction |
showBuyDialog(Unit unit,
Settlement settlement,
Goods goods,
int gold,
boolean canBuy)
|
|
java.util.List<Goods> |
showCaptureGoodsDialog(Unit winner,
java.util.List<Goods> loot)
|
|
void |
showChatPanel()
|
|
|
showChoiceDialog(Tile tile,
java.lang.String text,
java.lang.String cancelText,
java.util.List<ChoiceItem<T>> choices)
|
|
Monarch.MonarchAction |
showChoiceMonarchActionDialog(java.lang.String monarchTitle,
java.util.List<ChoiceItem<Monarch.MonarchAction>> actions)
|
|
FoundingFather |
showChooseFoundingFatherDialog(java.util.List<ChoiceItem<FoundingFather>> fathers,
java.lang.String fatherTitle)
|
|
FoundingFather |
showChooseFoundingFatherDialog(java.util.List<FoundingFather> ffs)
|
|
Canvas.ClaimAction |
showClaimDialog(Tile tile,
Player player,
int price,
Player owner,
boolean canAccept)
|
|
OptionGroup |
showClientOptionsDialog()
|
|
ColonyPanel |
showColonyPanel(Colony colony)
|
|
void |
showColonyPanel(Colony colony,
java.lang.Runnable callback)
|
|
void |
showColopediaPanel(java.lang.String nodeId)
|
|
void |
showCompactLabourReport()
|
|
void |
showCompactLabourReport(LabourData.UnitData unitData)
|
|
java.util.List<java.lang.String> |
showConfirmDeclarationDialog()
|
|
boolean |
showConfirmDialog(java.lang.String text,
java.lang.String okText,
java.lang.String cancelText)
|
|
boolean |
showConfirmDialog(Tile tile,
ModelMessage[] messages,
java.lang.String okText,
java.lang.String cancelText)
|
|
boolean |
showConfirmDialog(Tile tile,
StringTemplate text,
java.lang.String okText,
java.lang.String cancelText)
|
|
void |
showDeclarationDialog()
|
|
void |
showDifficultyDialog()
|
|
OptionGroup |
showDifficultyDialog(Specification specification)
|
|
java.util.List<Goods> |
showDumpCargoDialog(Unit unit)
|
|
int |
showEmigrationPanel(boolean fountainOfYouth)
|
|
boolean |
showEndTurnDialog(java.util.List<Unit> units)
|
|
int |
showEuropeDialog(EuropePanel.EuropeAction europeAction)
|
|
void |
showEuropePanel()
|
|
void |
showEventPanel(Canvas.EventType type)
|
|
void |
showFindSettlementDialog()
|
|
void |
showGameOptionsDialog(boolean editable,
boolean loadCustomOptions)
|
|
void |
showHighScoresPanel(java.lang.String messageId)
|
|
void |
showIndianSettlementPanel(IndianSettlement indianSettlement)
|
|
Canvas.TradeAction |
showIndianSettlementTradeDialog(Settlement settlement,
boolean canBuy,
boolean canSell,
boolean canGift)
|
|
void |
showInformationMessage(FreeColObject displayObject,
java.lang.String messageId)
|
|
void |
showInformationMessage(FreeColObject displayObject,
StringTemplate template)
|
|
void |
showInformationMessage(ModelMessage message)
|
|
void |
showInformationMessage(java.lang.String messageId)
|
|
void |
showInformationMessage(StringTemplate template)
|
|
java.lang.String |
showInputDialog(Tile tile,
StringTemplate text,
java.lang.String defaultValue,
java.lang.String okText,
java.lang.String cancelText,
boolean rejectEmptyString)
|
|
java.io.File |
showLoadDialog(java.io.File directory)
|
|
java.io.File |
showLoadDialog(java.io.File directory,
javax.swing.filechooser.FileFilter[] fileFilters)
|
|
boolean |
showLoadingSavegameDialog(boolean publicServer,
boolean singleplayer)
|
|
void |
showLogFilePanel()
|
|
void |
showMainPanel()
|
|
OptionGroup |
showMapGeneratorOptionsDialog(OptionGroup mgo,
boolean editable,
boolean loadCustomOptions)
|
|
java.awt.Dimension |
showMapSizeDialog()
|
|
void |
showModelMessages(ModelMessage... modelMessages)
|
|
boolean |
showMonarchPanelDialog(Monarch.MonarchAction action,
StringTemplate replace)
|
|
DiplomaticTrade |
showNegotiationDialog(Unit unit,
Settlement settlement,
DiplomaticTrade agreement)
|
|
void |
showNewPanel()
|
|
void |
showNewPanel(Specification specification)
|
|
boolean |
showPreCombatDialog(FreeColGameObject attacker,
FreeColGameObject defender,
Tile tile)
|
|
void |
showReportCargoPanel()
|
|
void |
showReportColonyPanel()
|
|
void |
showReportContinentalCongressPanel()
|
|
void |
showReportEducationPanel()
|
|
void |
showReportExplorationPanel()
|
|
void |
showReportForeignAffairPanel()
|
|
void |
showReportHistoryPanel()
|
|
void |
showReportIndianPanel()
|
|
void |
showReportLabourPanel()
|
|
void |
showReportMilitaryPanel()
|
|
void |
showReportNavalPanel()
|
|
void |
showReportProductionPanel()
|
|
void |
showReportReligiousPanel()
|
|
void |
showReportRequirementsPanel()
|
|
void |
showReportTradePanel()
|
|
void |
showReportTurnPanel(ModelMessage... messages)
|
|
java.io.File |
showSaveDialog(java.io.File directory,
java.lang.String defaultName)
|
|
java.io.File |
showSaveDialog(java.io.File directory,
java.lang.String standardName,
javax.swing.filechooser.FileFilter[] fileFilters,
java.lang.String defaultName)
|
|
Canvas.ScoutColonyAction |
showScoutForeignColonyDialog(Colony colony,
Unit unit,
boolean canNegotiate)
|
|
Canvas.ScoutIndianSettlementAction |
showScoutIndianSettlementDialog(IndianSettlement settlement,
java.lang.String number)
|
|
int |
showSelectAmountDialog(GoodsType goodsType,
int available,
int defaultAmount,
boolean needToPay)
|
|
Location |
showSelectDestinationDialog(Unit unit)
|
|
Canvas.SellAction |
showSellDialog(Unit unit,
Settlement settlement,
Goods goods,
int gold)
|
|
void |
showServerListPanel(java.lang.String username,
java.util.ArrayList<ServerInfo> serverList)
|
|
|
showSimpleChoiceDialog(Tile tile,
java.lang.String text,
java.lang.String cancelText,
java.util.List<T> objects)
|
|
void |
showStartGamePanel(Game game,
Player player,
boolean singlePlayerMode)
|
|
void |
showStatisticsPanel()
|
|
void |
showStatusPanel(java.lang.String message)
|
|
void |
showTilePanel(Tile tile)
|
|
void |
showTilePopUpAtSelectedTile()
|
|
TradeRoute |
showTradeRouteDialog(TradeRoute tradeRoute,
Tile tile)
|
|
boolean |
showTradeRouteInputDialog(TradeRoute newRoute)
|
|
Canvas.MissionaryAction |
showUseMissionaryDialog(Unit unit,
IndianSettlement settlement,
boolean canEstablish,
boolean canDenounce)
|
|
void |
showVictoryPanel()
|
|
boolean |
showWarehouseDialog(Colony colony)
|
|
void |
showWorkProductionPanel(Unit unit)
|
|
void |
startGUI(java.awt.Dimension innerWindowSize,
boolean sound,
boolean showOpeningVideo,
boolean loadGame)
Starts the GUI by creating and displaying the GUI-objects. |
|
void |
startMapEditorGUI()
|
|
void |
toggleViewMode()
|
|
void |
updateGameOptions()
|
|
void |
updateGoldLabel()
Updates the label displaying the current amount of gold. |
|
void |
updateMapGeneratorOptions()
|
|
void |
updateMenuBar()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.util.logging.Logger logger
public static final java.lang.String COPYRIGHT
public static final java.lang.String LICENSE
public static final java.lang.String REVISION
private static final int DEFAULT_WINDOW_SPACE
private FreeColClient freeColClient
private java.awt.GraphicsDevice gd
private javax.swing.JFrame frame
private Canvas canvas
private MapViewer mapViewer
private MapViewer colonyTileGUI
private ImageLibrary imageLibrary
private SoundPlayer soundPlayer
private boolean windowed
private java.awt.Rectangle windowBounds
private javax.swing.JWindow splash
| Constructor Detail |
|---|
public GUI(FreeColClient freeColClient)
| Method Detail |
|---|
public void activateGotoPath()
public boolean canPlaySound()
public void centerActiveUnit()
public void changeWindowedMode(boolean windowed)
windowed - Use true for windowed mode
and false for fullscreen mode.public void closeMainPanel()
public void closeMenus()
public void closeStatusPanel()
public boolean containsInGameComponents()
public java.awt.Dimension determineWindowSize()
public void displayChat(java.lang.String senderNme,
java.lang.String message,
boolean privateChat)
public void displayChatMessage(java.lang.String message,
boolean privateChat)
sender - The player who sent the chat message to the server.message - The chat message.privateChat - 'true' if the message is a private one, 'false'
otherwise.GUIMessagepublic void displaySpashScreen(java.lang.String splashFilename)
public void errorMessage(java.lang.String messageId)
public void errorMessage(java.lang.String messageID,
java.lang.String message)
public void executeWithUnitOutForAnimation(Unit unit,
Tile sourceTile,
OutForAnimationCallback r)
public Unit getActiveUnit()
public Canvas getCanvas()
public MapViewer getColonyTileGUI()
public int getCurrentViewMode()
public Tile getFocus()
public javax.swing.ImageIcon getImageIcon(java.lang.Object display,
boolean small)
public ImageLibrary getImageLibrary()
public LoadingSavegameDialog getLoadingSavegameDialog()
public float getMapScale()
public MapViewer getMapViewer()
public Tile getSelectedTile()
public SoundPlayer getSoundPlayer()
public java.awt.Rectangle getTileBounds(Tile tile)
public java.awt.Point getTilePosition(Tile tile)
public java.awt.Rectangle getWindowBounds()
public void hideSplashScreen()
public boolean isClientOptionsDialogShowing()
public boolean isMapboardActionsEnabled()
public boolean isShowingSubPanel()
public boolean isWindowed()
public void moveTileCursor(Map.Direction direction)
public boolean onScreen(Tile tileToCheck)
public void paintImmediatelyCanvasIn(java.awt.Rectangle rectangle)
public void paintImmediatelyCanvasInItsBounds()
public void playSound(java.lang.String sound)
sound - The sound resource to play or nullpublic void quit()
public void refresh()
public void refreshPlayersTable()
public void refreshTile(Tile t)
t - The tile to refresh.public void removeFromCanvas(java.awt.Component component)
public void removeInGameComponents()
public void requestFocusForSubPanel()
public boolean requestFocusInWindow()
public void resetMenuBar()
public void returnToTitle()
public void scaleMap(float delta)
public void setActiveUnit(Unit unitToActivate)
public void setFocus(Tile tileToFocus)
public void setFocusImmediately(Tile tileToFocus)
public boolean setSelectedTile(Tile newTileToSelect,
boolean clearGoToOrders)
public void setupInGameMenuBar()
public void setupMenuBarToNull()
public void setUpMouseListenersForCanvas()
public void setWindowed(boolean windowed)
public void showAboutPanel()
public Canvas.ScoutIndianSettlementAction showArmedUnitIndianSettlementDialog(IndianSettlement settlement)
public Canvas.BoycottAction showBoycottedGoodsDialog(Goods goods,
Europe europe)
public void showBuildQueuePanel(Colony colony)
public void showBuildQueuePanel(Colony colony,
java.lang.Runnable callBack)
public Canvas.BuyAction showBuyDialog(Unit unit,
Settlement settlement,
Goods goods,
int gold,
boolean canBuy)
public java.util.List<Goods> showCaptureGoodsDialog(Unit winner,
java.util.List<Goods> loot)
public void showChatPanel()
public <T> T showChoiceDialog(Tile tile,
java.lang.String text,
java.lang.String cancelText,
java.util.List<ChoiceItem<T>> choices)
public Monarch.MonarchAction showChoiceMonarchActionDialog(java.lang.String monarchTitle,
java.util.List<ChoiceItem<Monarch.MonarchAction>> actions)
public FoundingFather showChooseFoundingFatherDialog(java.util.List<ChoiceItem<FoundingFather>> fathers,
java.lang.String fatherTitle)
public FoundingFather showChooseFoundingFatherDialog(java.util.List<FoundingFather> ffs)
public Canvas.ClaimAction showClaimDialog(Tile tile,
Player player,
int price,
Player owner,
boolean canAccept)
public OptionGroup showClientOptionsDialog()
public ColonyPanel showColonyPanel(Colony colony)
public void showColonyPanel(Colony colony,
java.lang.Runnable callback)
public void showColopediaPanel(java.lang.String nodeId)
public void showCompactLabourReport()
public void showCompactLabourReport(LabourData.UnitData unitData)
public java.util.List<java.lang.String> showConfirmDeclarationDialog()
public boolean showConfirmDialog(java.lang.String text,
java.lang.String okText,
java.lang.String cancelText)
public boolean showConfirmDialog(Tile tile,
ModelMessage[] messages,
java.lang.String okText,
java.lang.String cancelText)
public boolean showConfirmDialog(Tile tile,
StringTemplate text,
java.lang.String okText,
java.lang.String cancelText)
public void showDeclarationDialog()
public void showDifficultyDialog()
public OptionGroup showDifficultyDialog(Specification specification)
public java.util.List<Goods> showDumpCargoDialog(Unit unit)
public int showEmigrationPanel(boolean fountainOfYouth)
public boolean showEndTurnDialog(java.util.List<Unit> units)
public int showEuropeDialog(EuropePanel.EuropeAction europeAction)
public void showEuropePanel()
public void showEventPanel(Canvas.EventType type)
public void showFindSettlementDialog()
public void showGameOptionsDialog(boolean editable,
boolean loadCustomOptions)
public void showHighScoresPanel(java.lang.String messageId)
public void showIndianSettlementPanel(IndianSettlement indianSettlement)
public Canvas.TradeAction showIndianSettlementTradeDialog(Settlement settlement,
boolean canBuy,
boolean canSell,
boolean canGift)
public void showInformationMessage(FreeColObject displayObject,
java.lang.String messageId)
public void showInformationMessage(FreeColObject displayObject,
StringTemplate template)
public void showInformationMessage(ModelMessage message)
public void showInformationMessage(java.lang.String messageId)
public void showInformationMessage(StringTemplate template)
public java.lang.String showInputDialog(Tile tile,
StringTemplate text,
java.lang.String defaultValue,
java.lang.String okText,
java.lang.String cancelText,
boolean rejectEmptyString)
public java.io.File showLoadDialog(java.io.File directory)
public java.io.File showLoadDialog(java.io.File directory,
javax.swing.filechooser.FileFilter[] fileFilters)
public boolean showLoadingSavegameDialog(boolean publicServer,
boolean singleplayer)
public void showLogFilePanel()
public void showMainPanel()
public OptionGroup showMapGeneratorOptionsDialog(OptionGroup mgo,
boolean editable,
boolean loadCustomOptions)
public java.awt.Dimension showMapSizeDialog()
public void showModelMessages(ModelMessage... modelMessages)
public boolean showMonarchPanelDialog(Monarch.MonarchAction action,
StringTemplate replace)
public DiplomaticTrade showNegotiationDialog(Unit unit,
Settlement settlement,
DiplomaticTrade agreement)
public void showNewPanel()
public void showNewPanel(Specification specification)
public boolean showPreCombatDialog(FreeColGameObject attacker,
FreeColGameObject defender,
Tile tile)
public void showReportCargoPanel()
public void showReportColonyPanel()
public void showReportContinentalCongressPanel()
public void showReportEducationPanel()
public void showReportExplorationPanel()
public void showReportForeignAffairPanel()
public void showReportHistoryPanel()
public void showReportIndianPanel()
public void showReportLabourPanel()
public void showReportMilitaryPanel()
public void showReportNavalPanel()
public void showReportProductionPanel()
public void showReportReligiousPanel()
public void showReportRequirementsPanel()
public void showReportTradePanel()
public void showReportTurnPanel(ModelMessage... messages)
public java.io.File showSaveDialog(java.io.File directory,
java.lang.String defaultName)
public java.io.File showSaveDialog(java.io.File directory,
java.lang.String standardName,
javax.swing.filechooser.FileFilter[] fileFilters,
java.lang.String defaultName)
public Canvas.ScoutColonyAction showScoutForeignColonyDialog(Colony colony,
Unit unit,
boolean canNegotiate)
public Canvas.ScoutIndianSettlementAction showScoutIndianSettlementDialog(IndianSettlement settlement,
java.lang.String number)
public int showSelectAmountDialog(GoodsType goodsType,
int available,
int defaultAmount,
boolean needToPay)
public Location showSelectDestinationDialog(Unit unit)
public Canvas.SellAction showSellDialog(Unit unit,
Settlement settlement,
Goods goods,
int gold)
public void showServerListPanel(java.lang.String username,
java.util.ArrayList<ServerInfo> serverList)
public <T> T showSimpleChoiceDialog(Tile tile,
java.lang.String text,
java.lang.String cancelText,
java.util.List<T> objects)
public void showStartGamePanel(Game game,
Player player,
boolean singlePlayerMode)
public void showStatisticsPanel()
public void showStatusPanel(java.lang.String message)
public void showTilePanel(Tile tile)
public void showTilePopUpAtSelectedTile()
public TradeRoute showTradeRouteDialog(TradeRoute tradeRoute,
Tile tile)
public boolean showTradeRouteInputDialog(TradeRoute newRoute)
public Canvas.MissionaryAction showUseMissionaryDialog(Unit unit,
IndianSettlement settlement,
boolean canEstablish,
boolean canDenounce)
public void showVictoryPanel()
public boolean showWarehouseDialog(Colony colony)
public void showWorkProductionPanel(Unit unit)
public void startGUI(java.awt.Dimension innerWindowSize,
boolean sound,
boolean showOpeningVideo,
boolean loadGame)
public void startMapEditorGUI()
public void toggleViewMode()
public void updateGameOptions()
public void updateGoldLabel()
public void updateMapGeneratorOptions()
public void updateMenuBar()
private void setupMapEditorMenuBar()
private void setupMouseListenerForMapEditor()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||