kleinere Bugfixes und Verschönerungen

main
Matias Mas Viehl 2025-06-25 09:28:32 +02:00
parent bc909c3ba5
commit 9588847c72
3 changed files with 613 additions and 587 deletions

View File

@ -46,6 +46,7 @@ public class ButtonAufgebenListener extends JFrame implements ActionListener {
} }
this.sf.setBoardMode(BoardMode.finished); this.sf.setBoardMode(BoardMode.finished);
this.sf.enableControlPanelButtons();
sf.setButtonsActions(); sf.setButtonsActions();

View File

@ -87,6 +87,10 @@ public class MainFrame extends JFrame {
contentPane.add(Box.createVerticalStrut(15)); contentPane.add(Box.createVerticalStrut(15));
JButton pgnLoaderButton = new JButton("Lade aus PGN Datei"); JButton pgnLoaderButton = new JButton("Lade aus PGN Datei");
pgnLoaderButton.setBackground(Color.LIGHT_GRAY);
pgnLoaderButton.setForeground(Color.BLACK);
pgnLoaderButton.setFont(new Font("Tahoma", Font.BOLD, 16));
pgnLoaderButton.setAlignmentX(CENTER_ALIGNMENT);
pgnLoaderButton.addActionListener(e -> openPgnSelectFrame()); pgnLoaderButton.addActionListener(e -> openPgnSelectFrame());
contentPane.add(pgnLoaderButton); contentPane.add(pgnLoaderButton);
@ -116,7 +120,7 @@ public class MainFrame extends JFrame {
*/ */
public void startGame() { public void startGame() {
if (this.game != null) { if (this.game != null) {
this.game.stopClock(); //this.game.stopClock();
new SpielFrame(this.game); new SpielFrame(this.game);
} }
} }

View File

@ -67,7 +67,7 @@ public class SpielFrame extends JFrame {
private Square selectedSquare; private Square selectedSquare;
public enum BoardMode { public enum BoardMode {
normal, pieceSelected, finished, gameEnd normal, pieceSelected, finished
} }
/** /**
@ -244,9 +244,6 @@ public class SpielFrame extends JFrame {
case finished: case finished:
break; break;
case gameEnd:
break;
default: default:
break; break;
} }
@ -393,36 +390,60 @@ public class SpielFrame extends JFrame {
// ----- ViewQuicksaveButton ----- // ----- ViewQuicksaveButton -----
JButton quicksave = new JButton("Quicksave"); JButton quicksave = new JButton("Quicksave");
quicksave.setBackground(Color.LIGHT_GRAY);
quicksave.setForeground(Color.BLACK);
quicksave.setFont(new Font("Tahoma", Font.BOLD, 16));
quicksave.setAlignmentX(CENTER_ALIGNMENT);
quicksave.setEnabled(true); quicksave.setEnabled(true);
quicksave.addActionListener(new ButtonQuicksaveListener(this.game)); quicksave.addActionListener(new ButtonQuicksaveListener(this.game));
this.controlPanel.add(quicksave); this.controlPanel.add(quicksave);
// ----- ViewFirstButton ----- // ----- ViewFirstButton -----
JButton viewFirstButton = new JButton("<<-"); JButton viewFirstButton = new JButton("<<-");
viewFirstButton.setBackground(Color.LIGHT_GRAY);
viewFirstButton.setForeground(Color.BLACK);
viewFirstButton.setFont(new Font("Tahoma", Font.BOLD, 16));
viewFirstButton.setAlignmentX(CENTER_ALIGNMENT);
viewFirstButton.setEnabled(false); viewFirstButton.setEnabled(false);
viewFirstButton.addActionListener(new ButtonViewFirstListener(this.game, this)); viewFirstButton.addActionListener(new ButtonViewFirstListener(this.game, this));
this.controlPanel.add(viewFirstButton); this.controlPanel.add(viewFirstButton);
// ----- ViewBackButton ----- // ----- ViewBackButton -----
JButton viewBackButton = new JButton("<-"); JButton viewBackButton = new JButton("<-");
viewBackButton.setBackground(Color.LIGHT_GRAY);
viewBackButton.setForeground(Color.BLACK);
viewBackButton.setFont(new Font("Tahoma", Font.BOLD, 16));
viewBackButton.setAlignmentX(CENTER_ALIGNMENT);
viewBackButton.setEnabled(false); viewBackButton.setEnabled(false);
viewBackButton.addActionListener(new ButtonViewBackListener(this.game, this)); viewBackButton.addActionListener(new ButtonViewBackListener(this.game, this));
this.controlPanel.add(viewBackButton); this.controlPanel.add(viewBackButton);
// ----- ViewForwardButton ----- // ----- ViewForwardButton -----
JButton viewForwardButton = new JButton("->"); JButton viewForwardButton = new JButton("->");
viewForwardButton.setBackground(Color.LIGHT_GRAY);
viewForwardButton.setForeground(Color.BLACK);
viewForwardButton.setFont(new Font("Tahoma", Font.BOLD, 16));
viewForwardButton.setAlignmentX(CENTER_ALIGNMENT);
viewForwardButton.setEnabled(false); viewForwardButton.setEnabled(false);
viewForwardButton.addActionListener(new ButtonViewForwardListener(this.game, this)); viewForwardButton.addActionListener(new ButtonViewForwardListener(this.game, this));
this.controlPanel.add(viewForwardButton); this.controlPanel.add(viewForwardButton);
// ----- ViewLastButton ----- // ----- ViewLastButton -----
JButton viewLastButton = new JButton("->>"); JButton viewLastButton = new JButton("->>");
viewLastButton.setBackground(Color.LIGHT_GRAY);
viewLastButton.setForeground(Color.BLACK);
viewLastButton.setFont(new Font("Tahoma", Font.BOLD, 16));
viewLastButton.setAlignmentX(CENTER_ALIGNMENT);
viewLastButton.setEnabled(false); viewLastButton.setEnabled(false);
viewLastButton.addActionListener(new ButtonViewLastListener(this.game, this)); viewLastButton.addActionListener(new ButtonViewLastListener(this.game, this));
this.controlPanel.add(viewLastButton); this.controlPanel.add(viewLastButton);
// ----- ViewQuickloadButton ----- // ----- ViewQuickloadButton -----
JButton quickload = new JButton("Quickload"); JButton quickload = new JButton("Quickload");
quickload.setBackground(Color.LIGHT_GRAY);
quickload.setForeground(Color.BLACK);
quickload.setFont(new Font("Tahoma", Font.BOLD, 16));
quickload.setAlignmentX(CENTER_ALIGNMENT);
quickload.setEnabled(true); quickload.setEnabled(true);
quickload.addActionListener(new ButtonQuickloadListener(this.game, this)); quickload.addActionListener(new ButtonQuickloadListener(this.game, this));
this.controlPanel.add(quickload); this.controlPanel.add(quickload);