Skip to content

Commit abd48ec

Browse files
author
Mike Pope
committed
Javadoc fixes.
1 parent 3513f31 commit abd48ec

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+189
-115
lines changed

src/net/sf/freecol/FreeCol.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,6 +1210,7 @@ public static int getMetaServerPort() {
12101210
* Set the meta-server location.
12111211
*
12121212
* @param arg The new meta-server location in HOST:PORT format.
1213+
* @return True if the location was set.
12131214
*/
12141215
private static boolean setMetaServer(String arg) {
12151216
String[] s = arg.split(":");

src/net/sf/freecol/client/ClientOptions.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ public Comparator<Colony> getColonyComparator() {
614614
/**
615615
* Get the colony comparator identified by type.
616616
*
617-
* @param The colony comparator option integer value.
617+
* @param type The colony comparator option integer value.
618618
* @return The corresponding colony {@code Comparator}.
619619
*/
620620
private static Comparator<Colony> getColonyComparatorInternal(int type) {
@@ -750,6 +750,14 @@ private void addOptionGroup(String id, String gr) {
750750
}
751751
}*/
752752

753+
/**
754+
* Add a new range option.
755+
*
756+
* @param id The option identifier.
757+
* @param gr The group identifier.
758+
* @param rank The option rank.
759+
* @param entries The options in the range.
760+
*/
753761
private void addRangeOption(String id, String gr, int rank,
754762
Map<Integer, String> entries) {
755763
if (!hasOption(id, RangeOption.class)) {
@@ -764,6 +772,13 @@ private void addRangeOption(String id, String gr, int rank,
764772
}
765773
}
766774

775+
/**
776+
* Add a new text option.
777+
*
778+
* @param id The option identifier.
779+
* @param gr The group identifier.
780+
* @param val The the text value.
781+
*/
767782
private void addTextOption(String id, String gr, String val) {
768783
if (!hasOption(id, TextOption.class)) {
769784
TextOption op = new TextOption(id, null);

src/net/sf/freecol/client/FreeColClient.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,8 +909,10 @@ public synchronized void login(boolean inGame, Game game, Player player,
909909
* Log this client out.
910910
*
911911
* Called when the ConnectController processes a logout.
912+
*
913+
* @param inGame Whether the server is in-game.
912914
*/
913-
public synchronized void logout(boolean inGame) {
915+
public synchronized void logout(@SuppressWarnings("unused") boolean inGame) {
914916
this.loggedIn = false;
915917
changeClientState(inGame);
916918
setGame(null);

src/net/sf/freecol/client/control/ConnectController.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@
5454

5555
/**
5656
* The controller responsible for starting a server and connecting to it.
57-
* {@link PreGameInputHandler} will be set as the input handler when a
58-
* successful login has been completed,
5957
*/
6058
public final class ConnectController extends FreeColClientHolder {
6159

@@ -238,9 +236,10 @@ public boolean requestLogin(String user, String host, int port) {
238236
* game should include a map and a full complement of players,
239237
* including ours.
240238
*
241-
* Otherwise we may still need to select a nation, and
242-
* optionally change game or map options (using several
243-
* possible messages). {@link StartGamePanel} does this.
239+
* Otherwise we may still need to select a nation, and optionally
240+
* change game or map options (using several possible messages).
241+
* {@link net.sf.freecol.client.gui.panel.StartGamePanel} does
242+
* this.
244243
*
245244
* When all the parameters are in place and all players are
246245
* ready (trivially true in single player, needs checking in
@@ -300,7 +299,7 @@ public void login(ServerState state, Game game, String user,
300299
// They all ultimately have to establish a connection to the server,
301300
// and get the game from there, which is done in {@link #login()}.
302301
// Control then effectively transfers to the handler for the login
303-
// message in {@link PreGameInputHandler}.
302+
// message.
304303
//
305304

306305
/**

src/net/sf/freecol/client/control/InGameController.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2360,6 +2360,8 @@ public boolean abandonColony(Colony colony) {
23602360

23612361
/**
23622362
* Handle an addPlayer message.
2363+
*
2364+
* @param players The {@code Player}s to add.
23632365
*/
23642366
public void addPlayerHandler(List<Player> players) {
23652367
getGame().addPlayers(players);
@@ -2901,6 +2903,8 @@ public boolean clearSpeciality(Unit unit) {
29012903

29022904
/**
29032905
* Close any open GUI menus.
2906+
*
2907+
* @param panel The identifier for the panel to close.
29042908
*/
29052909
public void closeHandler(String panel) {
29062910
getGUI().closePanel(panel);

src/net/sf/freecol/client/control/MapTransform.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ public abstract class MapTransform {
4545
public abstract void transform(Tile t);
4646

4747
/**
48-
* A panel with information about this transformation.
49-
* This panel is currently displayed on the
50-
* {@link InfoPanel} when selected, but might be
51-
* used elsewhere as well.
48+
* A panel with information about this transformation. This panel
49+
* is currently displayed on the
50+
* {@link net.sf.freecol.client.gui.panel.InfoPanel} when selected,
51+
* but might be used elsewhere as well.
5252
*
5353
* @return The panel or {@code null} if no panel
5454
* has been set.

src/net/sf/freecol/client/control/PreGameController.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ public PreGameController(FreeColClient freeColClient) {
7171

7272
/**
7373
* Handle an addPlayer message.
74+
*
75+
* @param players The {@code Player}s to add.
7476
*/
7577
public void addPlayerHandler(List<Player> players) {
7678
getGame().addPlayers(players);
@@ -102,6 +104,9 @@ public void chatHandler(Player player, String message, boolean pri) {
102104

103105
/**
104106
* Handle an error.
107+
*
108+
* @param template A {@code StringTemplate} describing the error.
109+
* @param message A backup string describing the error.
105110
*/
106111
public void errorHandler(StringTemplate template, String message) {
107112
getGUI().showErrorMessage(template, message);

src/net/sf/freecol/client/gui/Canvas.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,7 @@ public void setDragPoint(int x, int y) {
512512
*
513513
* @param x The new mouse x position.
514514
* @param y The new mouse y position.
515+
* @return True if the mouse has been dragged.
515516
*/
516517
public boolean isDrag(int x, int y) {
517518
final Point drag = getDragPoint();
@@ -1206,7 +1207,9 @@ public void displayChat(GUIMessage message) {
12061207
/**
12071208
* Tells that a chat message was received.
12081209
*
1210+
* @param senderName The sender.
12091211
* @param message The chat message.
1212+
* @param privateChat True if this is a private message.
12101213
*/
12111214
public void displayStartChat(String senderName, String message,
12121215
boolean privateChat) {
@@ -2539,8 +2542,6 @@ public void showTilePopup(Tile tile) {
25392542
* Display the trade route input panel for a given trade route.
25402543
*
25412544
* @param newRoute The {@code TradeRoute} to display.
2542-
* @param callBack The {@code Runnable} that is run when the
2543-
* panel closes.
25442545
* @return The {@code TradeRouteInputPanel}.
25452546
*/
25462547
public TradeRouteInputPanel showTradeRouteInputPanel(TradeRoute newRoute) {

src/net/sf/freecol/client/gui/GUI.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,8 +1134,6 @@ private final void showSettlement(Settlement settlement) {
11341134
* to a given player.
11351135
*
11361136
* @param tile The {@code Tile} to check for settlements.
1137-
* @param foriegn If true, use the foreign settlement functionality
1138-
* for colonies.
11391137
*/
11401138
public final void showTileSettlement(Tile tile) {
11411139
if (tile == null) return;
@@ -1354,6 +1352,9 @@ public void executeWithUnitOutForAnimation(Unit unit, Tile sourceTile,
13541352
/**
13551353
* Get the animation position.
13561354
*
1355+
* @param labelWidth The width of the label.
1356+
* @param labelHeight The height of the label.
1357+
* @param tileP The position of the {@code Tile} on the screen.
13571358
* @return A point on the map to place a unit for movement.
13581359
*/
13591360
public Point getAnimationPosition(int labelWidth, int labelHeight,
@@ -1562,7 +1563,7 @@ public void clearGotoPath() {}
15621563
/**
15631564
* Perform an immediate goto to a tile with the active unit.
15641565
*
1565-
* Called from {@see TilePopup}.
1566+
* Called from {@link TilePopup}.
15661567
*
15671568
* @param tile The {@code Tile} to go to.
15681569
*/
@@ -1571,7 +1572,7 @@ public void performGoto(Tile tile) {}
15711572
/**
15721573
* Perform an immediate goto to a point on the map.
15731574
*
1574-
* Called from {@see CanvasMouseListener}.
1575+
* Called from {@link CanvasMouseListener}.
15751576
*
15761577
* @param x The x coordinate of the goto destination (pixels).
15771578
* @param y The x coordinate of the goto destination (pixels).
@@ -1754,7 +1755,7 @@ public void changeView(Unit unit) {}
17541755
/**
17551756
* Change to map transform mode, and select a transform.
17561757
*
1757-
* @param mt The {@code MapTransform} to select.
1758+
* @param transform The {@code MapTransform} to select.
17581759
*/
17591760
public void changeView(MapTransform transform) {}
17601761

@@ -2108,8 +2109,12 @@ public OptionGroup showGameOptionsDialog(boolean editable) {
21082109

21092110
/**
21102111
* Show the high scores panel.
2112+
*
2113+
* @param messageId The message identifier.
2114+
* @param scores The {@code HighScore}s to display.
21112115
*/
2112-
public void showHighScoresPanel(String messageId, List<HighScore> scores) {}
2116+
public void showHighScoresPanel(String messageId,
2117+
List<HighScore> scores) {}
21132118

21142119
/**
21152120
* Show a panel for a native settlement.
@@ -2160,7 +2165,7 @@ public void showLogFilePanel() {}
21602165
/**
21612166
* Show the main panel.
21622167
*
2163-
* @parm userMsg An optional user message to display.
2168+
* @param userMsg An optional user message to display.
21642169
*/
21652170
public void showMainPanel(String userMsg) {}
21662171

@@ -2379,6 +2384,8 @@ public void showReportTradePanel() {}
23792384

23802385
/**
23812386
* Show the Turn Report.
2387+
*
2388+
* @param messages The {@code ModelMessage}s that make up the report.
23822389
*/
23832390
public void showReportTurnPanel(List<ModelMessage> messages) {}
23842391

src/net/sf/freecol/client/gui/ImageLibrary.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -560,9 +560,9 @@ public static BufferedImage getUnscaledImage(String key) {
560560
* @param grayscale If true, return the grayscale version of the image.
561561
* @return The {@code BufferedImage} found by the {@code ResourceManager}.
562562
*/
563-
private static BufferedImage getScaledImageInternal(String id, float scale,
563+
private static BufferedImage getScaledImageInternal(String key, float scale,
564564
boolean grayscale) {
565-
return ResourceManager.getImage(id, scale, grayscale);
565+
return ResourceManager.getImage(key, scale, grayscale);
566566
}
567567

568568
/**
@@ -573,10 +573,10 @@ private static BufferedImage getScaledImageInternal(String id, float scale,
573573
* @param grayscale If true, return the grayscale version of the image.
574574
* @return The {@code BufferedImage} found by the {@code ResourceManager}.
575575
*/
576-
private static BufferedImage getSizedImageInternal(String id,
576+
private static BufferedImage getSizedImageInternal(String key,
577577
Dimension size,
578578
boolean grayscale) {
579-
return ResourceManager.getImage(id, size, grayscale);
579+
return ResourceManager.getImage(key, size, grayscale);
580580
}
581581

582582
/**

src/net/sf/freecol/client/gui/MapViewer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ int getTileWidth() {
781781
*
782782
* @param labelWidth The width of the unit label.
783783
* @param labelHeight The width of the unit label.
784-
* @param tileP The position of the Tile on the screen.
784+
* @param tileP The position of the {@code Tile} on the screen.
785785
* @return The position where to put the label, null if tileP is null.
786786
*/
787787
public Point calculateUnitLabelPositionInTile(int labelWidth,

src/net/sf/freecol/client/gui/TileViewer.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public TileViewer(FreeColClient freeColClient) {
148148
/**
149149
* Gets the contained {@code ImageLibrary}.
150150
*
151-
* Public for {@see GUI.getTileImageLibrary}.
151+
* Public for {@link GUI#getTileImageLibrary}.
152152
*
153153
* @return The image library;
154154
*/
@@ -188,7 +188,7 @@ public void changeImageLibrary(ImageLibrary lib) {
188188
/**
189189
* Returns the scaled terrain-image for a terrain type (and position 0, 0).
190190
*
191-
* Public for {@see GUI.createTileImageWithOverlayAndForest}.
191+
* Public for {@link GUI#createTileImageWithOverlayAndForest}.
192192
*
193193
* @param type The type of the terrain-image to return.
194194
* @param size The maximum size of the terrain image to return.
@@ -238,7 +238,7 @@ public BufferedImage createTileImageWithOverlayAndForest(TileType type,
238238
* Create a {@code BufferedImage} and draw a {@code Tile} on it.
239239
* Draws the terrain and improvements.
240240
*
241-
* Public for {@see GUI.createTileImageWithBeachBorderAndItems}.
241+
* Public for {@link GUI#createTileImageWithBeachBorderAndItems}.
242242
*
243243
* @param tile The Tile to draw.
244244
* @return The image.
@@ -266,7 +266,7 @@ public BufferedImage createTileImageWithBeachBorderAndItems(Tile tile) {
266266
/**
267267
* Create a {@code BufferedImage} and draw a {@code Tile} on it.
268268
*
269-
* Public for {@see GUI.createTileImage}.
269+
* Public for {@link GUI#createTileImage}.
270270
*
271271
* @param tile The {@code Tile} to draw.
272272
* @param player The {@code Player} to draw for.
@@ -295,7 +295,7 @@ public BufferedImage createTileImage(Tile tile, Player player) {
295295
* from the corresponding {@code ColonyTile} of the given
296296
* {@code Colony}.
297297
*
298-
* Public for {@see GUI.createColonyTileImage}.
298+
* Public for {@link GUI#createColonyTileImage}.
299299
*
300300
* @param tile The {@code Tile} to draw.
301301
* @param colony The {@code Colony} to create the visualization
@@ -324,7 +324,7 @@ public BufferedImage createColonyTileImage(Tile tile, Colony colony) {
324324
/**
325325
* Displays the 3x3 tiles for the TilesPanel in ColonyPanel.
326326
*
327-
* Public for {@see GUI.displayColonyTles}.
327+
* Public for {@link GUI#displayColonyTiles}.
328328
*
329329
* @param g The {@code Graphics2D} object on which to draw
330330
* the {@code Tile}.

src/net/sf/freecol/client/gui/dialog/GameOptionsDialog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131

3232
/**
33-
* Dialog for changing the {@link net.sf.freecol.common.model.GameOptions}.
33+
* Dialog for changing the {@link net.sf.freecol.common.option.GameOptions}.
3434
*/
3535
public final class GameOptionsDialog extends OptionsDialog {
3636

src/net/sf/freecol/client/gui/dialog/SelectAmountDialog.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ public boolean verify(JComponent input) {
127127
/**
128128
* Verify the contents of the JComboBox.
129129
*
130+
* @param box The {@code JComboBox} to verify.
130131
* @return True if all is well.
131132
*/
132133
private boolean verifyWholeBox(JComboBox<Integer> box) {

src/net/sf/freecol/client/gui/panel/InfoPanel.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,14 @@ public final class InfoPanel extends FreeColPanel {
7777

7878
private static final int SLACK = 5; // Small gap
7979

80-
/**
81-
* Panel for ending the turn.
82-
*
83-
* @param freeColClient The {@code FreeColClient} for the game.
84-
*/
80+
/** Panel for ending the turn. */
8581
private static class EndTurnPanel extends FreeColPanel {
8682

83+
/**
84+
* Build a new end panel.
85+
*
86+
* @param freeColClient The {@code FreeColClient} for the game.
87+
*/
8788
public EndTurnPanel(FreeColClient freeColClient) {
8889
super(freeColClient, null,
8990
new MigLayout("wrap 1, center", "[center]", ""));

src/net/sf/freecol/client/gui/panel/Utility.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,6 @@ public static void localizeToolTip(JComponent comp, String key) {
641641
*
642642
* @param comp The {@code JComponent} to localize.
643643
* @param template The {@code StringTemplate} to use.
644-
* @return The original {@code JComponent}.
645644
*/
646645
public static void localizeToolTip(JComponent comp,
647646
StringTemplate template) {

src/net/sf/freecol/client/networking/UserServerAPI.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@ private synchronized void updateConnection(Connection c) {
111111
/**
112112
* Create a new connection.
113113
*
114+
* @param name The name to associate with the connection.
115+
* @param host The name of the host to connect to.
116+
* @param port The port to connect to.
114117
* @return The new <code>Connection</code>.
118+
* @exception IOException on failure to connect.
115119
*/
116120
private static Connection newConnection(String name, String host, int port)
117121
throws IOException {

0 commit comments

Comments
 (0)