Compare commits

...

9 Commits

Author SHA1 Message Date
FlavianIuga 497d93c750
Merge bbce187863 into fc8ddf5ac8 2024-05-08 13:25:29 -07:00
translatewiki.net fc8ddf5ac8 Localisation updates from https://translatewiki.net. 2024-04-29 14:05:29 +02:00
translatewiki.net 53f5d5726a Localisation updates from https://translatewiki.net. 2024-04-22 14:05:54 +02:00
translatewiki.net 888b6e3fc9 Localisation updates from https://translatewiki.net. 2024-04-18 14:07:12 +02:00
translatewiki.net 93a2d4410e Localisation updates from https://translatewiki.net. 2024-04-15 14:06:20 +02:00
FlavianIuga bbce187863 Miscellaneous code cleanup 2023-01-25 16:22:50 +02:00
FlavianIuga 4db447e9e6 Removed unnecessary modifiers - code cleanup 2023-01-25 14:56:52 +02:00
FlavianIuga 44724605f8 Move array indicators on type declaration - code cleanup 2023-01-25 14:23:03 +02:00
FlavianIuga a17ccaa226 Reordering modifiers - code cleanup 2023-01-25 14:19:54 +02:00
111 changed files with 276 additions and 244 deletions

View File

@ -563,7 +563,7 @@ model.option.equipScoutCheat.name=Späher ausrüsten
model.option.equipScoutCheat.shortDescription=Chance in Prozent, dass pro Zug ein KI-Spieler in Europa eine Einheit kostenlos zu einem Späher ausrüstet.
model.option.equipPioneerCheat.name=Pionier ausrüsten
model.option.equipPioneerCheat.shortDescription=Chance in Prozent, dass pro Zug eine KI eine Einheit in Europa als Pionier kostenlos ausrüstet.
model.option.landUnitCheat.name=Erhalte Landeinheit
model.option.landUnitCheat.name=Landeinheit erhalten
model.option.landUnitCheat.shortDescription=Chance in Prozent, dass pro Zug ein KI-Spieler in Europa eine freie nützliche Landeinheit erhält.
model.option.offensiveLandUnitCheat.name=Eine offensive Landeinheit erhalten
model.option.offensiveLandUnitCheat.shortDescription=Chance in Prozent, dass pro Zug eine KI eine kostenlose offensive Landeinheit in Europa erhält.

View File

@ -2,6 +2,7 @@
# Exported from translatewiki.net
# Author: Amaia
# Author: An13sa
# Author: Atzerritik
# Author: EukeneFL
# Author: Joxemai
# Author: Kobazulo
@ -25,6 +26,7 @@ veryWet=Oso hezea
warm=Epela
wet=Hezea
freecol.desktopEntry.GenericName=Estrategia jokoa
freecol.desktopEntry.Comment="Sid Meier's Colonization"-en oinarritutako txandakako estrategia jokoa.
accept=Onartu
all=Guztiak
and=eta
@ -81,6 +83,7 @@ yes=Bai
abilities=Gaitasunak
activateAllUnits=Unitate guztiak aktibatu
activateUnit=Unitatea aktibatu
assignTradeRoute=Merkataritza ibilbidea esleitu
building=Eraikuntza
capital=Hiriburua
cargo=Zama

View File

@ -304,6 +304,8 @@ gotoTileAction.accelerator=G
gotoTileAction.name=Ir al tegula
loadAction.name=Cargar
mapControlsAction.name=Controlos del carta
mapEditorToolboxPanelAction.name=Instrumentario
mapEditorTransformPanelAction.name=Transformation de tegulas
mapEditorAction.name=Editor cartographic
mapGeneratorOptionsAction.name=Monstrar optiones del generator de cartas
miniMapToggleBordersAction.name=Alternar le vista inter politic e economic
@ -560,6 +562,8 @@ model.option.continueFoundingFatherRecruitment.name=Continuar a recrutar Patres
model.option.continueFoundingFatherRecruitment.shortDescription=Continuar a recrutar Patres Fundatores post que le independentia es concedite.
model.option.teleportREF.name=Teleport REF
model.option.teleportREF.shortDescription=REF appare al sito de arrivata pro su prime destination.
model.option.mapDefinedStartingPositions.name=Usar le positiones de initio definite per le carta (si disponibile).
model.option.mapDefinedStartingPositions.shortDescription=Le positiones de initio definite per le autor del carta es usate, si illos es disponibile.
model.option.startingPositions.name=Positiones de initio
model.option.startingPositions.shortDescription=Determina le positiones initial del jocatores europee.
model.option.startingPositions.classic.name=Classic
@ -2340,6 +2344,7 @@ error.mapEditorGame=Tu tenta initiar un carta (desde le editor cartographic) com
main.defaultPlayerName=Nomine del jocator
main.javaVersion=Java version %minVersion% o melior es recommendate pro executar FreeCol\n(%version% detegite, usa --no-java-check pro saltar iste verification).
main.memory=Es necessari assignar plus de %memory% bytes de memoria pro usar le JVM.\nReinitia FreeCol con: java -Xmx%minMemory%M -jar FreeCol.jar
main.memoryLow=ATTENTION! Tu ha initiate FreeCol con solmente %memory% bytes de memoria pro le machina virtual de Java.\n Es fortemente recommendate executar FreeCol con al minus 2GB de memoria.\n Reinitia FreeCol con: java -Xmx%minMemory% -jar FreeCol.jar
main.userDir.fail=FreeCol non ha trovate directorios apte pro salveguardar le datos de usator. Le programma pote continuar, ma tu debe expectar problemas.
main.userDir.noHome=Non poteva trovar le directorio de base del usator.
main.userDir.badDir=Non es possibile scriber in le directorio: %name%
@ -2870,6 +2875,7 @@ colonyPanel.populationLabel=Total: %number%
colonyPanel.rebelLabel=Rebellos: %number%
colonyPanel.royalistLabel=Royalistas: %number%
colonyPanel.notBestTile=%unit% poterea producer plus %goods% in %tile%.
model.buildableType.currentlyBuilding=%buildable%
confirmDeclarationDialog.areYouSure.no=Forsan plus tarde
confirmDeclarationDialog.areYouSure.text=Que nos renuncia al tyrannia injuste de %monarch% e declara le independentia de nostre colonias del corona!
confirmDeclarationDialog.areYouSure.yes=Libertate o morte!
@ -2980,6 +2986,8 @@ indianSettlementPanel.learnableSkill=Le sequente mestiero pote esser apprendite
indianSettlementPanel.highlyWanted=Iste stabilimento es multo interessate in le commercio de:
indianSettlementPanel.otherWanted=Altere benes que pote esser commerciate in iste stabilimento es:
indianSettlementPanel.mostHated=Le nation le plus odiate in iste stabilimento:
minimapPanel.title=Mini-carta
infoPanel.title=Information
infoPanel.defenseBonus=Defensa %bonus%%
infoPanel.endTurn=Preme Enter pro finir le torno.
infoPanel.movementCost=Movimento %cost%
@ -2992,12 +3000,17 @@ loadingSavegameDialog.serverName=Nomine del servitor:
loadingSavegameDialog.singlePlayer=Un sol jocator
loadingSavegameDialog.name=Cargamento de partita salveguardate
mapEditor.loadedWithMods=Tu ha initiate le editor de cartas con modificationes active que contine cambios de specification. Per favor nota que le mesme modificationes debe esser activate manualmente per cata usator que carga cartas que usa un nove cosa de un modification.\n\nTu pote retornar al menu principal e deactivar alcun modificationes per medio del Preferentias si isto non esseva intentional.
mapEditor.chooseAreaModificationPanel.title=Elige area
mapEditor.toolBoxPanel.title=Instrumentario
mapEditor.tool.paintBrush.name=Pinger
mapEditorTransformPanel.title=Transformation de tegulas
mapEditorTransformPanel.chooseResource=Selige un ressource
mapEditorTransformPanel.majorRiver=Fluvio major
mapEditorTransformPanel.minorRiver=Fluvio minor
mapEditorTransformPanel.changeRiverConnections=Adder/remover connexiones de fluvio
mapEditorTransformPanel.setRiverStyle=Fixar stilo de fluvio
mapEditorTransformPanel.resource=Modificar/remover ressource
mapEditorTransformPanel.selectArea=Adder/remover tegulas del area
freecol.map.L_America_JsTheDude=<html>L America<br><font size="-2">Per JsTheDude</font></html>
freecol.map.L_America_Mazim=<html>L America<br>Per Mazim</html>
freecol.map.L_Asia_Mazim=<html>L Asia<br>Per Mazim</html>

View File

@ -540,6 +540,8 @@ model.option.importBonuses.name=Impor bonus
model.option.importRumours.name=Impor rumor
model.option.importSettlements.name=Impor pemukiman
clientOptions.name=Preferensi
model.option.playerName.name=Nama pemain:
clientOptions.display.name=Tampilan
model.option.displayScaling.automatic=Otomatis
clientOptions.interface.name=Antarmuka
model.option.languageOption.name=Bahasa
@ -553,6 +555,9 @@ model.option.guiMinNumberToDisplayGoods.shortDescription=Barang-barang akan ditu
model.option.displayGrid.name=Tampilkan Kisi-kisi
model.option.displayBorders.name=Tampilkan Perbatasan
model.option.displayFogOfWar.name=Tampilkan Kabut-Perang
model.option.useOpenGL.name=Aktifkan OpenGL
model.option.useXRender.name=Aktifkan XRender
model.option.useTerrainAnimations.name=Aktifkan Animasi Medan
clientOptions.gui.mapControls.ClassicMapControls.name=Klasik
model.option.color.background.name=Warna Latar
clientOptions.minimap.color.background.black=Hitam
@ -569,6 +574,7 @@ clientOptions.gui.displayColonyLabels.classic.name=Klasik
clientOptions.gui.displayColonyLabels.classic.shortDescription=Labeli koloni dengan nama dan ukuran
clientOptions.gui.displayColonyLabels.modern.name=Modern
model.option.colonyComparator.name=Golongkan koloni sesuai
clientOptions.gui.colonyComparator.byName.name=Nama
clientOptions.gui.colonyComparator.byPosition.name=Posisi
clientOptions.gui.colonyComparator.bySize.name=Ukuran
clientOptions.gui.graphicsQuality.lowest=Terendah
@ -584,9 +590,14 @@ clientOptions.gui.enemyMoveAnimationSpeed.off=Mati
clientOptions.gui.enemyMoveAnimationSpeed.slow=Pelan
clientOptions.gui.enemyMoveAnimationSpeed.normal=Normal
clientOptions.gui.enemyMoveAnimationSpeed.fast=Cepat
clientOptions.gui.friendlyMoveAnimationSpeed.off=Mati
clientOptions.gui.friendlyMoveAnimationSpeed.slow=Pelan
clientOptions.gui.friendlyMoveAnimationSpeed.normal=Normal
clientOptions.gui.friendlyMoveAnimationSpeed.fast=Cepat
clientOptions.messages.name=Pesan
model.option.guiMessagesGroupBy.name=Kelompokkan pesan dengan
model.option.guiMessagesGroupBy.shortDescription=Tetapkan bagaimana pesan akan dikelompokkan
clientOptions.messages.guiMessagesGroupBy.source.name=Sumber
model.option.guiShowBuildingCompleted.name=Pesan penyelesaian pembangunan
model.option.guiShowForeignDiplomacy.name=Pesan diplomasi bangsa asing
model.option.guiShowGovernmentEfficiency.name=Pesan efisiensi pemerintahan

View File

@ -2772,7 +2772,7 @@ serverListPanel.gameState.0=Baru
serverListPanel.gameState.1=Bermain
serverListPanel.gameState.2=Siap
serverListPanel.players=Pelayan
startGamePanel.iAmReady=Saya Sedia
startGamePanel.iAmReady=Saya Sudah Bersedia
info.noEuropeans=Syarat kemenangan atas semua orang Eropah lain sudah disempurnakan. Anda perlu sama ada membolehkan satu lagi bangsa Eropah, atau tambahkan lagi syarat kemenangan.
memoryManager.freeMemory=Bebas
memoryManager.maxMemory=Maks

View File

@ -841,6 +841,7 @@ clientOptions.personal.shortDescription=Ustawienia specyficzne dla danego gracza
model.option.playerName.name=Nazwa gracza:
clientOptions.display.name=Grafika
model.option.displayScaling.automatic=Automatyczny
model.option.displayScaling.75=75 %
model.option.displayScaling.100=100%
model.option.displayScaling.125=125%
model.option.displayScaling.150=150%

View File

@ -14,6 +14,7 @@
# Author: DCamer
# Author: Deltaspace
# Author: Diralik
# Author: Dirruw'o
# Author: Eleferen
# Author: Eroha
# Author: Eugenia.Chudinova
@ -383,6 +384,7 @@ gotoTileAction.name=Перейти к клетке
loadAction.name=Загрузить
mapControlsAction.accelerator=Ctrl+M
mapControlsAction.name=Управление картой
mapEditorToolboxPanelAction.name=Инструменты
mapEditorAction.name=Редактор карт
mapGeneratorOptionsAction.accelerator=Shift+F12
mapGeneratorOptionsAction.name=Показать настройки генератора карты

View File

@ -349,6 +349,7 @@ gotoAction.name=前往
gotoTileAction.name=前往图块
loadAction.name=加载
mapControlsAction.name=地图控制
mapEditorToolboxPanelAction.name=工具箱
mapEditorAction.name=地图编辑器
mapGeneratorOptionsAction.name=显示地图生成器选项
miniMapToggleBordersAction.name=在政治和经济之间切换视角
@ -3106,6 +3107,8 @@ indianSettlementPanel.learnableSkill=下列技能可以在这个部落被学会
indianSettlementPanel.highlyWanted=这个部落对这种货物很感兴趣:
indianSettlementPanel.otherWanted=其它可以在这个部落交易的货物包括:
indianSettlementPanel.mostHated=在此定居最讨厌的国家:
minimapPanel.title=小地图
infoPanel.title=信息
infoPanel.defenseBonus=防御奖励%bonus%%
infoPanel.endTurn=请按回车键来结束回合。
infoPanel.movementCost=活动%cost%
@ -3118,6 +3121,9 @@ loadingSavegameDialog.serverName=服务器名称:
loadingSavegameDialog.singlePlayer=单人游戏
loadingSavegameDialog.name=读取存档中
mapEditor.loadedWithMods=您已使用包含规范变更的活动模组启动了地图编辑器。请注意,每个加载使用模组中任何新内容的地图的用户都需要手动激活相同的模组。\n\n如果这不是故意的您可以返回主菜单并通过首选项停用任何模组。
mapEditor.chooseAreaModificationPanel.title=选择区域
mapEditor.toolBoxPanel.title=工具箱
mapEditor.tool.paintBrush.name=绘制
mapEditorTransformPanel.chooseResource=选择资源
mapEditorTransformPanel.majorRiver=大河
mapEditorTransformPanel.minorRiver=小河

View File

@ -154,9 +154,7 @@ public final class ConnectController extends FreeColClientHolder {
switch (reason) {
case DEFEATED: case QUIT:
fcc.logout(false);
SwingUtilities.invokeLater(() -> {
mainTitle();
});
SwingUtilities.invokeLater(this::mainTitle);
break;
case LOGIN: // Occurs when you Open a new game during a current one
fcc.logout(false);

View File

@ -149,7 +149,7 @@ public final class InGameController extends FreeColClientHolder {
* Selecting next unit depends on mode--- either from the active list,
* from the going-to list, or flush going-to and end the turn.
*/
private static enum MoveMode {
private enum MoveMode {
NEXT_ACTIVE_UNIT,
EXECUTE_GOTO_ORDERS,
END_TURN;

View File

@ -54,7 +54,7 @@ public class FontLibrary {
* <li>HEADER -- a stylized old-fashioned typeface for headers</li>
* </ul>
*/
public static enum FontType {
public enum FontType {
NORMAL,
SIMPLE,
HEADER

View File

@ -116,7 +116,7 @@ public class GUI extends FreeColClientHolder {
};
/** Levels (danger, finance) for confirmEuropeanTribute(). */
private static final String levels[] = { "low", "normal", "high" };
private static final String[] levels = { "low", "normal", "high" };
/**

View File

@ -138,7 +138,7 @@ import net.sf.freecol.common.util.Utils;
public class SwingGUI extends GUI {
/** A rough position to place dialogs and panels on the canvas. */
public static enum PopupPosition {
public enum PopupPosition {
ORIGIN,
CENTERED,
CENTERED_LEFT,

View File

@ -34,7 +34,7 @@ public class ColopediaAction extends FreeColAction {
public static final String id = "colopediaAction.";
// Order of elements will influence ingame order of menu items.
public static enum PanelType {
public enum PanelType {
TERRAIN, RESOURCES, GOODS, UNITS,
BUILDINGS, FATHERS, NATIONS,
NATION_TYPES, CONCEPTS;

View File

@ -39,7 +39,7 @@ public final class DisplayTileTextAction extends SelectableOptionAction {
public static final String id = "displayTileTextAction.";
// FIXME: make ClientOptions use enum
public static enum DisplayText {
public enum DisplayText {
EMPTY, NAMES, OWNERS, REGIONS;
public String getKey() {

View File

@ -41,8 +41,8 @@ public class Animations {
* used as a callback for an animation to trigger painting.
*/
public interface Procedure {
public void execute();
};
void execute();
}
/**
* Collect animations for a unit move.

View File

@ -96,7 +96,7 @@ public final class UnitImageAnimation extends Animation {
* @param direction The preferred {@code Direction}.
* @return A list of {@code Direction}s.
*/
private synchronized static List<Direction> trialDirections(Direction direction) {
private static synchronized List<Direction> trialDirections(Direction direction) {
if (alternatives.isEmpty()) { // Populate first time
// Favour the closest E-W cases
for (Direction d : Direction.allDirections) {

View File

@ -123,7 +123,7 @@ public class Flag {
public Set<UnionPosition> getUnionPositions() {
return this.unionPositions;
}
};
}
/**
* The shape of the "union", which generally depends on the
@ -135,7 +135,7 @@ public class Flag {
CHEVRON,
BEND,
RHOMBUS
};
}
/**
* The position of the "union", which depends on the alignment of

View File

@ -69,10 +69,10 @@ public class FreeColDialog<T> extends JDialog implements PropertyChangeListener
private static final Logger logger = Logger.getLogger(FreeColDialog.class.getName());
public static enum DialogType {
public enum DialogType {
PLAIN,
QUESTION,
};
}
/** The enclosing client. */
protected final FreeColClient freeColClient;

View File

@ -365,7 +365,7 @@ public final class NegotiationDialog extends FreeColDialog<DiplomaticTrade> {
super(new MigLayout("wrap 1", "", ""));
this.source = source;
this.goodsBox = new JComboBox<>(new DefaultComboBoxModel<Goods>());
this.goodsBox = new JComboBox<>(new DefaultComboBoxModel<>());
this.goodsBox.setRenderer(new GoodsBoxRenderer());
this.clearButton = Utility.localizedButton("negotiationDialog.clear");
this.clearButton.addActionListener(this);
@ -494,7 +494,7 @@ public final class NegotiationDialog extends FreeColDialog<DiplomaticTrade> {
this.source = source;
this.other = other;
this.victimBox = new JComboBox<>(new DefaultComboBoxModel<Player>());
this.victimBox = new JComboBox<>(new DefaultComboBoxModel<>());
this.victimBox.setRenderer(new InciteBoxRenderer());
this.clearButton = Utility.localizedButton("negotiationDialog.clear");
this.clearButton.addActionListener(this);
@ -615,7 +615,7 @@ public final class NegotiationDialog extends FreeColDialog<DiplomaticTrade> {
this.source = source;
this.target = target;
this.stanceBox = new JComboBox<>(new DefaultComboBoxModel<Stance>());
this.stanceBox = new JComboBox<>(new DefaultComboBoxModel<>());
this.stanceBox.setRenderer(new StanceBoxRenderer());
this.clearButton = Utility.localizedButton("negotiationDialog.clear");
this.clearButton.addActionListener(this);
@ -733,7 +733,7 @@ public final class NegotiationDialog extends FreeColDialog<DiplomaticTrade> {
super(new MigLayout("wrap 1", "", ""));
this.source = source;
this.unitBox = new JComboBox<>(new DefaultComboBoxModel<Unit>());
this.unitBox = new JComboBox<>(new DefaultComboBoxModel<>());
this.unitBox.setRenderer(new UnitBoxRenderer());
this.clearButton = Utility.localizedButton("negotiationDialog.clear");
this.clearButton.addActionListener(this);

View File

@ -253,7 +253,7 @@ public final class BaseTileTransitionImageCreator {
return null;
}
final ImageResource terrainImageResource;
final boolean notABeachTransition = borderingTile.isLand() || !borderingTile.isLand() && !tile.isLand();;
final boolean notABeachTransition = borderingTile.isLand() || !borderingTile.isLand() && !tile.isLand();
if (notABeachTransition) {
terrainImageResource = ImageCache.getImageResource(ImageLibrary.getTerrainImageKey(borderingTile.getType()));
} else {

View File

@ -38,7 +38,7 @@ public interface CargoLabel {
* @param cargoPanel The CargoPanel to affect.
* @return True if the component was added.
*/
public boolean addCargo(Component comp, Unit carrier, CargoPanel cargoPanel);
boolean addCargo(Component comp, Unit carrier, CargoPanel cargoPanel);
/**
@ -47,7 +47,7 @@ public interface CargoLabel {
* @param comp The Component to remove.
* @param cargoPanel The {@link CargoPanel} to affect.
*/
public default void removeCargo(Component comp, CargoPanel cargoPanel) {
default void removeCargo(Component comp, CargoPanel cargoPanel) {
cargoPanel.update();
}

View File

@ -27,5 +27,5 @@ public interface Draggable {
*
* @return True if the object is on a carrier.
*/
public boolean isOnCarrier();
boolean isOnCarrier();
}

View File

@ -106,7 +106,7 @@ public final class MapViewer extends FreeColClientHolder {
private static final Logger logger = Logger.getLogger(MapViewer.class.getName());
private static enum BorderType { COUNTRY, REGION }
private enum BorderType { COUNTRY, REGION }
/**
* Calculates what part of the {@link Map} is visible on screen. This includes handling

View File

@ -84,7 +84,7 @@ public final class OptionGroupUI extends MigPanel
Option option = (Option)node.getUserObject();
return Messages.getName(option.getId());
}
};
}
private final List<OptionUpdater> optionUpdaters = new ArrayList<>();

View File

@ -32,11 +32,11 @@ public interface OptionUpdater {
* Updates the value of the {@link net.sf.freecol.common.option.Option}
* this object keeps.
*/
public void updateOption();
void updateOption();
/**
* Reset with the value from the option.
*/
public void reset();
void reset();
}

View File

@ -1602,8 +1602,7 @@ public final class ColonyPanel extends PortPanel
*/
@Override
public JToolTip createToolTip() {
JToolTip toolTip = new RebelToolTip(getFreeColClient(), getColony());
return toolTip;
return new RebelToolTip(getFreeColClient(), getColony());
}

View File

@ -34,7 +34,7 @@ public interface DropTarget {
* @param goods The {@code Goods} to check.
* @return True if the goods are acceptable.
*/
public default boolean accepts(Goods goods) {
default boolean accepts(Goods goods) {
return false;
}
@ -44,7 +44,7 @@ public interface DropTarget {
* @param goodsType The {@code GoodsType} to check.
* @return True if the goods type is acceptable.
*/
public default boolean accepts(GoodsType goodsType) {
default boolean accepts(GoodsType goodsType) {
return false;
}
@ -54,7 +54,7 @@ public interface DropTarget {
* @param unit The {@code Unit} to check.
* @return True if the unit is acceptable.
*/
public default boolean accepts(Unit unit) {
default boolean accepts(Unit unit) {
return false;
}
@ -71,7 +71,7 @@ public interface DropTarget {
* currently selected carrier.
* @return The component argument on success, null on failure.
*/
public Component add(Component comp, boolean editState);
Component add(Component comp, boolean editState);
/**
* Get a suggested amount of goods to add, used when partial
@ -80,7 +80,7 @@ public interface DropTarget {
* @param goodsType The {@code GoodsType} proposed to add.
* @return A good amount of goods to add.
*/
public default int suggested(GoodsType goodsType) {
default int suggested(GoodsType goodsType) {
return -1; // Not applicable
}
}

View File

@ -592,7 +592,7 @@ public final class EuropePanel extends PortPanel {
}
public static enum EuropeAction {
public enum EuropeAction {
EXIT,
RECRUIT,
PURCHASE,

View File

@ -88,7 +88,7 @@ public final class FindSettlementPanel extends FreeColPanel
}
}
private static enum DisplayListOption {
private enum DisplayListOption {
ALL,
ONLY_NATIVES,
ONLY_EUROPEAN

View File

@ -258,8 +258,8 @@ public class FreeColImageBorder extends AbstractBorder {
return image;
}
final Dimension scaledDimensions = new Dimension(
(int) Math.round(image.getWidth() * scaleFactor),
(int) Math.round(image.getHeight() * scaleFactor)
Math.round(image.getWidth() * scaleFactor),
Math.round(image.getHeight() * scaleFactor)
);
return ir.getImage(scaledDimensions, false);
}

View File

@ -74,7 +74,7 @@ public final class InfoPanel extends FreeColPanel
private static final Logger logger = Logger.getLogger(InfoPanel.class.getName());
private static enum InfoPanelMode {
private enum InfoPanelMode {
NONE, END, MAP, TILE, UNIT;
}

View File

@ -101,8 +101,7 @@ public final class MainPanel extends FreeColPanel {
}
private JButton createImportantButton(Action action) {
final FreeColButton button = new FreeColButton(ButtonStyle.IMPORTANT, action);
return button;
return new FreeColButton(ButtonStyle.IMPORTANT, action);
}

View File

@ -66,7 +66,7 @@ public final class NewPanel extends FreeColPanel implements ItemListener {
private static final Logger logger = Logger.getLogger(NewPanel.class.getName());
/** The actions for this panel. */
private static enum NewPanelAction {
private enum NewPanelAction {
OK,
CANCEL,
SINGLE,
@ -74,7 +74,7 @@ public final class NewPanel extends FreeColPanel implements ItemListener {
START,
META_SERVER,
SHOW_DIFFICULTY
};
}
/**
* A particular specification to use for the new game. If not

View File

@ -35,7 +35,7 @@ public interface ColopediaDetailPanel<T> {
*
* @param root a {@code DefaultMutableTreeNode}
*/
public void addSubTrees(DefaultMutableTreeNode root);
void addSubTrees(DefaultMutableTreeNode root);
/**
* Builds the details panel for the given identifier.
@ -43,6 +43,6 @@ public interface ColopediaDetailPanel<T> {
* @param id The object identifier to display.
* @param panel the detail panel to build
*/
public void buildDetail(String id, JPanel panel);
void buildDetail(String id, JPanel panel);
}

View File

@ -86,7 +86,7 @@ public final class ReportCompactColonyPanel extends ReportPanel {
private static class ColonySummary {
/** Types of production for a given goods type. */
public static enum ProductionStatus {
public enum ProductionStatus {
FAIL, // Negative production and below low alarm level
BAD, // Negative production
NONE, // No production at all

View File

@ -113,7 +113,7 @@ public class FreeColLookAndFeel extends MetalLookAndFeel {
private static final String transparentPanelUI
= "net.sf.freecol.client.gui.plaf.FreeColTransparentPanelUI";
private static final Class uiClasses[] = {
private static final Class[] uiClasses = {
FreeColButtonUI.class,
FreeColCheckBoxMenuItemUI.class,
FreeColCheckBoxUI.class,

View File

@ -27,5 +27,5 @@ public interface VideoListener {
/**
* Called when a playback has stopped.
*/
public void stopped();
void stopped();
}

View File

@ -31,5 +31,5 @@ public interface ObjectWithId {
*
* @return The object identifier.
*/
public String getId();
String getId();
}

View File

@ -49,7 +49,7 @@ public class FreeColDebugger {
private static final Logger logger = Logger.getLogger(FreeColDebugger.class.getName());
/** The debug modes, any of which may be active. */
public static enum DebugMode {
public enum DebugMode {
COMMS, // Trace print full c-s communications, and verbose
// (non-i18n) server errors.
DESYNC,// Check frequently for desynchronization

View File

@ -55,7 +55,7 @@ public class NameCache {
private static final String[] DEFAULT_SEASON_IDS
= { "model.season.spring.name", "model.season.autumn.name" };
private final static String CIBOLA_PREFIX
private static final String CIBOLA_PREFIX
= "nameCache.lostCityRumour.cityName.";
/** Cities of Cibola. */

View File

@ -30,6 +30,6 @@ public interface Selector {
* the selector (only used for error reporting)
* @return a {@code String} value
*/
public String getKey(String selector, String template);
String getKey(String selector, String template);
}

View File

@ -90,7 +90,7 @@ public class FreeColXMLReader extends StreamReaderDelegate
"ProcessingInstruction", "Space", "StartDocument",
"StartElement" });
public static enum ReadScope {
public enum ReadScope {
SERVER, // Loading the game in the server
NORMAL, // Normal interning read
NOINTERN, // Do not intern any object that are read

View File

@ -65,7 +65,7 @@ public class FreeColXMLWriter implements Closeable, XMLStreamWriter {
private static final Logger logger = Logger.getLogger(FreeColXMLWriter.class.getName());
/** The scope of a FreeCol object write. */
public static enum WriteScopeType {
public enum WriteScopeType {
CLIENT, // Only the client-visible information
SERVER, // Full server-visible information
SAVE // Absolutely everything needed to save the game state

View File

@ -31,12 +31,12 @@ public interface ImageAnimationEvent extends AnimationEvent {
* Returns the image this event contains.
* @return The image to be displayed.
*/
public Image getImage();
Image getImage();
/**
* Returns the duration the image should be displayed.
* @return The amount of milliseconds to display the
* image.
*/
public int getDurationInMs();
int getDurationInMs();
}

View File

@ -121,7 +121,7 @@ public class MetaServerUtils {
null, -1, -1, -1, false, null, -1);
/** Type of message to send. */
private static enum MetaMessageType {
private enum MetaMessageType {
REGISTER,
REMOVE,
SERVERLIST,

View File

@ -41,7 +41,7 @@ public interface BaseProduction {
* the work, if null the unattended production is considered.
* @return The amount of goods produced.
*/
public default int getBaseProduction(ProductionType productionType,
default int getBaseProduction(ProductionType productionType,
GoodsType goodsType, UnitType unitType) {
if (goodsType == null) return 0;
if (productionType == null) {
@ -61,5 +61,5 @@ public interface BaseProduction {
* @param unattended Whether the production is unattended.
* @return A list of {@code ProductionType}s.
*/
public abstract List<ProductionType> getAvailableProductionTypes(boolean unattended);
List<ProductionType> getAvailableProductionTypes(boolean unattended);
}

View File

@ -50,7 +50,7 @@ public class Building extends WorkLocation
@SuppressWarnings("unused")
private static final Logger logger = Logger.getLogger(Building.class.getName());
private final static double EPSILON = 0.0001;
private static final double EPSILON = 0.0001;
public static final String TAG = "building";

View File

@ -72,7 +72,7 @@ public class Colony extends Settlement implements TradeLocation {
/** Number of colonies that a player will trade down to. */
public static final int TRADE_MARGIN = 5;
public static enum ColonyChangeEvent {
public enum ColonyChangeEvent {
POPULATION_CHANGE,
PRODUCTION_CHANGE,
BONUS_CHANGE,
@ -82,7 +82,7 @@ public class Colony extends Settlement implements TradeLocation {
}
/** Reasons for not building a buildable. */
public static enum NoBuildReason {
public enum NoBuildReason {
NONE,
NOT_BUILDING,
NOT_BUILDABLE,

View File

@ -31,7 +31,7 @@ import java.util.Set;
*/
public abstract class CombatModel {
public static enum CombatEffectType {
public enum CombatEffectType {
// Special results that set the sense of the result.
NO_RESULT,
LOSE,

View File

@ -28,13 +28,13 @@ package net.sf.freecol.common.model;
public interface Constants {
/** Generic "huge" value. */
public static final int INFINITY = Integer.MAX_VALUE;
int INFINITY = Integer.MAX_VALUE;
/** Generic "unsure" value. */
public static final int UNDEFINED = Integer.MIN_VALUE;
int UNDEFINED = Integer.MIN_VALUE;
/** The result of checkIntegrity. */
public static enum IntegrityType {
enum IntegrityType {
INTEGRITY_FAIL(-1),
INTEGRITY_FIXED(0),
INTEGRITY_GOOD(1);
@ -92,69 +92,69 @@ public interface Constants {
};
/** Actions when an armed unit contacts a settlement. */
public static enum ArmedUnitSettlementAction {
enum ArmedUnitSettlementAction {
SETTLEMENT_ATTACK,
SETTLEMENT_TRIBUTE,
}
/** Actions when dealing with a boycott. */
public static enum BoycottAction {
enum BoycottAction {
BOYCOTT_PAY_ARREARS,
BOYCOTT_DUMP_CARGO
}
/** Actions when claiming land. */
public static enum ClaimAction {
enum ClaimAction {
CLAIM_ACCEPT,
CLAIM_STEAL
}
/** Actions surrounding native demands at colonies. */
public static enum IndianDemandAction {
enum IndianDemandAction {
INDIAN_DEMAND_ACCEPT,
INDIAN_DEMAND_REJECT,
INDIAN_DEMAND_DONE
}
/** Actions with a missionary at a native settlement. */
public static enum MissionaryAction {
enum MissionaryAction {
MISSIONARY_ESTABLISH_MISSION,
MISSIONARY_DENOUNCE_HERESY,
MISSIONARY_INCITE_INDIANS
}
/** Actions in scouting a colony. */
public static enum ScoutColonyAction {
enum ScoutColonyAction {
SCOUT_COLONY_NEGOTIATE,
SCOUT_COLONY_SPY,
SCOUT_COLONY_ATTACK
}
/** Actions in scouting a native settlement. */
public static enum ScoutIndianSettlementAction {
enum ScoutIndianSettlementAction {
SCOUT_SETTLEMENT_SPEAK,
SCOUT_SETTLEMENT_TRIBUTE,
SCOUT_SETTLEMENT_ATTACK
}
/** Price used to denote claiming land by stealing it. */
public static final int STEAL_LAND = -1;
int STEAL_LAND = -1;
/** Choice of sales action at a native settlement. */
public static enum TradeAction {
enum TradeAction {
BUY,
SELL,
GIFT
}
/** Actions when buying from the natives. */
public static enum TradeBuyAction {
enum TradeBuyAction {
BUY,
HAGGLE
}
/** Actions when selling to the natives. */
public static enum TradeSellAction {
enum TradeSellAction {
SELL,
HAGGLE,
GIFT

View File

@ -33,39 +33,39 @@ import java.util.stream.Stream;
public interface Consumer {
/** Compare consumers by descending priority. */
public static final Comparator<Consumer> COMPARATOR
Comparator<Consumer> COMPARATOR
= Comparator.comparingInt(Consumer::getPriority).reversed();
/**
* Default consumption priority for the Colony when producing new
* colonists (from food).
*/
public static final int POPULATION_PRIORITY = 300;
int POPULATION_PRIORITY = 300;
/**
* The consumption priority of the colony build queue.
*/
public static final int COLONY_PRIORITY = 500;
int COLONY_PRIORITY = 500;
/**
* Default consumption priority for buildings. Individual building
* types may have different priorities.
*/
public static final int BUILDING_PRIORITY = 800;
int BUILDING_PRIORITY = 800;
/**
* Default consumption priority for units. Individual unit types
* may have different priorities. Slave units, or converts, or
* petty criminals, for example, might have a lower priority.
*/
public static final int UNIT_PRIORITY = 1000;
int UNIT_PRIORITY = 1000;
/**
* Returns a list of GoodsTypes this Consumer consumes.
*
* @return a {@code List} value
*/
public List<AbstractGoods> getConsumedGoods();
List<AbstractGoods> getConsumedGoods();
/**
* The priority of this Consumer. The higher the priority, the
@ -74,7 +74,7 @@ public interface Consumer {
*
* @return an {@code int} value
*/
public int getPriority();
int getPriority();
/**
* Get the modifier set with the given id. The modifier most
@ -85,5 +85,5 @@ public interface Consumer {
* @param id The object identifier.
* @return The stream of {@code Modifier}s found.
*/
public Stream<Modifier> getConsumptionModifiers(String id);
Stream<Modifier> getConsumptionModifiers(String id);
}

View File

@ -42,7 +42,7 @@ public class DiplomaticTrade extends FreeColGameObject {
public static final String TAG = "diplomaticTrade";
/** A context for the trade. */
public static enum TradeContext {
public enum TradeContext {
CONTACT, /** First contact between Europeans */
DIPLOMATIC, /** Scout negotiating */
TRADE, /** Carrier trading */
@ -59,7 +59,7 @@ public class DiplomaticTrade extends FreeColGameObject {
}
/** A type for the trade status. */
public static enum TradeStatus {
public enum TradeStatus {
PROPOSE_TRADE,
ACCEPT_TRADE,
REJECT_TRADE

View File

@ -44,7 +44,7 @@ public enum Direction implements Named {
W (-1, 0, -1, 0),
NW ( 0, -1, -1, -1);
public final static int NUMBER_OF_DIRECTIONS = values().length;
public static final int NUMBER_OF_DIRECTIONS = values().length;
public static final List<Direction> allDirections
= makeUnmodifiableList(Direction.N, Direction.NE,

View File

@ -45,7 +45,7 @@ public class Disaster extends FreeColSpecObjectType {
public static final String BANKRUPTCY = "model.disaster.bankruptcy";
/** Whether to apply one, many or all applicable disasters. */
public static enum Effects { ONE, SEVERAL, ALL };
public enum Effects { ONE, SEVERAL, ALL };
/** Whether this disaster is natural. Defaults to false. */

View File

@ -80,7 +80,7 @@ public class Europe extends UnitLocation
* The following constant should be used when the random choice
* behaviour is desired.
*/
public static enum MigrationType {
public enum MigrationType {
NORMAL, // Unit decided to migrate
RECRUIT, // Player is paying
FOUNTAIN, // As a result of a Fountain of Youth discovery

View File

@ -41,7 +41,7 @@ public class FoundingFather extends FreeColSpecObjectType {
public static final String TAG = "founding-father";
public static enum FoundingFatherType {
public enum FoundingFatherType {
TRADE,
EXPLORATION,
MILITARY,

View File

@ -33,14 +33,14 @@ public interface FreeColGameObjectListener {
* @param id The object identifier.
* @param fcgo The new {@code FreeColGameObject}.
*/
public void setFreeColGameObject(String id, FreeColGameObject fcgo);
void setFreeColGameObject(String id, FreeColGameObject fcgo);
/**
* Notify a listener (if any) of that an object has gone.
*
* @param id The object identifier.
*/
public void removeFreeColGameObject(String id);
void removeFreeColGameObject(String id);
/**
* Notify a listener (if any) of that an object has changed owner.
@ -49,6 +49,6 @@ public interface FreeColGameObjectListener {
* @param oldOwner The old owning {@code Player}.
* @param newOwner The new owning {@code Player}.
*/
public void ownerChanged(FreeColGameObject source,
void ownerChanged(FreeColGameObject source,
Player oldOwner, Player newOwner);
}

View File

@ -73,7 +73,7 @@ public class Game extends FreeColGameObject {
public static final String TAG = "game";
/** Reasons for logging out. */
public static enum LogoutReason {
public enum LogoutReason {
DEFEATED, // Game over, player lost
LOGIN, // Logging in again FIXME: this should go away
LOGOUT, // Player quits but game continues
@ -84,7 +84,7 @@ public class Game extends FreeColGameObject {
};
/** State for the FCGO iterator, out here because it has to be static. */
private static enum FcgoState {
private enum FcgoState {
INVALID,
VALID,
CONSUMED,

View File

@ -68,7 +68,7 @@ public class HighScore extends FreeColObject {
* On retirement, an object will be named in honour of the
* player. The nature of the object depends on the player's score.
*/
public static enum ScoreLevel {
public enum ScoreLevel {
CONTINENT(40000),
COUNTRY(35000),
STATE(30000),

View File

@ -35,7 +35,7 @@ public class HistoryEvent extends StringTemplate {
public static final String TAG = "historyEvent";
public static enum HistoryEventType implements Named {
public enum HistoryEventType implements Named {
DISCOVER_NEW_WORLD,
DISCOVER_REGION,
MEET_NATION,

View File

@ -69,7 +69,7 @@ public class IndianSettlement extends Settlement implements TradeLocation {
public static final String TAG = "indianSettlement";
/** The level of contact between a player and this settlement. */
public static enum ContactLevel {
public enum ContactLevel {
UNCONTACTED, // Nothing known other than location?
CONTACTED, // Name, wanted-goods now visible
VISITED, // Skill now known

View File

@ -39,7 +39,7 @@ public final class Limit extends FreeColSpecObjectType {
public static final String TAG = "limit";
/** The basic operation used in evaluating this limit. */
public static enum Operator {
public enum Operator {
EQ, LT, GT, LE, GE
}

View File

@ -30,7 +30,7 @@ public interface Locatable {
*
* @return The location of this {@code Locatable}.
*/
public Location getLocation();
Location getLocation();
/**
* Sets the location for this {@code Locatable}.
@ -39,14 +39,14 @@ public interface Locatable {
* {@code Locatable}.
* @return True if the location change succeeds.
*/
public boolean setLocation(Location newLocation);
boolean setLocation(Location newLocation);
/**
* Is this locatable in Europe.
*
* @return True if the {@code Locatable} is in {@code Europe}.
*/
public boolean isInEurope();
boolean isInEurope();
/**
* Get the {@code Tile} where this {@code Locatable} is
@ -55,7 +55,7 @@ public interface Locatable {
* @return The {@code Tile} where this {@code Locatable}
* is located, if any.
*/
public Tile getTile();
Tile getTile();
/**
* Gets the number of cargo slots consumed when this
@ -63,5 +63,5 @@ public interface Locatable {
*
* @return The number of cargo slots required.
*/
public int getSpaceTaken();
int getSpaceTaken();
}

View File

@ -35,9 +35,9 @@ public interface Location extends ObjectWithId {
// "Rank" constants for location ordering.
// Tile ranks are distinct and non-negative.
// Other locations devolve to {europe,highseas,tile} rank.
public static final int LOCATION_RANK_NOWHERE = -3;
public static final int LOCATION_RANK_EUROPE = -2;
public static final int LOCATION_RANK_HIGHSEAS = -1;
int LOCATION_RANK_NOWHERE = -3;
int LOCATION_RANK_EUROPE = -2;
int LOCATION_RANK_HIGHSEAS = -1;
/**
* Gets the identifier of this {@code Location}.
@ -46,21 +46,21 @@ public interface Location extends ObjectWithId {
* @see FreeColGameObject#getId
*/
@Override
public String getId();
String getId();
/**
* Gets the Tile associated with this Location.
*
* @return The Tile associated with this Location, or null if none found.
*/
public Tile getTile();
Tile getTile();
/**
* Get a label for this location.
*
* @return A label for this location.
*/
public StringTemplate getLocationLabel();
StringTemplate getLocationLabel();
/**
* Get a label for this location for a particular player.
@ -68,7 +68,7 @@ public interface Location extends ObjectWithId {
* @param player The {@code Player} to return the name for.
* @return A label for this location.
*/
public StringTemplate getLocationLabelFor(Player player);
StringTemplate getLocationLabelFor(Player player);
/**
* Adds a {@code Locatable} to this Location.
@ -76,7 +76,7 @@ public interface Location extends ObjectWithId {
* @param locatable The {@code Locatable} to add to this Location.
* @return True if the locatable was added.
*/
public boolean add(Locatable locatable);
boolean add(Locatable locatable);
/**
* Removes a {@code Locatable} from this Location.
@ -85,7 +85,7 @@ public interface Location extends ObjectWithId {
* Location.
* @return True if the locatable was removed.
*/
public boolean remove(Locatable locatable);
boolean remove(Locatable locatable);
/**
* Checks if this {@code Location} contains the specified
@ -94,7 +94,7 @@ public interface Location extends ObjectWithId {
* @param locatable The {@code Locatable} to test the presence of.
* @return True if the locatable is present at this location.
*/
public boolean contains(Locatable locatable);
boolean contains(Locatable locatable);
/**
* Checks whether or not the specified locatable may be added to this
@ -103,28 +103,28 @@ public interface Location extends ObjectWithId {
* @param locatable The {@code Locatable} to add.
* @return True if the locatable can be added to this location.
*/
public boolean canAdd(Locatable locatable);
boolean canAdd(Locatable locatable);
/**
* Gets the number of units at this Location.
*
* @return The number of units at this Location.
*/
public int getUnitCount();
int getUnitCount();
/**
* Gets a stream of all the units present at this location.
*
* @return A stream of all the units at this location.
*/
public Stream<Unit> getUnits();
Stream<Unit> getUnits();
/**
* Gets a list of all the units present at this location.
*
* @return A list of all the units at this location.
*/
public List<Unit> getUnitList();
List<Unit> getUnitList();
/**
* Gets the {@code GoodsContainer} this {@code Location} use
@ -133,7 +133,7 @@ public interface Location extends ObjectWithId {
* @return The {@code GoodsContainer} or {@code null} if the
* {@code Location} cannot store any goods.
*/
public GoodsContainer getGoodsContainer();
GoodsContainer getGoodsContainer();
/**
* Gets the {@code Settlement} this {@code Location} is
@ -141,7 +141,7 @@ public interface Location extends ObjectWithId {
*
* @return The associated {@code Settlement}, or null if none.
*/
public Settlement getSettlement();
Settlement getSettlement();
/**
* Get the colony at this location.
@ -149,7 +149,7 @@ public interface Location extends ObjectWithId {
* @return A {@code Colony} at this location if any, or null
* if none found.
*/
public Colony getColony();
Colony getColony();
/**
* Gets the native settlement at this location.
@ -157,7 +157,7 @@ public interface Location extends ObjectWithId {
* @return The {@code IndianSettlement} at this location if
* any, or null if none found.
*/
public IndianSettlement getIndianSettlement();
IndianSettlement getIndianSettlement();
/**
* Promote this location to a more meaningful one if possible.
@ -167,7 +167,7 @@ public interface Location extends ObjectWithId {
*
* @return A more meaningful {@code Location}, or this one.
*/
public Location up();
Location up();
/**
* Get a integer for this location, for the benefit of location
@ -175,14 +175,14 @@ public interface Location extends ObjectWithId {
*
* @return A suitable integer.
*/
public int getRank();
int getRank();
/**
* Get a short description of this location.
*
* @return A short description.
*/
public String toShortString();
String toShortString();
/**
@ -191,7 +191,7 @@ public interface Location extends ObjectWithId {
* @param loc The {@code Location} to improve.
* @return The improved {@code Location}.
*/
public static Location upLoc(Location loc) {
static Location upLoc(Location loc) {
return (loc == null) ? null : loc.up();
}
@ -201,7 +201,7 @@ public interface Location extends ObjectWithId {
* @param loc A {@code Location} to check.
* @return The integer rank of the given location.
*/
public static int rankOf(Location loc) {
static int rankOf(Location loc) {
return (loc == null) ? Location.LOCATION_RANK_NOWHERE : loc.getRank();
}
@ -210,7 +210,7 @@ public interface Location extends ObjectWithId {
*
* @return A key for image lookup, null by default.
*/
public default String getLocationImageKey() {
default String getLocationImageKey() {
return null;
}
}

View File

@ -56,7 +56,7 @@ public class LostCityRumour extends TileItem {
private static int rumourNothing = -1;
/** Constants describing types of Lost City Rumours. */
public static enum RumourType {
public enum RumourType {
NO_SUCH_RUMOUR,
BURIAL_GROUND,
EXPEDITION_VANISHES,

View File

@ -84,19 +84,19 @@ public class Map extends FreeColGameObject implements Location, Iterable<Tile> {
* Possible actions by the unit travelling along a path in consideration
* of the next tile.
*/
private static enum MoveStep { FAIL, BYLAND, BYWATER, EMBARK, DISEMBARK };
private enum MoveStep { FAIL, BYLAND, BYWATER, EMBARK, DISEMBARK };
/**
* The number of tiles from the upper edge that are considered
* polar by default.
*/
public final static int POLAR_HEIGHT = 2;
public static final int POLAR_HEIGHT = 2;
/**
* The layers included in the map. The RIVERS layer includes all
* natural tile improvements that are not resources.
*/
public static enum Layer {
public enum Layer {
NONE, LAND, TERRAIN, REGIONS, RIVERS, RESOURCES, RUMOURS, NATIVES, ALL;
};

View File

@ -56,7 +56,7 @@ public final class Market extends FreeColGameObject implements Ownable {
* Constant for specifying the access to this {@code Market}
* when selling goods.
*/
public static enum Access {
public enum Access {
EUROPE,
CUSTOM_HOUSE,
}

View File

@ -47,7 +47,7 @@ public class ModelMessage extends StringTemplate {
* When this changes, be sure to update client-options.xml and the
* messages file appropriately.
*/
public static enum MessageType implements Named {
public enum MessageType implements Named {
DEFAULT(""),
BUILDING_COMPLETED("model.option.guiShowBuildingCompleted"),
COMBAT_RESULT(null), // No option, always display
@ -284,7 +284,7 @@ public class ModelMessage extends StringTemplate {
* @param source The source object
* @return An object to be displayed for the message.
*/
static private FreeColObject getDefaultDisplay(MessageType messageType,
private static FreeColObject getDefaultDisplay(MessageType messageType,
FreeColGameObject source) {
FreeColObject o = null;
switch (messageType) {

View File

@ -161,7 +161,7 @@ public class Modifier extends Feature {
public static final int ROLE_COMBAT_INDEX = 30;
public static final int GENERAL_COMBAT_INDEX = 50;
public static enum ModifierType {
public enum ModifierType {
ADDITIVE,
MULTIPLICATIVE,
PERCENTAGE

View File

@ -54,7 +54,7 @@ public final class Monarch extends FreeColGameObject implements Named {
public static final String TAG = "monarch";
/** Constants describing monarch actions. */
public static enum MonarchAction {
public enum MonarchAction {
NO_ACTION,
RAISE_TAX_ACT,
RAISE_TAX_WAR,

View File

@ -31,7 +31,7 @@ public interface Movable {
*
* @return The amount of moves this Movable has left.
*/
public int getMovesLeft();
int getMovesLeft();
/**
* Gets the amount of moves this Movable has at the beginning of
@ -40,5 +40,5 @@ public interface Movable {
* @return The amount of moves this Movable has at the beginning
* of each turn.
*/
public int getInitialMovesLeft();
int getInitialMovesLeft();
}

View File

@ -30,13 +30,13 @@ public interface Nameable {
*
* @return The name of the {@code Nameable}.
*/
public String getName();
String getName();
/**
* Sets the name for this {@code Nameable}.
*
* @param newName The new name for the {@code Nameable}.
*/
public void setName(String newName);
void setName(String newName);
}

View File

@ -33,5 +33,5 @@ public interface Named {
*
* @return The name of the {@code Named}.
*/
public String getNameKey();
String getNameKey();
}

View File

@ -43,7 +43,7 @@ public class NationOptions extends FreeColSpecObject {
public static final String TAG = "nationOptions";
/** Type of national advantages for European players. */
public static enum Advantages implements Named {
public enum Advantages implements Named {
NONE,
FIXED,
SELECTABLE;
@ -76,7 +76,7 @@ public class NationOptions extends FreeColSpecObject {
* Nations may be available to all players, to AI players only, or
* to no players.
*/
public static enum NationState implements Named {
public enum NationState implements Named {
AVAILABLE,
AI_ONLY,
NOT_AVAILABLE;

View File

@ -36,7 +36,7 @@ import static net.sf.freecol.common.util.StringUtils.*;
*/
public abstract class NationType extends FreeColSpecObjectType {
public static enum SettlementNumber {
public enum SettlementNumber {
LOW, AVERAGE, HIGH;
/**
@ -49,7 +49,7 @@ public abstract class NationType extends FreeColSpecObjectType {
}
}
public static enum AggressionLevel {
public enum AggressionLevel {
LOW, AVERAGE, HIGH;
/**

View File

@ -46,7 +46,7 @@ public class NativeTrade extends FreeColGameObject {
= StringTemplate.template("");
/** The type of native trade command. */
public static enum NativeTradeAction {
public enum NativeTradeAction {
// Requests from European trader
OPEN(false, true), // Start a new trade session
CLOSE(true, true), // End an existing session

View File

@ -50,11 +50,11 @@ public class Operand extends Scope {
private static final Logger logger = Logger.getLogger(Operand.class.getName());
public static enum OperandType {
public enum OperandType {
UNITS, BUILDINGS, SETTLEMENTS, FOUNDING_FATHERS, YEAR, OPTION, NONE
}
public static enum ScopeLevel {
public enum ScopeLevel {
SETTLEMENT, PLAYER, GAME, NONE
}

View File

@ -32,7 +32,7 @@ public interface Ownable {
*
* @return The {@code Player} controlling this {@code Ownable}.
*/
public Player getOwner();
Player getOwner();
/**
* Sets the owner of this {@code Ownable}.
@ -41,5 +41,5 @@ public interface Ownable {
* of this {@code Ownable}.
* @exception UnsupportedOperationException if not implemented.
*/
public void setOwner(Player p);
void setOwner(Player p);
}

View File

@ -96,12 +96,12 @@ public class Player extends FreeColGameObject implements Nameable {
//
/** Types of players. */
public static enum PlayerType {
public enum PlayerType {
NATIVE, COLONIAL, REBEL, INDEPENDENT, ROYAL, UNDEAD, RETIRED
}
/** Colony value categories. */
public static enum ColonyValueCategory {
public enum ColonyValueCategory {
A_OVERRIDE, // override slot containing showstopper NoValueType values
A_PROD, // general production level
A_TILE, // strangeness with the tile
@ -127,7 +127,7 @@ public class Player extends FreeColGameObject implements Nameable {
}
/** Special return values for showstopper getColonyValue fail. */
public static enum NoValueType {
public enum NoValueType {
BOGUS(-1), // bad value from canClaimToFoundSettlementReason
TERRAIN(-2), // can not settle on tile (e.g. moutain, water)
RUMOUR(-3), // LCR present
@ -3341,7 +3341,7 @@ public class Player extends FreeColGameObject implements Nameable {
* to found a settlement or just to be used by one, including the
* double negative NONE == "no reason" case.
*/
public static enum NoClaimReason implements Named {
public enum NoClaimReason implements Named {
NONE, // Actually, tile can be claimed
TERRAIN, // Not on settleable terrain
RUMOUR, // Europeans can not claim tiles with LCR

View File

@ -56,7 +56,7 @@ public class Region extends FreeColGameObject implements Nameable {
public static final String PACIFIC_KEY = "model.region.pacific";
/** The type of region. */
public static enum RegionType implements Named {
public enum RegionType implements Named {
OCEAN(false),
COAST(false),
LAKE(false),

View File

@ -91,7 +91,7 @@ public final class Specification implements OptionContainer {
// Special reader classes for spec objects
private interface ChildReader {
public void readChildren(FreeColXMLReader xr) throws XMLStreamException;
void readChildren(FreeColXMLReader xr) throws XMLStreamException;
}
/**
@ -794,7 +794,7 @@ public final class Specification implements OptionContainer {
String agesValue = "";
if (!badAges) {
agesValue = getText(GameOptions.AGES);
String a[] = agesValue.split(",");
String[] a = agesValue.split(",");
badAges = a.length != NUMBER_OF_AGES-1;
if (!badAges) {
try {

View File

@ -63,7 +63,7 @@ public class StringTemplate extends FreeColObject {
* value of the key, or LABEL, a separator string that will be
* used to join the replacement values.
*/
public static enum TemplateType { NAME, KEY, TEMPLATE, LABEL }
public enum TemplateType { NAME, KEY, TEMPLATE, LABEL }
/** The TemplateType of this StringTemplate. Defaults to KEY. */
private TemplateType templateType = TemplateType.KEY;

View File

@ -68,7 +68,7 @@ public class Tension implements Named {
/**
* Constants for describing alarm levels.
*/
public static enum Level {
public enum Level {
HAPPY(100),
CONTENT(600),
DISPLEASED(700),

View File

@ -45,7 +45,7 @@ public final class TileType extends FreeColSpecObjectType
public static final String TAG = "tile-type";
public static enum RangeType { HUMIDITY, TEMPERATURE, ALTITUDE };
public enum RangeType { HUMIDITY, TEMPERATURE, ALTITUDE };
public static final int HILLS_ALTITUDE = 15;
public static final int MOUNTAINS_ALTITUDE = 25;

View File

@ -35,7 +35,7 @@ public interface TradeLocation {
* @param goodsType The {@code GoodsType} to check.
* @return The amount of goods present.
*/
public int getAvailableGoodsCount(GoodsType goodsType);
int getAvailableGoodsCount(GoodsType goodsType);
/**
* Gets the amount of a given goods type that can be exported from
@ -45,7 +45,7 @@ public interface TradeLocation {
* @param turns The number of turns before the goods is required.
* @return The amount of goods to export.
*/
public int getExportAmount(GoodsType goodsType, int turns);
int getExportAmount(GoodsType goodsType, int turns);
/**
* Gets the amount of a given goods type that can be imported to
@ -55,7 +55,7 @@ public interface TradeLocation {
* @param turns The number of turns before the goods will arrive.
* @return The amount of goods to import.
*/
public int getImportAmount(GoodsType goodsType, int turns);
int getImportAmount(GoodsType goodsType, int turns);
/**
* Function for returning the name of a TradeLocation
@ -63,7 +63,7 @@ public interface TradeLocation {
* @param tradeLocation The {@code TradeLocation} to return the name.
* @return The name.
*/
public String getLocationName(TradeLocation tradeLocation);
String getLocationName(TradeLocation tradeLocation);
/**
* Get the name of this instance as a JLabel.
@ -71,7 +71,7 @@ public interface TradeLocation {
* @return The {@code JLabel} with the result of
* {@link #getLocationName(TradeLocation)}
*/
public default JLabel getNameAsJlabel() {
default JLabel getNameAsJlabel() {
return new JLabel(getLocationName(this));
}
@ -81,7 +81,7 @@ public interface TradeLocation {
*
* @return True if possible, false by default.
*/
public default boolean canBeInput() {
default boolean canBeInput() {
return false;
}
}

View File

@ -33,7 +33,7 @@ public interface TransactionListener {
* @param amount The amount of goods which have been purchased
* @param price The unit price of the goods
*/
public void logPurchase(GoodsType goodsType, int amount, int price);
void logPurchase(GoodsType goodsType, int amount, int price);
/**
* Logs a sale
@ -43,5 +43,5 @@ public interface TransactionListener {
* @param price The unit price of the goods
* @param tax The tax which has been applied
*/
public void logSale(GoodsType goodsType, int amount, int price, int tax);
void logSale(GoodsType goodsType, int amount, int price, int tax);
}

View File

@ -189,7 +189,7 @@ public class Unit extends GoodsLocation
!u.isNaval() && u.getState() == UnitState.SENTRY;
/** A state a Unit can have. */
public static enum UnitState {
public enum UnitState {
ACTIVE,
FORTIFIED,
SENTRY,
@ -209,7 +209,7 @@ public class Unit extends GoodsLocation
}
/** Internal state for findIntermediatePort. */
private static enum PortMode {
private enum PortMode {
LAKE,
NO_HIGH_SEAS,
BLOCKED,
@ -387,7 +387,7 @@ public class Unit extends GoodsLocation
}
/** What type of unit label do we want? */
public static enum UnitLabelType {
public enum UnitLabelType {
PLAIN, // Just the basics
NATIONAL, // Add the nation
FULL // Add the equipment and extras
@ -2115,7 +2115,7 @@ public class Unit extends GoodsLocation
*
* @see Unit#getMoveType(Direction)
*/
public static enum MoveType {
public enum MoveType {
MOVE(null, true),
MOVE_HIGH_SEAS(null, true),
EXPLORE_LOST_CITY_RUMOUR(null, true),

View File

@ -53,7 +53,7 @@ public abstract class UnitLocation extends FreeColGameObject implements Location
private static final Logger logger = Logger.getLogger(UnitLocation.class.getName());
public static enum NoAddReason {
public enum NoAddReason {
/**
* No reason why Locatable can not be added.
*/

View File

@ -154,7 +154,7 @@ public class CompoundMission extends AbstractMission {
// Serialization.
private final static String INDEX_TAG = "index";
private static final String INDEX_TAG = "index";
/**

View File

@ -34,7 +34,7 @@ import net.sf.freecol.common.model.Unit;
*/
public interface Mission {
public static enum MissionState {
enum MissionState {
/**
* Mission is in progress.
*/
@ -61,7 +61,7 @@ public interface Mission {
*
* @return a {@code MissionState} value
*/
public MissionState doMission();
MissionState doMission();
/**
@ -72,7 +72,7 @@ public interface Mission {
*
* @return a {@code boolean} value
*/
public boolean isValid();
boolean isValid();
/**
@ -80,7 +80,7 @@ public interface Mission {
*
* @return an {@code Unit} value
*/
public Unit getUnit();
Unit getUnit();
/**
* This method writes an XML-representation of this object to
@ -90,5 +90,5 @@ public interface Mission {
* @throws XMLStreamException if there are any problems writing
* to the stream.
*/
public void toXML(FreeColXMLWriter xw) throws XMLStreamException;
void toXML(FreeColXMLWriter xw) throws XMLStreamException;
}

View File

@ -31,7 +31,7 @@ import net.sf.freecol.common.model.Unit;
*/
public interface CostDecider {
public static final int ILLEGAL_MOVE = -1;
int ILLEGAL_MOVE = -1;
/**
* Determines the cost of a single move.
@ -45,7 +45,7 @@ public interface CostDecider {
* @return The cost of moving the given unit from the
* {@code oldLocation} to the {@code newLocation}.
*/
public int getCost(Unit unit, Location oldLocation, Location newLocation,
int getCost(Unit unit, Location oldLocation, Location newLocation,
int movesLeftBefore);
/**
@ -54,13 +54,13 @@ public interface CostDecider {
*
* @return The number of moves left.
*/
public int getMovesLeft();
int getMovesLeft();
/**
* Gets the number of turns consumed.
* This method should be called after invoking {@link #getCost}.
*
* @return The number of turns consumed.
*/
public int getNewTurns();
*/
int getNewTurns();
}

View File

@ -47,7 +47,7 @@ public interface GoalDecider {
* @return The {@code PathNode} where the {@code Tile}
* returned by {@code pathNode.getTile()} is the goal.
*/
public PathNode getGoal();
PathNode getGoal();
/**
* Determines whether this {@code GoalDecider} has any
@ -56,7 +56,7 @@ public interface GoalDecider {
* @return {@code true} if there are any sub goals
* and {@code false} otherwise.
*/
public boolean hasSubGoals();
boolean hasSubGoals();
/**
* Checks whether the given {@code PathNode} is a
@ -74,5 +74,5 @@ public interface GoalDecider {
* {@code true} and {@link #hasSubGoals()} returns
* {@code false}.
*/
public boolean check(Unit u, PathNode pathNode);
boolean check(Unit u, PathNode pathNode);
}

View File

@ -56,7 +56,7 @@ import net.sf.freecol.common.option.GameOptions;
* Calculates the production for a building of a given type.
*/
public class BuildingProductionCalculator {
private final static double EPSILON = 0.0001;
private static final double EPSILON = 0.0001;
private Player owner;

View File

@ -60,7 +60,7 @@ public abstract class Message {
* A map of message name to message constructors, built on the fly
* as new messages are encountered and suitable constructors found.
*/
private final static Map<String, Constructor<? extends Message>> builders
private static final Map<String, Constructor<? extends Message>> builders
= Collections.synchronizedMap(new HashMap<String,
Constructor<? extends Message>>());
@ -70,7 +70,7 @@ public abstract class Message {
// Convenient way to specify the relative priorities of the messages
// types in one place.
public static enum MessagePriority {
public enum MessagePriority {
ATTRIBUTE(-1), // N/A
ANIMATION(0), // Do animations first
REMOVE(100), // Do removes last
@ -114,14 +114,14 @@ public abstract class Message {
*
* @return The message tag.
*/
abstract public String getType();
public abstract String getType();
/**
* Set the message tag.
*
* @param type The new message tag.
*/
abstract protected void setType(String type);
protected abstract void setType(String type);
/**
* Checks if an attribute is present in this message.
@ -129,7 +129,7 @@ public abstract class Message {
* @param key The attribute to look for.
* @return True if the attribute is present.
*/
abstract protected boolean hasAttribute(String key);
protected abstract boolean hasAttribute(String key);
/**
* Get a string attribute value.
@ -137,7 +137,7 @@ public abstract class Message {
* @param key The attribute to look for.
* @return The string value found, or null if the attribute was absent.
*/
abstract protected String getStringAttribute(String key);
protected abstract String getStringAttribute(String key);
/**
* Sets an attribute in this message.
@ -145,35 +145,35 @@ public abstract class Message {
* @param key The attribute to set.
* @param value The new value of the attribute.
*/
abstract protected void setStringAttribute(String key, String value);
protected abstract void setStringAttribute(String key, String value);
/**
* Get a map of all the attributes in this message.
*
* @return A {@code Map} of the attributes.
*/
abstract protected Map<String,String> getStringAttributeMap();
protected abstract Map<String,String> getStringAttributeMap();
/**
* Get the number of child objects.
*
* @return The child count.
*/
abstract protected int getChildCount();
protected abstract int getChildCount();
/**
* Get the child objects of this message.
*
* @return A list of child {@code FreeColObject}s.
*/
abstract protected List<FreeColObject> getChildren();
protected abstract List<FreeColObject> getChildren();
/**
* Set the list of objects attached to this message.
*
* @param fcos The new list of attached {@code FreeColObject}s.
*/
abstract protected void setChildren(List<? extends FreeColObject> fcos);
protected abstract void setChildren(List<? extends FreeColObject> fcos);
/**
* Append a new child.
@ -181,7 +181,7 @@ public abstract class Message {
* @param <T> The child type.
* @param fco The new child object.
*/
abstract protected <T extends FreeColObject> void appendChild(T fco);
protected abstract <T extends FreeColObject> void appendChild(T fco);
/**
* Append a multiple new children.
@ -189,21 +189,21 @@ public abstract class Message {
* @param <T> The child type.
* @param fcos The new child objects.
*/
abstract protected <T extends FreeColObject> void appendChildren(Collection<T> fcos);
protected abstract <T extends FreeColObject> void appendChildren(Collection<T> fcos);
/**
* Should this message only be sent to a server by the current player?
*
* @return True if this is a current-player-only message.
*/
abstract public boolean currentPlayerMessage();
public abstract boolean currentPlayerMessage();
/**
* Get the priority of this type of message.
*
* @return The message priority.
*/
abstract public MessagePriority getPriority();
public abstract MessagePriority getPriority();
/**
@ -225,7 +225,7 @@ public abstract class Message {
* @param aiPlayer The {@code AIPlayer} the message was sent to.
* @exception FreeColException if there is a problem handling the message.
*/
abstract public void aiHandler(FreeColServer freeColServer,
public abstract void aiHandler(FreeColServer freeColServer,
AIPlayer aiPlayer) throws FreeColException;
/**
@ -236,7 +236,7 @@ public abstract class Message {
* @param freeColClient The {@code FreeColClient} to handle this message.
* @exception FreeColException if there is a problem building the message.
*/
abstract public void clientHandler(FreeColClient freeColClient)
public abstract void clientHandler(FreeColClient freeColClient)
throws FreeColException;
/**
@ -246,7 +246,7 @@ public abstract class Message {
* @param serverPlayer The {@code ServerPlayer} that sent the request.
* @return A {@code ChangeSet} defining the response.
*/
abstract public ChangeSet serverHandler(FreeColServer freeColServer,
public abstract ChangeSet serverHandler(FreeColServer freeColServer,
ServerPlayer serverPlayer);

View File

@ -38,7 +38,7 @@ public interface MessageHandler {
* @return A reply message, if any.
* @exception FreeColException if the message is malformed.
*/
public Message handle(Connection connection, Message message)
Message handle(Connection connection, Message message)
throws FreeColException;
/**
@ -50,6 +50,6 @@ public interface MessageHandler {
* @exception XMLStreamException if there is a problem reading the
* message.
*/
public Message read(Connection connection)
Message read(Connection connection)
throws FreeColException, XMLStreamException;
}

View File

@ -38,35 +38,35 @@ public interface Option<T> extends Cloneable, ObjectWithId {
* @return A clone of this option.
* @exception CloneNotSupportedException if we can not clone.
*/
public Option<T> cloneOption() throws CloneNotSupportedException;
Option<T> cloneOption() throws CloneNotSupportedException;
/**
* Gets the option group identifier for this option.
*
* @return The option group identifier.
*/
public String getGroup();
String getGroup();
/**
* Set the option group for this option.
*
* @param group The identifier for the option group.
*/
public void setGroup(String group);
void setGroup(String group);
/**
* Gets the value of this option.
*
* @return The value of this {@code Option}.
*/
public T getValue();
T getValue();
/**
* Sets the value of this option.
*
* @param value The new value of this {@code Option}.
*/
public void setValue(T value);
void setValue(T value);
/**
* Gets the key of an {@code BooleanOption} that must be true for this
@ -74,7 +74,7 @@ public interface Option<T> extends Cloneable, ObjectWithId {
*
* @return The key of the {@code BooleanOption} that needs to be enabled.
*/
public String getEnabledBy();
String getEnabledBy();
/**
* Initializes this object from an XML-representation of this object.
@ -82,7 +82,7 @@ public interface Option<T> extends Cloneable, ObjectWithId {
* @param xr The input stream with the XML.
* @throws XMLStreamException if there are any problems reading the stream.
*/
public void readFromXML(FreeColXMLReader xr) throws XMLStreamException;
void readFromXML(FreeColXMLReader xr) throws XMLStreamException;
/**
* Makes an XML-representation of this object.
@ -90,11 +90,11 @@ public interface Option<T> extends Cloneable, ObjectWithId {
* @param xw The {@code FreeColXMLWriter} to write to.
* @throws XMLStreamException if there are any problems writing the stream.
*/
public void toXML(FreeColXMLWriter xw) throws XMLStreamException;
void toXML(FreeColXMLWriter xw) throws XMLStreamException;
/**
* {@inheritDoc}
*/
@Override
public String toString();
String toString();
}

View File

@ -40,7 +40,7 @@ public interface OptionContainer {
* @param returnClass The expected option class.
* @return True if the option is present.
*/
public <T extends Option> boolean hasOption(String id, Class<T> returnClass);
<T extends Option> boolean hasOption(String id, Class<T> returnClass);
/**
* Get an option in this group (or descendents) by object identifier.
@ -51,7 +51,7 @@ public interface OptionContainer {
* @return The option, or a run time exception if the option does not
* exist or is of the wrong class.
*/
public <T extends Option> T getOption(String id, Class<T> returnClass);
<T extends Option> T getOption(String id, Class<T> returnClass);
/**
* Gets the value of a {@code BooleanOption}.

View File

@ -46,7 +46,7 @@ public class UnitTypeOption extends AbstractOption<UnitType> {
/**
* FIXME: replace with Predicates.
*/
public static enum TypeSelector {
public enum TypeSelector {
UNITS, IMMIGRANTS, LAND_UNITS, NAVAL_UNITS
}

View File

@ -76,7 +76,7 @@ public class OSUtils {
*
* @param url The URL to launch
*/
final public static void launchBrowser(String url) {
public static final void launchBrowser(String url) {
// Use Desktop Class first
try {
URI uri = java.net.URI.create(url);
@ -104,7 +104,7 @@ public class OSUtils {
*
* @see #launchBrowser(String)
*/
final private static String[] getBrowserExecString(String url) {
private static final String[] getBrowserExecString(String url) {
if (onMacOSX()) {
// Apple Macintosh, Safari is the main browser
return new String[] { "open" , "-a", "Safari", url };

Some files were not shown because too many files have changed in this diff Show More