Fixed some Javadoc and formatting

This commit is contained in:
Kai S. K. Engelbart 2019-12-21 21:42:36 +01:00
parent d46a9aa5ff
commit b32a4f2414
Signed by: kske
GPG Key ID: 8BEB13EC5DF7EF13
2 changed files with 14 additions and 15 deletions

View File

@ -30,11 +30,13 @@ public class Board {
/** /**
* Creates a copy of another {@link Board} instance.<br> * Creates a copy of another {@link Board} instance.<br>
* The created object is a deep copy, but does not contain any move history * The created object is a deep copy, and can optionally contain the move
* apart from the current {@link MoveNode}. * history of the Board to copy.
* *
* @param other The {@link Board} instance to copy * @param other The Board instance to copy
* @param copyVariations TODO * @param copyVariations if set to {@code true}, the {@link Log} object of the
* other Board instance is copied with its entire move
* history
*/ */
public Board(Board other, boolean copyVariations) { public Board(Board other, boolean copyVariations) {
for (int i = 0; i < 8; i++) for (int i = 0; i < 8; i++)
@ -99,9 +101,7 @@ public class Board {
* *
* @param sanMove The move to execute in SAN (Standard Algebraic Notation) * @param sanMove The move to execute in SAN (Standard Algebraic Notation)
*/ */
public void move(String sanMove) { public void move(String sanMove) { move(Move.fromSAN(sanMove, this)); }
move(Move.fromSAN(sanMove, this));
}
/** /**
* Reverts the last move and removes it from the log. * Reverts the last move and removes it from the log.

View File

@ -44,9 +44,7 @@ public class GamePane extends JComponent {
private Game game; private Game game;
private Color activeColor; private Color activeColor;
private JPanel moveSelectionPanel; private JPanel moveSelectionPanel;
private JButton btnNext; private JButton btnFirst, btnPrevious, btnNext, btnLast;
private JButton btnFirst;
private JButton btnLast;
public GamePane() { public GamePane() {
activeColor = Color.WHITE; activeColor = Color.WHITE;
@ -96,9 +94,9 @@ public class GamePane extends JComponent {
btnFirst.setEnabled(false); btnFirst.setEnabled(false);
moveSelectionPanel.add(btnFirst); moveSelectionPanel.add(btnFirst);
JButton btnPreviousMove = new JButton("Previous"); btnPrevious = new JButton("Previous");
btnPreviousMove.setEnabled(false); btnPrevious.setEnabled(false);
moveSelectionPanel.add(btnPreviousMove); moveSelectionPanel.add(btnPrevious);
btnNext = new JButton("Next"); btnNext = new JButton("Next");
btnNext.setEnabled(false); btnNext.setEnabled(false);
@ -107,6 +105,7 @@ public class GamePane extends JComponent {
btnLast = new JButton("Last"); btnLast = new JButton("Last");
btnLast.setEnabled(false); btnLast.setEnabled(false);
moveSelectionPanel.add(btnLast); moveSelectionPanel.add(btnLast);
boardPane = new BoardPane(); boardPane = new BoardPane();
GridBagConstraints gbc_boardPane = new GridBagConstraints(); GridBagConstraints gbc_boardPane = new GridBagConstraints();
gbc_boardPane.fill = GridBagConstraints.BOTH; gbc_boardPane.fill = GridBagConstraints.BOTH;