Package net.sf.freecol.client.gui
Class Widgets
- java.lang.Object
-
- net.sf.freecol.client.gui.Widgets
-
public final class Widgets extends java.lang.Object
Container 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 class
Widgets.DialogCallback<T>
A wrapper class for non-modal dialogs.
-
Field Summary
Fields Modifier and Type Field Description private Canvas
canvas
The canvas to write to.private FreeColClient
freeColClient
The game client.private static java.util.logging.Logger
logger
-
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 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.<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.private FreeColFrame
getFrame()
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.FreeColPanel
showAboutPanel()
Show the AboutPanel.FreeColPanel
showBuildQueuePanel(Colony colony)
Show the BuildQueuePanel for a given colony.void
showCaptureGoodsDialog(Unit unit, java.util.List<Goods> gl, DialogHandler<java.util.List<Goods>> handler)
Show theCaptureGoodsDialog
.FreeColPanel
showChatPanel()
Show the chat panel.void
showChooseFoundingFatherDialog(java.util.List<FoundingFather> ffs, DialogHandler<FoundingFather> handler)
Show theChooseFoundingFatherDialog
.FreeColPanel
showColopediaPanel(java.lang.String nodeId)
Show the colopedia entry for a given node.FreeColPanel
showColorChooserPanel(java.awt.event.ActionListener al)
Show aColorChooserPanel
.FreeColPanel
showCompactLabourReport()
Show the compact labour report.FreeColPanel
showCompactLabourReport(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.void
showDeclarationPanel(java.lang.Runnable afterClosing)
Show a panel showing the declaration of independence with animated signature.OptionGroup
showDifficultyDialog(Specification spec, OptionGroup group, boolean editable)
Show the difficulty dialog for a given group.void
showDumpCargoDialog(Unit unit, SwingGUI.PopupPosition pos, DialogHandler<java.util.List<Goods>> handler)
Show theDumpCargoDialog
.boolean
showEditOptionDialog(Option op)
Show the EditOptionDialog.IndianSettlement
showEditSettlementDialog(IndianSettlement is)
Show the EditSettlementDialog.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.void
showEndTurnDialog(java.util.List<Unit> units, DialogHandler<java.lang.Boolean> handler)
Show the EndTurnDialog with given units that could still move.FreeColPanel
showErrorPanel(java.lang.String message)
Show an error message.FreeColPanel
showEuropePanel(java.lang.Runnable callback)
Show theEuropePanel
.FreeColPanel
showEventPanel(java.lang.String header, java.lang.String image, java.lang.String footer)
Show an event panel.FreeColPanel
showFindSettlementPanel()
Show the FindSettlementPanel.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).OptionGroup
showGameOptionsDialog(boolean editable)
Show the GameOptionsDialog.FreeColPanel
showHighScoresPanel(java.lang.String messageId, java.util.List<HighScore> scores)
Show the high scores panel.FreeColPanel
showIndianSettlementPanel(IndianSettlement is, SwingGUI.PopupPosition pos)
Show the panel of the given native settlement.FreeColPanel
showInformationPanel(FreeColObject displayObject, SwingGUI.PopupPosition pos, javax.swing.ImageIcon icon, StringTemplate tmpl)
Show a message with some information and an "OK"-button.java.io.File
showLoadDialog(java.io.File directory, javax.swing.filechooser.FileFilter[] filters)
Show a dialog where the user may choose a file.LoadingSavegameInfo
showLoadingSavegameDialog(boolean pubSer, boolean single)
Show a dialog for setting options when loading a savegame.FreeColPanel
showLogFilePanel()
Show a panel containing the log file.OptionGroup
showMapGeneratorOptionsDialog(boolean editable)
Show the map generator options dialog.java.awt.Dimension
showMapSizeDialog()
Show the map size dialog.void
showMonarchDialog(Monarch.MonarchAction action, StringTemplate tmpl, java.lang.String monarchKey, DialogHandler<java.lang.Boolean> handler)
Show the monarch dialog.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.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.DiplomaticTrade
showNegotiationDialog(FreeColGameObject our, FreeColGameObject other, DiplomaticTrade agreement, StringTemplate comment, SwingGUI.PopupPosition pos)
Show theNegotiationDialog
.FreeColPanel
showNewPanel(Specification specification)
Show the NewPanel for a given optional specification.Parameters
showParametersDialog()
Show the parameters dialog.boolean
showPreCombatDialog(Unit attacker, FreeColGameObject defender, SwingGUI.PopupPosition pos)
Show a dialog to confirm a combat.FreeColPanel
showPurchasePanel()
Show the purchase panel.FreeColPanel
showRecruitPanel()
Show the recruit panel.FreeColPanel
showReportCargoPanel()
FreeColPanel
showReportColonyPanel(boolean compact)
FreeColPanel
showReportContinentalCongressPanel()
FreeColPanel
showReportEducationPanel()
FreeColPanel
showReportExplorationPanel()
FreeColPanel
showReportForeignAffairPanel()
FreeColPanel
showReportHistoryPanel()
FreeColPanel
showReportIndianPanel()
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.FreeColPanel
showReportLabourPanel()
FreeColPanel
showReportMilitaryPanel()
FreeColPanel
showReportNavalPanel()
FreeColPanel
showReportProductionPanel()
FreeColPanel
showReportReligiousPanel()
FreeColPanel
showReportRequirementsPanel()
FreeColPanel
showReportTradePanel()
FreeColPanel
showReportTurnPanel(java.util.List<ModelMessage> messages)
Show the turn report.java.lang.String
showRiverStyleDialog(java.util.List<java.lang.String> styles)
Show the river style dialog.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.java.awt.Dimension
showScaleMapSizeDialog()
Show the scale map size dialog.int
showSelectAmountDialog(GoodsType goodsType, int available, int defaultAmount, boolean needToPay)
Show the select-amount dialog.Location
showSelectDestinationDialog(Unit unit, SwingGUI.PopupPosition pos)
Show a dialog allowing the user to select a destination for a given unit.int
showSelectTributeAmountDialog(StringTemplate question, int maximum)
Show the select-tribute-amount dialog.FreeColPanel
showServerListPanel(java.util.List<ServerInfo> serverList)
Show theServerListPanel
.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.FreeColPanel
showTilePanel(Tile tile)
Show the tile panel for a given tile.FreeColPanel
showTradeRouteInputPanel(TradeRoute newRoute)
Show the trade route input panel for a given trade route.FreeColPanel
showTradeRoutePanel(Unit unit, SwingGUI.PopupPosition pos)
Show a panel to select a trade route for a unit.FreeColPanel
showTrainPanel()
Show the training panel.void
showVictoryDialog(DialogHandler<java.lang.Boolean> handler)
Show the victory dialog.boolean
showWarehouseDialog(Colony colony)
Show the warehouse dialog for a colony.FreeColPanel
showWorkProductionPanel(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
- TheCanvas
to 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
- AStringTemplate
to 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
- APopupPosition
for 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
- TheList
containing the ChoiceItems to create buttons for.pos
- APopupPosition
for 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
- AStringTemplate
that 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
- APopupPosition
for 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
- TheColony
to 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
- TheUnit
capturing goods.gl
- The list ofGoods
to choose from.handler
- ADialogHandler
for 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
- TheFoundingFather
s to choose from.handler
- ADialogHandler
for 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
- AnActionListener
to 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
- TheUnitData
to 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
- TheOptionGroup
containing 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
- TheUnit
that is dumping.pos
- APopupPosition
for the dialog.handler
- ADialogHandler
for the dialog response.
-
showEditOptionDialog
public boolean showEditOptionDialog(Option op)
Show the EditOptionDialog.- Parameters:
op
- TheOption
to edit.- Returns:
- The response returned by the dialog.
-
showEditSettlementDialog
public IndianSettlement showEditSettlementDialog(IndianSettlement is)
Show the EditSettlementDialog.- Parameters:
is
- TheIndianSettlement
to 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
- ThePlayer
whose unit is emigrating.fountainOfYouth
- Is this dialog displayed as a result of a fountain of youth.handler
- ADialogHandler
for 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 ofUnit
s that could still move.handler
- ADialogHandler
for 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
- ThePlayer
making contact.other
- ThePlayer
to contact.tile
- An optionalTile
on offer.settlementCount
- The number of settlements the other player has (from the server, other.getNumberOfSettlements() is wrong here!).pos
- APopupPosition
for the dialog.handler
- ADialogHandler
for the dialog response.
-
showGameOptionsDialog
public OptionGroup showGameOptionsDialog(boolean editable)
Show the GameOptionsDialog.- Parameters:
editable
- Should the game options be editable?- Returns:
- The
OptionGroup
selected.
-
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 ofHighScore
s 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
- TheIndianSettlement
to display.pos
- APopupPosition
for 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
- APopupPosition
for the panel.icon
- The icon to display for the object.tmpl
- TheStringTemplate
to 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
-FileFilter
s 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 fromLoadingSavegameDialog
after calling this method.- Parameters:
pubSer
- Default value.single
- Default value.- Returns:
- The
LoadingSavegameInfo
if 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
OptionGroup
as 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
- TheMonarchAction
underway.tmpl
- TheStringTemplate
describing the situation.monarchKey
- The resource key for the monarch image.handler
- ADialogHandler
for 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
- AStringTemplate
for the message to explain the dialog.defaultName
- The default name.pos
- APopupPosition
for the dialog.handler
- ADialogHandler
for 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
- TheColony
being demanded of.type
- TheGoodsType
demanded (null for gold).amount
- The amount of goods demanded.pos
- APopupPosition
for the dialog.handler
- ADialogHandler
for the dialog response.
-
showNegotiationDialog
public DiplomaticTrade showNegotiationDialog(FreeColGameObject our, FreeColGameObject other, DiplomaticTrade agreement, StringTemplate comment, SwingGUI.PopupPosition pos)
Show theNegotiationDialog
.- Parameters:
our
- OurFreeColGameObject
that is negotiating.other
- The otherFreeColGameObject
.agreement
- The currentDiplomaticTrade
agreement.comment
- An optionalStringTemplate
containing a commentary message.pos
- APopupPosition
for the dialog.- Returns:
- An updated agreement.
-
showNewPanel
public FreeColPanel showNewPanel(Specification specification)
Show the NewPanel for a given optional specification.- Parameters:
specification
- TheSpecification
to 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
- APopupPosition
for 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
- TheUnitType
to display.data
- The labour data.unitCount
- A map of unit distribution.colonies
- The list of playerColony
s.- 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
-FileFilter
s 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
- TheGoodsType
to 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
- TheUnit
to select a destination for.pos
- APopupPosition
for 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
- astringtemplate
describing 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
- TheTile
to display.- Returns:
- The panel shown.
-
showTradeRouteInputPanel
public FreeColPanel showTradeRouteInputPanel(TradeRoute newRoute)
Show the trade route input panel for a given trade route.- Parameters:
newRoute
- TheTradeRoute
to 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 optionalUnit
to select a trade route for.pos
- APopupPosition
for 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
- ADialogHandler
for 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
- TheColony
to display.- Returns:
- The response returned by the dialog.
-
showWorkProductionPanel
public FreeColPanel showWorkProductionPanel(Unit unit)
Show the production of a unit.- Parameters:
unit
- TheUnit
to 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
- TheModelMessage
s to show.- Returns:
- The
FreeColPanel
displayed.
-
-