mirror of https://github.com/FreeCol/freecol.git
Miscellaneous code cleanup
This commit is contained in:
parent
4db447e9e6
commit
bbce187863
|
@ -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);
|
||||
|
|
|
@ -42,7 +42,7 @@ public class Animations {
|
|||
*/
|
||||
public interface Procedure {
|
||||
void execute();
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Collect animations for a unit move.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -72,7 +72,7 @@ public class FreeColDialog<T> extends JDialog implements PropertyChangeListener
|
|||
public enum DialogType {
|
||||
PLAIN,
|
||||
QUESTION,
|
||||
};
|
||||
}
|
||||
|
||||
/** The enclosing client. */
|
||||
protected final FreeColClient freeColClient;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -334,7 +334,7 @@ public class InGameMenuBar extends FreeColMenuBar {
|
|||
final FontMetrics fm = g2d.getFontMetrics();
|
||||
final Rectangle2D d = fm.getStringBounds(text, g2d);
|
||||
final int textWidth = (int) d.getWidth();
|
||||
final int textHeight = (int) d.getHeight();;
|
||||
final int textHeight = (int) d.getHeight();
|
||||
|
||||
final int rightSidePaddingInPx = 10;
|
||||
final int centerHeight = getHeight() - getInsets().bottom;
|
||||
|
|
|
@ -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<>();
|
||||
|
||||
|
|
|
@ -1276,8 +1276,7 @@ public final class ColonyPanel extends PortPanel
|
|||
*/
|
||||
@Override
|
||||
public JToolTip createToolTip() {
|
||||
JToolTip toolTip = new RebelToolTip(getFreeColClient(), getColony());
|
||||
return toolTip;
|
||||
return new RebelToolTip(getFreeColClient(), getColony());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -187,8 +187,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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -73,7 +73,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
|
||||
|
|
Loading…
Reference in New Issue