Getter for undo-buttons

PGN
Justin 2025-06-22 01:28:37 +02:00
parent e6e1fa3187
commit 0bc99a18be
1 changed files with 11 additions and 4 deletions

View File

@ -28,6 +28,11 @@ public class GameGui {
private JButton flipBoardButton; private JButton flipBoardButton;
private boolean isFlipped = false; private boolean isFlipped = false;
JButton btnFirst = new JButton("|<");
JButton btnPrev = new JButton("<");
JButton btnNext = new JButton(">");
JButton btnLast = new JButton(">|");
private JPanel moveListPanel; private JPanel moveListPanel;
private JScrollPane moveListScroll; private JScrollPane moveListScroll;
@ -166,10 +171,7 @@ public class GameGui {
buttonPanel.setBackground(new Color(0x0d1b2a)); buttonPanel.setBackground(new Color(0x0d1b2a));
// Grid oder Flow je nach Geschmack // Grid oder Flow je nach Geschmack
buttonPanel.setLayout(new GridLayout(1, 4, 10, 0)); buttonPanel.setLayout(new GridLayout(1, 4, 10, 0));
JButton btnFirst = new JButton("|<");
JButton btnPrev = new JButton("<");
JButton btnNext = new JButton(">");
JButton btnLast = new JButton(">|");
// Style (optional) // Style (optional)
btnFirst.setBackground(new Color(0x212529)); btnFirst.setForeground(Color.WHITE); btnFirst.setBackground(new Color(0x212529)); btnFirst.setForeground(Color.WHITE);
btnPrev.setBackground(new Color(0x212529)); btnPrev.setForeground(Color.WHITE); btnPrev.setBackground(new Color(0x212529)); btnPrev.setForeground(Color.WHITE);
@ -217,6 +219,11 @@ public class GameGui {
this.isFlipped = flipped; this.isFlipped = flipped;
} }
public JButton getBtnFirst() { return btnFirst; }
public JButton getBtnPrev() { return btnPrev; }
public JButton getBtnNext() { return btnNext; }
public JButton getBtnLast() { return btnLast; }
public void updateBoard(BoardDTO boardDTO) { public void updateBoard(BoardDTO boardDTO) {
PieceDTO[][] board = boardDTO.getBoard(); PieceDTO[][] board = boardDTO.getBoard();
if (!isFlipped) { if (!isFlipped) {