Skip to content
This repository has been archived by the owner on Jan 18, 2025. It is now read-only.

Commit

Permalink
Fix home button has to be accessed in a static way warning
Browse files Browse the repository at this point in the history
  • Loading branch information
powersagitar committed Jan 10, 2025
1 parent b6399c8 commit b455315
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
public class CodeBreaker extends Scene {
private final MastermindAlgorithm solver;
private final GameBoard gameBoard = new GameBoard();
private final HomeButton homeButton = new HomeButton();
private final AtomicInteger correctCount = new AtomicInteger(2);
private final AtomicInteger misplacementCount = new AtomicInteger(2);
private final JButton proceedButton = new JButton("Proceed");
Expand Down Expand Up @@ -56,9 +55,9 @@ public CodeBreaker(final JFrame frame, final MastermindAlgorithm algorithm) {

drawProceedButton();

homeButton.drawHomeButton(frame);
HomeButton.drawHomeButton(frame);

homeButton.registerHomeHandlers(frame);
HomeButton.registerHomeHandlers(frame);

registerGuessHandler();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public class CodeBreakerSelector extends Scene {
private final JRadioButton mediumAlgoButton = new JRadioButton("Medium Algorithm");
private final JRadioButton basicAlgoButton = new JRadioButton("Basic Algorithm");
private final JButton proceedButton = new JButton("Proceed");
private final HomeButton homeButton = new HomeButton();

/**
* Constructs a CodeBreakerSelector, which provides a user interface to select
Expand All @@ -37,9 +36,9 @@ public CodeBreakerSelector(final JFrame frame) {

drawProceedButton();

homeButton.drawHomeButton(frame);
HomeButton.drawHomeButton(frame);

homeButton.registerHomeHandlers(frame);
HomeButton.registerHomeHandlers(frame);

registerProceedHandler();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public class CodeMaker extends Scene {
private final GameBoard gameBoard = new GameBoard();
private final JButton proceedButton = new JButton("Proceed");
private final JButton deleteButton = new JButton("Delete");
private final HomeButton homeButton = new HomeButton();
private final JPanel flowPanel = new JPanel(new FlowLayout());
private final JPanel controlPanel = new JPanel();

Expand Down Expand Up @@ -54,13 +53,13 @@ public CodeMaker(final JFrame frame) {

drawProceedButton();

homeButton.drawHomeButton(frame);
HomeButton.drawHomeButton(frame);

registerColorSelectionHandlers();

registerDeleteHandlers();

homeButton.registerHomeHandlers(frame);
HomeButton.registerHomeHandlers(frame);

registerProceedHandlers();

Expand Down

0 comments on commit b455315

Please sign in to comment.