From 0bc99a18bef3f3b004c115f9a7c61173eb05032c Mon Sep 17 00:00:00 2001 From: Justin Date: Sun, 22 Jun 2025 01:28:37 +0200 Subject: [PATCH] Getter for undo-buttons --- .../informatik/chess/view/GameGui.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/schach/src/main/java/de/hs_mannheim/informatik/chess/view/GameGui.java b/schach/src/main/java/de/hs_mannheim/informatik/chess/view/GameGui.java index 1abb531..76f4b97 100644 --- a/schach/src/main/java/de/hs_mannheim/informatik/chess/view/GameGui.java +++ b/schach/src/main/java/de/hs_mannheim/informatik/chess/view/GameGui.java @@ -28,6 +28,11 @@ public class GameGui { private JButton flipBoardButton; private boolean isFlipped = false; + JButton btnFirst = new JButton("|<"); + JButton btnPrev = new JButton("<"); + JButton btnNext = new JButton(">"); + JButton btnLast = new JButton(">|"); + private JPanel moveListPanel; private JScrollPane moveListScroll; @@ -166,10 +171,7 @@ public class GameGui { buttonPanel.setBackground(new Color(0x0d1b2a)); // Grid oder Flow – je nach Geschmack 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) btnFirst.setBackground(new Color(0x212529)); btnFirst.setForeground(Color.WHITE); btnPrev.setBackground(new Color(0x212529)); btnPrev.setForeground(Color.WHITE); @@ -217,6 +219,11 @@ public class GameGui { 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) { PieceDTO[][] board = boardDTO.getBoard(); if (!isFlipped) {