Package net.sf.freecol.client.gui
Class Widgets
- java.lang.Object
-
- net.sf.freecol.client.gui.Widgets
-
public final class Widgets extends java.lang.ObjectContainer for all the higher level dialogs and panels. Moved here so that Canvas is more manageable.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classWidgets.DialogCallback<T>A wrapper class for non-modal dialogs.
-
Field Summary
Fields Modifier and Type Field Description private CanvascanvasThe canvas to write to.private FreeColClientfreeColClientThe game client.private static java.util.logging.Loggerlogger
-
Constructor Summary
Constructors Constructor Description Widgets(FreeColClient freeColClient, Canvas canvas)Create this wrapper class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanconfirm(StringTemplate tmpl, javax.swing.ImageIcon icon, java.lang.String okKey, java.lang.String cancelKey, SwingGUI.PopupPosition pos)Show a modal dialog with a text and a ok/cancel option.<T> TgetChoice(StringTemplate tmpl, javax.swing.ImageIcon icon, java.lang.String cancelKey, java.util.List<ChoiceItem<T>> choices, SwingGUI.PopupPosition pos)Show a modal dialog with text and a choice of options.private FreeColFramegetFrame()java.lang.StringgetInput(StringTemplate tmpl, java.lang.String defaultValue, java.lang.String okKey, java.lang.String cancelKey, SwingGUI.PopupPosition pos)Show a modal dialog with a text field and a ok/cancel option.FreeColPanelshowAboutPanel()Show the AboutPanel.FreeColPanelshowBuildQueuePanel(Colony colony)Show the BuildQueuePanel for a given colony.voidshowCaptureGoodsDialog(Unit unit, java.util.List<Goods> gl, DialogHandler<java.util.List<Goods>> handler)Show theCaptureGoodsDialog.FreeColPanelshowChatPanel()Show the chat panel.voidshowChooseFoundingFatherDialog(java.util.List<FoundingFather> ffs, DialogHandler<FoundingFather> handler)Show theChooseFoundingFatherDialog.FreeColPanelshowColopediaPanel(java.lang.String nodeId)Show the colopedia entry for a given node.FreeColPanelshowColorChooserPanel(java.awt.event.ActionListener al)Show aColorChooserPanel.FreeColPanelshowCompactLabourReport()Show the compact labour report.FreeColPanelshowCompactLabourReport(LabourData.UnitData unitData)Show the compact labour report for the specified unit data.java.util.List<java.lang.String>showConfirmDeclarationDialog()Show a dialog to confirm a declaration of independence.voidshowDeclarationPanel(java.lang.Runnable afterClosing)Show a panel showing the declaration of independence with animated signature.OptionGroupshowDifficultyDialog(Specification spec, OptionGroup group, boolean editable)Show the difficulty dialog for a given group.voidshowDumpCargoDialog(Unit unit, SwingGUI.PopupPosition pos, DialogHandler<java.util.List<Goods>> handler)Show theDumpCargoDialog.booleanshowEditOptionDialog(Option op)Show the EditOptionDialog.IndianSettlementshowEditSettlementDialog(IndianSettlement is)Show the EditSettlementDialog.voidshowEmigrationDialog(Player player, boolean fountainOfYouth, DialogHandler<java.lang.Integer> handler)Show the panel that allows the user to choose which unit will emigrate from Europe.voidshowEndTurnDialog(java.util.List<Unit> units, DialogHandler<java.lang.Boolean> handler)Show the EndTurnDialog with given units that could still move.FreeColPanelshowErrorPanel(java.lang.String message)Show an error message.FreeColPanelshowEuropePanel(java.lang.Runnable callback)Show theEuropePanel.FreeColPanelshowEventPanel(java.lang.String header, java.lang.String image, java.lang.String footer)Show an event panel.FreeColPanelshowFindSettlementPanel()Show the FindSettlementPanel.voidshowFirstContactDialog(Player player, Player other, Tile tile, int settlementCount, SwingGUI.PopupPosition pos, DialogHandler<java.lang.Boolean> handler)Show the first contact dialog (which is really just a non-modal confirm dialog).OptionGroupshowGameOptionsDialog(boolean editable)Show the GameOptionsDialog.FreeColPanelshowHighScoresPanel(java.lang.String messageId, java.util.List<HighScore> scores)Show the high scores panel.FreeColPanelshowIndianSettlementPanel(IndianSettlement is, SwingGUI.PopupPosition pos)Show the panel of the given native settlement.FreeColPanelshowInformationPanel(FreeColObject displayObject, SwingGUI.PopupPosition pos, javax.swing.ImageIcon icon, StringTemplate tmpl)Show a message with some information and an "OK"-button.java.io.FileshowLoadDialog(java.io.File directory, javax.swing.filechooser.FileFilter[] filters)Show a dialog where the user may choose a file.LoadingSavegameInfoshowLoadingSavegameDialog(boolean pubSer, boolean single)Show a dialog for setting options when loading a savegame.FreeColPanelshowLogFilePanel()Show a panel containing the log file.OptionGroupshowMapGeneratorOptionsDialog(boolean editable)Show the map generator options dialog.java.awt.DimensionshowMapSizeDialog()Show the map size dialog.voidshowMonarchDialog(Monarch.MonarchAction action, StringTemplate tmpl, java.lang.String monarchKey, DialogHandler<java.lang.Boolean> handler)Show the monarch dialog.voidshowNamingDialog(StringTemplate tmpl, java.lang.String defaultName, SwingGUI.PopupPosition pos, DialogHandler<java.lang.String> handler)Show a dialog to set a new name for something.voidshowNativeDemandDialog(Unit unit, Colony colony, GoodsType type, int amount, SwingGUI.PopupPosition pos, DialogHandler<java.lang.Boolean> handler)Show a dialog to handle a native demand to a colony.DiplomaticTradeshowNegotiationDialog(FreeColGameObject our, FreeColGameObject other, DiplomaticTrade agreement, StringTemplate comment, SwingGUI.PopupPosition pos)Show theNegotiationDialog.FreeColPanelshowNewPanel(Specification specification)Show the NewPanel for a given optional specification.ParametersshowParametersDialog()Show the parameters dialog.booleanshowPreCombatDialog(Unit attacker, FreeColGameObject defender, SwingGUI.PopupPosition pos)Show a dialog to confirm a combat.FreeColPanelshowPurchasePanel()Show the purchase panel.FreeColPanelshowRecruitPanel()Show the recruit panel.FreeColPanelshowReportCargoPanel()FreeColPanelshowReportColonyPanel(boolean compact)FreeColPanelshowReportContinentalCongressPanel()FreeColPanelshowReportEducationPanel()FreeColPanelshowReportExplorationPanel()FreeColPanelshowReportForeignAffairPanel()FreeColPanelshowReportHistoryPanel()FreeColPanelshowReportIndianPanel()FreeColPanelshowReportLabourDetailPanel(UnitType unitType, java.util.Map<UnitType,java.util.Map<Location,java.lang.Integer>> data, TypeCountMap<UnitType> unitCount, java.util.List<Colony> colonies)Show the labour detail panel.FreeColPanelshowReportLabourPanel()FreeColPanelshowReportMilitaryPanel()FreeColPanelshowReportNavalPanel()FreeColPanelshowReportProductionPanel()FreeColPanelshowReportReligiousPanel()FreeColPanelshowReportRequirementsPanel()FreeColPanelshowReportTradePanel()FreeColPanelshowReportTurnPanel(java.util.List<ModelMessage> messages)Show the turn report.java.lang.StringshowRiverStyleDialog(java.util.List<java.lang.String> styles)Show the river style dialog.java.io.FileshowSaveDialog(java.io.File directory, javax.swing.filechooser.FileFilter[] filters, java.lang.String defaultName)Show a dialog where the user may choose a filename.java.awt.DimensionshowScaleMapSizeDialog()Show the scale map size dialog.intshowSelectAmountDialog(GoodsType goodsType, int available, int defaultAmount, boolean needToPay)Show the select-amount dialog.LocationshowSelectDestinationDialog(Unit unit, SwingGUI.PopupPosition pos)Show a dialog allowing the user to select a destination for a given unit.intshowSelectTributeAmountDialog(StringTemplate question, int maximum)Show the select-tribute-amount dialog.FreeColPanelshowServerListPanel(java.util.List<ServerInfo> serverList)Show theServerListPanel.FreeColPanelshowStatisticsPanel(java.util.Map<java.lang.String,java.lang.String> serverStats, java.util.Map<java.lang.String,java.lang.String> clientStats)Show the statistics panel.FreeColPanelshowTilePanel(Tile tile)Show the tile panel for a given tile.FreeColPanelshowTradeRouteInputPanel(TradeRoute newRoute)Show the trade route input panel for a given trade route.FreeColPanelshowTradeRoutePanel(Unit unit, SwingGUI.PopupPosition pos)Show a panel to select a trade route for a unit.FreeColPanelshowTrainPanel()Show the training panel.voidshowVictoryDialog(DialogHandler<java.lang.Boolean> handler)Show the victory dialog.booleanshowWarehouseDialog(Colony colony)Show the warehouse dialog for a colony.FreeColPanelshowWorkProductionPanel(Unit unit)Show the production of a unit.
-
-
-
Field Detail
-
logger
private static final java.util.logging.Logger logger
-
freeColClient
private final FreeColClient freeColClient
The game client.
-
canvas
private final Canvas canvas
The canvas to write to.
-
-
Constructor Detail
-
Widgets
public Widgets(FreeColClient freeColClient, Canvas canvas)
Create this wrapper class.- Parameters:
freeColClient- The enclosingFreeColClient.canvas- TheCanvasto call out to.
-
-
Method Detail
-
getFrame
private FreeColFrame getFrame()
-
confirm
public boolean confirm(StringTemplate tmpl, javax.swing.ImageIcon icon, java.lang.String okKey, java.lang.String cancelKey, SwingGUI.PopupPosition pos)
Show a modal dialog with a text and a ok/cancel option.- Parameters:
tmpl- AStringTemplateto explain the choice.icon- An optional icon to display.okKey- The text displayed on the "ok"-button.cancelKey- The text displayed on the "cancel"-button.pos- APopupPositionfor the dialog.- Returns:
- True if the user clicked the "ok"-button.
-
getChoice
public <T> T getChoice(StringTemplate tmpl, javax.swing.ImageIcon icon, java.lang.String cancelKey, java.util.List<ChoiceItem<T>> choices, SwingGUI.PopupPosition pos)
Show a modal dialog with text and a choice of options.- Type Parameters:
T- The type to be returned from the dialog.- Parameters:
tmpl- A SringTemplate that explains the choice for the user.icon- An optional icon to display.cancelKey- Key for the text of the optional cancel button.choices- TheListcontaining the ChoiceItems to create buttons for.pos- APopupPositionfor the dialog.- Returns:
- The corresponding member of the values array to the selected option, or null if no choices available.
-
getInput
public java.lang.String getInput(StringTemplate tmpl, java.lang.String defaultValue, java.lang.String okKey, java.lang.String cancelKey, SwingGUI.PopupPosition pos)
Show a modal dialog with a text field and a ok/cancel option.- Parameters:
tmpl- AStringTemplatethat explains the action to the user.defaultValue- The default value appearing in the text field.okKey- A key displayed on the "ok"-button.cancelKey- A key displayed on the optional "cancel"-button.pos- APopupPositionfor the dialog.- Returns:
- The text the user entered, or null if cancelled.
-
showAboutPanel
public FreeColPanel showAboutPanel()
Show the AboutPanel.- Returns:
- The panel shown.
-
showBuildQueuePanel
public FreeColPanel showBuildQueuePanel(Colony colony)
Show the BuildQueuePanel for a given colony.- Parameters:
colony- TheColonyto show the build queue of.- Returns:
- The panel shown.
-
showCaptureGoodsDialog
public void showCaptureGoodsDialog(Unit unit, java.util.List<Goods> gl, DialogHandler<java.util.List<Goods>> handler)
Show theCaptureGoodsDialog.- Parameters:
unit- TheUnitcapturing goods.gl- The list ofGoodsto choose from.handler- ADialogHandlerfor the dialog response.
-
showChatPanel
public FreeColPanel showChatPanel()
Show the chat panel.- Returns:
- The panel shown.
-
showChooseFoundingFatherDialog
public void showChooseFoundingFatherDialog(java.util.List<FoundingFather> ffs, DialogHandler<FoundingFather> handler)
Show theChooseFoundingFatherDialog.- Parameters:
ffs- TheFoundingFathers to choose from.handler- ADialogHandlerfor the dialog response.
-
showColopediaPanel
public FreeColPanel showColopediaPanel(java.lang.String nodeId)
Show the colopedia entry for a given node.- Parameters:
nodeId- The node identifier to display.- Returns:
- The panel shown.
-
showColorChooserPanel
public FreeColPanel showColorChooserPanel(java.awt.event.ActionListener al)
Show aColorChooserPanel.- Parameters:
al- AnActionListenerto handle panel button presses.- Returns:
- The panel shown.
-
showCompactLabourReport
public FreeColPanel showCompactLabourReport()
Show the compact labour report.- Returns:
- The panel shown.
-
showCompactLabourReport
public FreeColPanel showCompactLabourReport(LabourData.UnitData unitData)
Show the compact labour report for the specified unit data.- Parameters:
unitData- TheUnitDatato display.- Returns:
- The panel shown.
-
showConfirmDeclarationDialog
public java.util.List<java.lang.String> showConfirmDeclarationDialog()
Show a dialog to confirm a declaration of independence.- Returns:
- A list of names for a new nation.
-
showDeclarationPanel
public void showDeclarationPanel(java.lang.Runnable afterClosing)
Show a panel showing the declaration of independence with animated signature.- Parameters:
afterClosing- A callback that is executed after the panel closes.
-
showDifficultyDialog
public OptionGroup showDifficultyDialog(Specification spec, OptionGroup group, boolean editable)
Show the difficulty dialog for a given group.- Parameters:
spec- The enclosingSpecification.group- TheOptionGroupcontaining the difficulty.editable- If the options should be editable.- Returns:
- The resulting
OptionGroup.
-
showDumpCargoDialog
public void showDumpCargoDialog(Unit unit, SwingGUI.PopupPosition pos, DialogHandler<java.util.List<Goods>> handler)
Show theDumpCargoDialog.- Parameters:
unit- TheUnitthat is dumping.pos- APopupPositionfor the dialog.handler- ADialogHandlerfor the dialog response.
-
showEditOptionDialog
public boolean showEditOptionDialog(Option op)
Show the EditOptionDialog.- Parameters:
op- TheOptionto edit.- Returns:
- The response returned by the dialog.
-
showEditSettlementDialog
public IndianSettlement showEditSettlementDialog(IndianSettlement is)
Show the EditSettlementDialog.- Parameters:
is- TheIndianSettlementto edit.- Returns:
- The response returned by the dialog.
-
showEmigrationDialog
public void showEmigrationDialog(Player player, boolean fountainOfYouth, DialogHandler<java.lang.Integer> handler)
Show the panel that allows the user to choose which unit will emigrate from Europe.- Parameters:
player- ThePlayerwhose unit is emigrating.fountainOfYouth- Is this dialog displayed as a result of a fountain of youth.handler- ADialogHandlerfor the dialog response.
-
showEndTurnDialog
public void showEndTurnDialog(java.util.List<Unit> units, DialogHandler<java.lang.Boolean> handler)
Show the EndTurnDialog with given units that could still move.- Parameters:
units- A list ofUnits that could still move.handler- ADialogHandlerfor the dialog response.
-
showErrorPanel
public FreeColPanel showErrorPanel(java.lang.String message)
Show an error message.- Parameters:
message- The message to display.- Returns:
- The panel shown.
-
showEuropePanel
public FreeColPanel showEuropePanel(java.lang.Runnable callback)
Show theEuropePanel.- Parameters:
callback- An optional closing callback to add.- Returns:
- The panel shown.
-
showEventPanel
public FreeColPanel showEventPanel(java.lang.String header, java.lang.String image, java.lang.String footer)
Show an event panel.- Parameters:
header- The title.image- A resource key for the image to display.footer- Optional footer text.- Returns:
- The panel shown.
-
showFindSettlementPanel
public FreeColPanel showFindSettlementPanel()
Show the FindSettlementPanel.- Returns:
- The panel shown.
-
showFirstContactDialog
public void showFirstContactDialog(Player player, Player other, Tile tile, int settlementCount, SwingGUI.PopupPosition pos, DialogHandler<java.lang.Boolean> handler)
Show the first contact dialog (which is really just a non-modal confirm dialog).- Parameters:
player- ThePlayermaking contact.other- ThePlayerto contact.tile- An optionalTileon offer.settlementCount- The number of settlements the other player has (from the server, other.getNumberOfSettlements() is wrong here!).pos- APopupPositionfor the dialog.handler- ADialogHandlerfor the dialog response.
-
showGameOptionsDialog
public OptionGroup showGameOptionsDialog(boolean editable)
Show the GameOptionsDialog.- Parameters:
editable- Should the game options be editable?- Returns:
- The
OptionGroupselected.
-
showHighScoresPanel
public FreeColPanel showHighScoresPanel(java.lang.String messageId, java.util.List<HighScore> scores)
Show the high scores panel.- Parameters:
messageId- An optional message to add to the high scores panel.scores- The list ofHighScores to display.- Returns:
- The panel shown.
-
showIndianSettlementPanel
public FreeColPanel showIndianSettlementPanel(IndianSettlement is, SwingGUI.PopupPosition pos)
Show the panel of the given native settlement.- Parameters:
is- TheIndianSettlementto display.pos- APopupPositionfor the panel.- Returns:
- The panel shown.
-
showInformationPanel
public FreeColPanel showInformationPanel(FreeColObject displayObject, SwingGUI.PopupPosition pos, javax.swing.ImageIcon icon, StringTemplate tmpl)
Show a message with some information and an "OK"-button.- Parameters:
displayObject- Optional object for displaying.pos- APopupPositionfor the panel.icon- The icon to display for the object.tmpl- TheStringTemplateto display.- Returns:
- The panel shown.
-
showLoadDialog
public java.io.File showLoadDialog(java.io.File directory, javax.swing.filechooser.FileFilter[] filters)Show a dialog where the user may choose a file.- Parameters:
directory- The directory containing the files.filters-FileFilters for suitable files.- Returns:
- The selected
File.
-
showLoadingSavegameDialog
public LoadingSavegameInfo showLoadingSavegameDialog(boolean pubSer, boolean single)
Show a dialog for setting options when loading a savegame. The settings can be retrieved directly fromLoadingSavegameDialogafter calling this method.- Parameters:
pubSer- Default value.single- Default value.- Returns:
- The
LoadingSavegameInfoif the dialog was accepted, or null otherwise.
-
showLogFilePanel
public FreeColPanel showLogFilePanel()
Show a panel containing the log file.- Returns:
- The panel shown.
-
showMapGeneratorOptionsDialog
public OptionGroup showMapGeneratorOptionsDialog(boolean editable)
Show the map generator options dialog.- Parameters:
editable- Should these options be editable.- Returns:
- The
OptionGroupas edited.
-
showMapSizeDialog
public java.awt.Dimension showMapSizeDialog()
Show the map size dialog.- Returns:
- The response returned by the dialog.
-
showMonarchDialog
public void showMonarchDialog(Monarch.MonarchAction action, StringTemplate tmpl, java.lang.String monarchKey, DialogHandler<java.lang.Boolean> handler)
Show the monarch dialog.- Parameters:
action- TheMonarchActionunderway.tmpl- TheStringTemplatedescribing the situation.monarchKey- The resource key for the monarch image.handler- ADialogHandlerfor the dialog response.
-
showNamingDialog
public void showNamingDialog(StringTemplate tmpl, java.lang.String defaultName, SwingGUI.PopupPosition pos, DialogHandler<java.lang.String> handler)
Show a dialog to set a new name for something.- Parameters:
tmpl- AStringTemplatefor the message to explain the dialog.defaultName- The default name.pos- APopupPositionfor the dialog.handler- ADialogHandlerfor the dialog response.
-
showNativeDemandDialog
public void showNativeDemandDialog(Unit unit, Colony colony, GoodsType type, int amount, SwingGUI.PopupPosition pos, DialogHandler<java.lang.Boolean> handler)
Show a dialog to handle a native demand to a colony.- Parameters:
unit- The demandingUnit.colony- TheColonybeing demanded of.type- TheGoodsTypedemanded (null for gold).amount- The amount of goods demanded.pos- APopupPositionfor the dialog.handler- ADialogHandlerfor the dialog response.
-
showNegotiationDialog
public DiplomaticTrade showNegotiationDialog(FreeColGameObject our, FreeColGameObject other, DiplomaticTrade agreement, StringTemplate comment, SwingGUI.PopupPosition pos)
Show theNegotiationDialog.- Parameters:
our- OurFreeColGameObjectthat is negotiating.other- The otherFreeColGameObject.agreement- The currentDiplomaticTradeagreement.comment- An optionalStringTemplatecontaining a commentary message.pos- APopupPositionfor the dialog.- Returns:
- An updated agreement.
-
showNewPanel
public FreeColPanel showNewPanel(Specification specification)
Show the NewPanel for a given optional specification.- Parameters:
specification- TheSpecificationto use.- Returns:
- The panel shown.
-
showParametersDialog
public Parameters showParametersDialog()
Show the parameters dialog.- Returns:
- The response returned by the dialog.
-
showPreCombatDialog
public boolean showPreCombatDialog(Unit attacker, FreeColGameObject defender, SwingGUI.PopupPosition pos)
Show a dialog to confirm a combat.- Parameters:
attacker- The attackerUnit.defender- The defender.pos- APopupPositionfor the dialog.- Returns:
- True if the combat is to proceed.
-
showPurchasePanel
public FreeColPanel showPurchasePanel()
Show the purchase panel.- Returns:
- The panel shown.
-
showRecruitPanel
public FreeColPanel showRecruitPanel()
Show the recruit panel.- Returns:
- The panel shown.
-
showReportLabourDetailPanel
public FreeColPanel showReportLabourDetailPanel(UnitType unitType, java.util.Map<UnitType,java.util.Map<Location,java.lang.Integer>> data, TypeCountMap<UnitType> unitCount, java.util.List<Colony> colonies)
Show the labour detail panel.- Parameters:
unitType- TheUnitTypeto display.data- The labour data.unitCount- A map of unit distribution.colonies- The list of playerColonys.- Returns:
- The panel shown.
-
showRiverStyleDialog
public java.lang.String showRiverStyleDialog(java.util.List<java.lang.String> styles)
Show the river style dialog.- Parameters:
styles- The river styles a choice is made from.- Returns:
- The response returned by the dialog.
-
showSaveDialog
public java.io.File showSaveDialog(java.io.File directory, javax.swing.filechooser.FileFilter[] filters, java.lang.String defaultName)Show a dialog where the user may choose a filename.- Parameters:
directory- The directory containing the files in which the user may overwrite.filters-FileFilters for acceptable file names.defaultName- Default filename for the savegame.- Returns:
- The selected
File.
-
showScaleMapSizeDialog
public java.awt.Dimension showScaleMapSizeDialog()
Show the scale map size dialog.- Returns:
- The response returned by the dialog.
-
showSelectAmountDialog
public int showSelectAmountDialog(GoodsType goodsType, int available, int defaultAmount, boolean needToPay)
Show the select-amount dialog.- Parameters:
goodsType- TheGoodsTypeto select an amount of.available- The amount of goods available.defaultAmount- The amount to select to start with.needToPay- If true, check the player has sufficient funds.- Returns:
- The amount selected.
-
showSelectDestinationDialog
public Location showSelectDestinationDialog(Unit unit, SwingGUI.PopupPosition pos)
Show a dialog allowing the user to select a destination for a given unit.- Parameters:
unit- TheUnitto select a destination for.pos- APopupPositionfor the dialog.- Returns:
- A destination for the unit, or null.
-
showServerListPanel
public FreeColPanel showServerListPanel(java.util.List<ServerInfo> serverList)
Show theServerListPanel.- Parameters:
serverList- The list containing the servers retrieved from the metaserver.- Returns:
- The panel shown.
-
showSelectTributeAmountDialog
public int showSelectTributeAmountDialog(StringTemplate question, int maximum)
Show the select-tribute-amount dialog.- Parameters:
question- astringtemplatedescribing the amount of tribute to demand.maximum- The maximum amount available.- Returns:
- The amount selected.
-
showStatisticsPanel
public FreeColPanel showStatisticsPanel(java.util.Map<java.lang.String,java.lang.String> serverStats, java.util.Map<java.lang.String,java.lang.String> clientStats)
Show the statistics panel.- Parameters:
serverStats- A map of server statistics key,value pairs.clientStats- A map of client statistics key,value pairs.- Returns:
- The panel shown.
-
showTilePanel
public FreeColPanel showTilePanel(Tile tile)
Show the tile panel for a given tile.- Parameters:
tile- TheTileto display.- Returns:
- The panel shown.
-
showTradeRouteInputPanel
public FreeColPanel showTradeRouteInputPanel(TradeRoute newRoute)
Show the trade route input panel for a given trade route.- Parameters:
newRoute- TheTradeRouteto display.- Returns:
- The panel shown.
-
showTradeRoutePanel
public FreeColPanel showTradeRoutePanel(Unit unit, SwingGUI.PopupPosition pos)
Show a panel to select a trade route for a unit.- Parameters:
unit- An optionalUnitto select a trade route for.pos- APopupPositionfor the panel.- Returns:
- The panel shown.
-
showTrainPanel
public FreeColPanel showTrainPanel()
Show the training panel.- Returns:
- The panel shown.
-
showVictoryDialog
public void showVictoryDialog(DialogHandler<java.lang.Boolean> handler)
Show the victory dialog.- Parameters:
handler- ADialogHandlerfor the dialog response.
-
showWarehouseDialog
public boolean showWarehouseDialog(Colony colony)
Show the warehouse dialog for a colony. Run out of ColonyPanel, so the tile is already displayed.- Parameters:
colony- TheColonyto display.- Returns:
- The response returned by the dialog.
-
showWorkProductionPanel
public FreeColPanel showWorkProductionPanel(Unit unit)
Show the production of a unit.- Parameters:
unit- TheUnitto display.- Returns:
- The panel shown.
-
showReportCargoPanel
public FreeColPanel showReportCargoPanel()
-
showReportColonyPanel
public FreeColPanel showReportColonyPanel(boolean compact)
-
showReportContinentalCongressPanel
public FreeColPanel showReportContinentalCongressPanel()
-
showReportEducationPanel
public FreeColPanel showReportEducationPanel()
-
showReportExplorationPanel
public FreeColPanel showReportExplorationPanel()
-
showReportForeignAffairPanel
public FreeColPanel showReportForeignAffairPanel()
-
showReportHistoryPanel
public FreeColPanel showReportHistoryPanel()
-
showReportIndianPanel
public FreeColPanel showReportIndianPanel()
-
showReportLabourPanel
public FreeColPanel showReportLabourPanel()
-
showReportMilitaryPanel
public FreeColPanel showReportMilitaryPanel()
-
showReportNavalPanel
public FreeColPanel showReportNavalPanel()
-
showReportProductionPanel
public FreeColPanel showReportProductionPanel()
-
showReportReligiousPanel
public FreeColPanel showReportReligiousPanel()
-
showReportRequirementsPanel
public FreeColPanel showReportRequirementsPanel()
-
showReportTradePanel
public FreeColPanel showReportTradePanel()
-
showReportTurnPanel
public FreeColPanel showReportTurnPanel(java.util.List<ModelMessage> messages)
Show the turn report.- Parameters:
messages- TheModelMessages to show.- Returns:
- The
FreeColPaneldisplayed.
-
-