The states include: - ZERO: Represents a cell with a value of 0 - ONE: Represents a cell with
+ * a value of 1 - UNKNOWN: Represents an empty cell
*/
public enum BinaryType {
- ZERO, // Enum constant 0
- ONE, // Enum constant 1
- UNKNOWN; // Enum constant 2
+ ZERO, // Enum constant 0
+ ONE, // Enum constant 1
+ UNKNOWN; // Enum constant 2
/**
- * The `toValue` method returns the ordinal value of the enum constant,
- * which can be used to convert the enum to an integer representation.
+ * The `toValue` method returns the ordinal value of the enum constant, which can be used to
+ * convert the enum to an integer representation.
*/
public int toValue() {
return this.ordinal();
diff --git a/src/main/java/edu/rpi/legup/puzzle/binary/BinaryView.java b/src/main/java/edu/rpi/legup/puzzle/binary/BinaryView.java
index e1869de6b..b428ce32c 100644
--- a/src/main/java/edu/rpi/legup/puzzle/binary/BinaryView.java
+++ b/src/main/java/edu/rpi/legup/puzzle/binary/BinaryView.java
@@ -7,9 +7,10 @@
public class BinaryView extends GridBoardView {
- /** Creates and arranges the visual components for each cell in the binary puzzle. Initializes
- * the view by setting up the board controller, binary controller, and the grid dimensions.
- * For each cell in the BinaryBoard, it creates a corresponding BinaryElementView, sets its index,
+ /**
+ * Creates and arranges the visual components for each cell in the binary puzzle. Initializes
+ * the view by setting up the board controller, binary controller, and the grid dimensions. For
+ * each cell in the BinaryBoard, it creates a corresponding BinaryElementView, sets its index,
* size, and location, and adds it to the list of element views to be displayed.
*
* @param board The BinaryBoard representing the current state of the binary puzzle
diff --git a/src/main/java/edu/rpi/legup/puzzle/binary/elements/NumberTile.java b/src/main/java/edu/rpi/legup/puzzle/binary/elements/NumberTile.java
index e996e246b..dc3d75e00 100644
--- a/src/main/java/edu/rpi/legup/puzzle/binary/elements/NumberTile.java
+++ b/src/main/java/edu/rpi/legup/puzzle/binary/elements/NumberTile.java
@@ -1,4 +1,3 @@
-
package edu.rpi.legup.puzzle.binary.elements;
import edu.rpi.legup.model.elements.PlaceableElement;
@@ -11,4 +10,4 @@ public NumberTile() {
"A number tile",
"edu/rpi/legup/images/binary/tiles/NumberTile.png");
}
-}
\ No newline at end of file
+}
diff --git a/src/main/java/edu/rpi/legup/puzzle/binary/elements/UnknownTile.java b/src/main/java/edu/rpi/legup/puzzle/binary/elements/UnknownTile.java
index 8c60ea8c3..e32a2d12f 100644
--- a/src/main/java/edu/rpi/legup/puzzle/binary/elements/UnknownTile.java
+++ b/src/main/java/edu/rpi/legup/puzzle/binary/elements/UnknownTile.java
@@ -10,4 +10,4 @@ public UnknownTile() {
"A blank tile",
"edu/rpi/legup/images/binary/tiles/UnknownTile.png");
}
-}
\ No newline at end of file
+}
diff --git a/src/main/java/edu/rpi/legup/puzzle/binary/rules/CompleteRowColumnDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/binary/rules/CompleteRowColumnDirectRule.java
index 359433685..6ced37a9c 100644
--- a/src/main/java/edu/rpi/legup/puzzle/binary/rules/CompleteRowColumnDirectRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/binary/rules/CompleteRowColumnDirectRule.java
@@ -15,8 +15,8 @@ public CompleteRowColumnDirectRule() {
super(
"BINA-BASC-0003",
"Complete Row/Column",
- "If a row/column of length n contains n/2 of a single value, the remaining " +
- "cells must contain the other value",
+ "If a row/column of length n contains n/2 of a single value, the remaining "
+ + "cells must contain the other value",
"edu/rpi/legup/images/binary/rules/CompleteRowColumnDirectRule.png");
}
diff --git a/src/main/java/edu/rpi/legup/puzzle/binary/rules/EliminateTheImpossibleDirectRule.java b/src/main/java/edu/rpi/legup/puzzle/binary/rules/EliminateTheImpossibleDirectRule.java
index 02c1c2c31..df84dd540 100644
--- a/src/main/java/edu/rpi/legup/puzzle/binary/rules/EliminateTheImpossibleDirectRule.java
+++ b/src/main/java/edu/rpi/legup/puzzle/binary/rules/EliminateTheImpossibleDirectRule.java
@@ -1,33 +1,35 @@
-//package edu.rpi.legup.puzzle.binary.rules;
-//
-//import edu.rpi.legup.model.gameboard.Board;
-//import edu.rpi.legup.model.gameboard.PuzzleElement;
-//import edu.rpi.legup.model.rules.DirectRule;
-//import edu.rpi.legup.model.tree.TreeNode;
-//import edu.rpi.legup.model.tree.TreeTransition;
-//import edu.rpi.legup.puzzle.binary.BinaryBoard;
-//import edu.rpi.legup.puzzle.binary.BinaryCell;
-//import edu.rpi.legup.puzzle.binary.BinaryType;
-//
-//import java.util.LinkedList;
-//import java.util.Queue;
-//import java.lang.Math.*;
-//import java.lang.reflect.Array;
-//import java.util.ArrayList;
-//
-//public class EliminateTheImpossibleDirectRule extends DirectRule {
+// package edu.rpi.legup.puzzle.binary.rules;
+//
+// import edu.rpi.legup.model.gameboard.Board;
+// import edu.rpi.legup.model.gameboard.PuzzleElement;
+// import edu.rpi.legup.model.rules.DirectRule;
+// import edu.rpi.legup.model.tree.TreeNode;
+// import edu.rpi.legup.model.tree.TreeTransition;
+// import edu.rpi.legup.puzzle.binary.BinaryBoard;
+// import edu.rpi.legup.puzzle.binary.BinaryCell;
+// import edu.rpi.legup.puzzle.binary.BinaryType;
+//
+// import java.util.LinkedList;
+// import java.util.Queue;
+// import java.lang.Math.*;
+// import java.lang.reflect.Array;
+// import java.util.ArrayList;
+//
+// public class EliminateTheImpossibleDirectRule extends DirectRule {
// private final String INVALID_USE_MESSAGE = "Number at cell is incorrect";
//
// public EliminateTheImpossibleDirectRule() {
// super(
// "BINA-BASC-0004",
// "Eliminate The Impossible",
-// "Out of the remaining empty cells in this row or column, this digit must go here, otherwise there will be a future contradiction",
+// "Out of the remaining empty cells in this row or column, this digit must go here,
+// otherwise there will be a future contradiction",
// "edu/rpi/legup/images/binary/rules/EliminateTheImpossibleDirectRule.png");
// }
//
// // Function to generate all binary strings
-// void generatePossibilitites(int spots, ArrayList
- * Accelerator keys are set based on the operating system (Mac or non-Mac).
+ *
+ * Accelerator keys are set based on the operating system (Mac or non-Mac).
*
* @return the {@code JMenuBar} instance containing the menus and menu items for this panel
*/
@@ -497,8 +497,8 @@ public void actionPerformed(ActionEvent e) {
}
/**
- * Clears the current puzzle, resets the UI to display the initial panel,
- * and nullifies the references to the tree panel and board view.
+ * Clears the current puzzle, resets the UI to display the initial panel, and nullifies the
+ * references to the tree panel and board view.
*/
public void exitEditor() {
// Wipes the puzzle entirely as if LEGUP just started
@@ -510,10 +510,11 @@ public void exitEditor() {
/**
* Opens a file chooser dialog allowing the user to select a directory. It uses the user's
- * preferred directory or the last saved path if available. The selected directory is used
- * to set the new working directory.
+ * preferred directory or the last saved path if available. The selected directory is used to
+ * set the new working directory.
*
- * @return an array containing the file name and the selected file, or {@code null} if the operation was canceled
+ * @return an array containing the file name and the selected file, or {@code null} if the
+ * operation was canceled
*/
public Object[] promptPuzzle() {
GameBoardFacade facade = GameBoardFacade.getInstance();
@@ -559,10 +560,10 @@ public Object[] promptPuzzle() {
}
/**
- * Calls {@link #promptPuzzle()} to get the file information and then loads the puzzle using
- * the provided file name and file object. Updates the frame title to reflect the puzzle name.
- * If the file is not valid or an error occurs, an error message is shown, and the user is
- * prompted to try loading another puzzle.
+ * Calls {@link #promptPuzzle()} to get the file information and then loads the puzzle using the
+ * provided file name and file object. Updates the frame title to reflect the puzzle name. If
+ * the file is not valid or an error occurs, an error message is shown, and the user is prompted
+ * to try loading another puzzle.
*/
public void loadPuzzle() {
Object[] items = promptPuzzle();
@@ -576,16 +577,16 @@ public void loadPuzzle() {
}
/**
- * Attempts to load a puzzle from the given file. If successful, it updates the
- * UI to display the puzzle and changes the frame title to include the puzzle name. If the
- * file is invalid or cannot be read, it shows an appropriate error message and prompts the
- * user to try loading another puzzle.
+ * Attempts to load a puzzle from the given file. If successful, it updates the UI to display
+ * the puzzle and changes the frame title to include the puzzle name. If the file is invalid or
+ * cannot be read, it shows an appropriate error message and prompts the user to try loading
+ * another puzzle.
*
* @param fileName the name of the file to load
* @param puzzleFile the file object representing the puzzle file
*/
public void loadPuzzle(String fileName, File puzzleFile) {
- if (puzzleFile == null && fileName.equals("")) {
+ if (puzzleFile == null && fileName.isEmpty()) {
legupUI.displayPanel(1);
}
if (puzzleFile != null && puzzleFile.exists()) {
@@ -623,9 +624,9 @@ public void loadPuzzle(String fileName, File puzzleFile) {
}
/**
- * Uses the current puzzle and its associated exporter to save the puzzle data
- * to the file currently being used. If the puzzle or exporter is null, or if an error occurs
- * during export, the method will catch the exception and print the stack trace.
+ * Uses the current puzzle and its associated exporter to save the puzzle data to the file
+ * currently being used. If the puzzle or exporter is null, or if an error occurs during export,
+ * the method will catch the exception and print the stack trace.
*/
private void direct_save() {
Puzzle puzzle = GameBoardFacade.getInstance().getPuzzleModule();
@@ -648,8 +649,8 @@ private void direct_save() {
/**
* Opens a file chooser dialog for the user to select a directory. The chosen directory is used
- * to determine where the puzzle file will be saved. If an exporter is available, it will be used
- * to export the puzzle data to the selected path.
+ * to determine where the puzzle file will be saved. If an exporter is available, it will be
+ * used to export the puzzle data to the selected path.
*/
private void saveProofAs() {
Puzzle puzzle = GameBoardFacade.getInstance().getPuzzleModule();
@@ -689,9 +690,9 @@ private void saveProofAs() {
// Hyperlink for help button; links to wiki page for tutorials
/**
- * Opens the default web browser to a help page related to the type of puzzle currently being used.
- * The URL is chosen based on the name of the puzzle. If the puzzle type is not recognized, a general
- * tutorial page is opened.
+ * Opens the default web browser to a help page related to the type of puzzle currently being
+ * used. The URL is chosen based on the name of the puzzle. If the puzzle type is not
+ * recognized, a general tutorial page is opened.
*/
private void helpTutorial() {
// redirecting to certain help link in wiki
@@ -745,9 +746,9 @@ public void actionPerformed(ActionEvent e) {
}
/**
- * Saves the puzzle using the current file name and shows a message dialog to
- * confirm that the save operation was successful. If the puzzle or exporter is null, or if
- * an error occurs during export, the method will catch the exception and print the stack trace.
+ * Saves the puzzle using the current file name and shows a message dialog to confirm that the
+ * save operation was successful. If the puzzle or exporter is null, or if an error occurs
+ * during export, the method will catch the exception and print the stack trace.
*/
private void saveProofChange() {
Puzzle puzzle = GameBoardFacade.getInstance().getPuzzleModule();
@@ -826,9 +827,9 @@ protected void setupContent() {
}
/**
- * Initializes the first toolbar, configures its appearance, and adds an 'Open' button
- * with an associated icon. An action listener is attached to the button to trigger the loading of
- * a puzzle when clicked.
+ * Initializes the first toolbar, configures its appearance, and adds an 'Open' button with an
+ * associated icon. An action listener is attached to the button to trigger the loading of a
+ * puzzle when clicked.
*/
private void setupToolBar1() {
toolBar1 = new JToolBar();
@@ -862,14 +863,15 @@ private void setupToolBar1() {
}
/**
- * Initializes the second toolbar, configures its appearance, and adds four buttons each
- * with associated icons. Action listeners are attached to each button to trigger their respective
+ * Initializes the second toolbar, configures its appearance, and adds four buttons each with
+ * associated icons. Action listeners are attached to each button to trigger their respective
* actions when clicked:
+ *
*
- *
*/
public enum DynamicViewType {
diff --git a/src/main/java/edu/rpi/legup/ui/HomePanel.java b/src/main/java/edu/rpi/legup/ui/HomePanel.java
index f12ffdbf0..75761c475 100644
--- a/src/main/java/edu/rpi/legup/ui/HomePanel.java
+++ b/src/main/java/edu/rpi/legup/ui/HomePanel.java
@@ -26,10 +26,9 @@
import org.xml.sax.helpers.DefaultHandler;
/**
- * The {@code HomePanel} class represents the home panel of the LEGUP application.
- * This panel provides buttons for functionalities of opening the proof editor,
- * opening the puzzle editor, and performing batch grading. It also includes a menu bar with
- * options for preferences.
+ * The {@code HomePanel} class represents the home panel of the LEGUP application. This panel
+ * provides buttons for functionalities of opening the proof editor, opening the puzzle editor, and
+ * performing batch grading. It also includes a menu bar with options for preferences.
*/
public class HomePanel extends LegupPanel {
private static final Logger LOGGER = LogManager.getLogger(HomePanel.class.getName());
@@ -42,9 +41,7 @@ public class HomePanel extends LegupPanel {
private final int buttonSize = 100;
- /**
- * Initialize the proof solver to an empty panel with no puzzle
- */
+ /** Initialize the proof solver to an empty panel with no puzzle */
private ActionListener openProofListener =
new ActionListener() {
@Override
@@ -101,9 +98,7 @@ public JMenuBar getMenuBar() {
return this.menuBar;
}
- /**
- * Makes the panel visible and sets the menu bar of the frame
- */
+ /** Makes the panel visible and sets the menu bar of the frame */
@Override
public void makeVisible() {
render();
@@ -124,9 +119,7 @@ private static ImageIcon resizeButtonIcon(ImageIcon icon, int width, int height)
return new ImageIcon(resizedImage);
}
- /**
- * Initializes the buttons for this panel
- */
+ /** Initializes the buttons for this panel */
private void initButtons() {
this.buttons = new JButton[3];
@@ -188,8 +181,8 @@ public void actionPerformed(ActionEvent e) {
}
/**
- * Opens a folder chooser dialog and grades puzzles in the selected folder.
- * The results are written to a CSV file.
+ * Opens a folder chooser dialog and grades puzzles in the selected folder. The results are
+ * written to a CSV file.
*/
public void checkFolder() {
GameBoardFacade facade = GameBoardFacade.getInstance();
@@ -276,12 +269,12 @@ public void checkFolder() {
}
/**
- * Processes XML files within a selected directory and generates a CSV report on their "solved?" status.
- * The method allows the user to select a directory, and evaluates each XML file for a "solved?" status.
- * Results are saved in a "result.csv" file.
+ * Processes XML files within a selected directory and generates a CSV report on their "solved?"
+ * status. The method allows the user to select a directory, and evaluates each XML file for a
+ * "solved?" status. Results are saved in a "result.csv" file.
*
- * @effect Selects a directory, processes each XML file to check for "solved?" status,
- * and writes results to "result.csv". Opens the CSV file upon completion.
+ * @effect Selects a directory, processes each XML file to check for "solved?" status, and
+ * writes results to "result.csv". Opens the CSV file upon completion.
*/
private void use_xml_to_check() {
/* Select a folder, go through each .xml file in the subfolders, look for "isSolved" flag */
@@ -481,8 +474,8 @@ public void endDocument() throws SAXException {
}
/**
- * Initializes the text labels for the user interface.
- * Sets up labels for welcome message, led by Bram, and version information.
+ * Initializes the text labels for the user interface. Sets up labels for welcome message, led
+ * by Bram, and version information.
*/
private void initText() {
// TODO: add version text after auto-changing version label is implemented. (text[2] =
@@ -505,9 +498,7 @@ private void initText() {
this.text[1] = credits;
}
- /**
- * Renders the user interface components
- */
+ /** Renders the user interface components */
private void render() {
this.removeAll();
@@ -536,7 +527,8 @@ private void render() {
/**
* Opens the puzzle editor dialog with no selected puzzle, leaving a blank panel
*
- * @throws IllegalArgumentException if the configuration parameters are invalid (should never happen)
+ * @throws IllegalArgumentException if the configuration parameters are invalid (should never
+ * happen)
*/
private void openPuzzleEditorDialog() {
String game = "";
@@ -668,11 +660,10 @@ private void traverseDir(File folder, BufferedWriter writer, String path) throws
*/
public void openEditorWithNewPuzzle(String game, int rows, int columns)
throws IllegalArgumentException {
- if (game.equals("")) {
+ if (game.isEmpty()) {
this.legupUI.displayPanel(2);
this.legupUI.getPuzzleEditor().loadPuzzleFromHome(game, rows, columns);
- }
- else {
+ } else {
// Validate the dimensions
GameBoardFacade facade = GameBoardFacade.getInstance();
boolean isValidDimensions = facade.validateDimensions(game, rows, columns);
@@ -695,7 +686,6 @@ public void openEditorWithNewPuzzle(String game, int rows, int columns)
this.legupUI.displayPanel(2);
this.legupUI.getPuzzleEditor().loadPuzzleFromHome(game, rows, columns);
}
-
}
/**
diff --git a/src/main/java/edu/rpi/legup/ui/LegupPanel.java b/src/main/java/edu/rpi/legup/ui/LegupPanel.java
index 38c44cbe4..639f21211 100644
--- a/src/main/java/edu/rpi/legup/ui/LegupPanel.java
+++ b/src/main/java/edu/rpi/legup/ui/LegupPanel.java
@@ -3,17 +3,14 @@
import javax.swing.*;
/**
- * An abstract base class for panels in the LEGUP application.
- * This class extends {@link JPanel} and defines common properties and methods
- * for all panels in the LEGUP user interface
- * (currently only implements toolbar scale)
+ * An abstract base class for panels in the LEGUP application. This class extends {@link JPanel} and
+ * defines common properties and methods for all panels in the LEGUP user interface (currently only
+ * implements toolbar scale)
*/
public abstract class LegupPanel extends JPanel {
/** Alerts panel that it will be going visible now */
protected final int TOOLBAR_ICON_SCALE = 40;
- /**
- * Abstract method to make the panel visible
- */
+ /** Abstract method to make the panel visible */
public abstract void makeVisible();
}
diff --git a/src/main/java/edu/rpi/legup/ui/LegupUI.java b/src/main/java/edu/rpi/legup/ui/LegupUI.java
index 30857f05f..75f822a6c 100644
--- a/src/main/java/edu/rpi/legup/ui/LegupUI.java
+++ b/src/main/java/edu/rpi/legup/ui/LegupUI.java
@@ -15,9 +15,9 @@
import org.apache.logging.log4j.Logger;
/**
- * The main user interface class for the LEGUP application.
- * This class extends {@link JFrame} and implements {@link WindowListener}
- * to manage the overall window and provide functionality for displaying various panels.
+ * The main user interface class for the LEGUP application. This class extends {@link JFrame} and
+ * implements {@link WindowListener} to manage the overall window and provide functionality for
+ * displaying various panels.
*/
public class LegupUI extends JFrame implements WindowListener {
private static final Logger LOGGER = LogManager.getLogger(LegupUI.class.getName());
@@ -96,10 +96,7 @@ public void keyTyped(KeyEvent e) {
setVisible(true);
}
- /**
- * Initializes the panels used in the UI.
- * Sets up the layout and adds panels to the window.
- */
+ /** Initializes the panels used in the UI. Sets up the layout and adds panels to the window. */
private void initPanels() {
window = new JPanel();
window.setLayout(new BorderLayout());
@@ -148,9 +145,7 @@ public PuzzleEditorPanel getPuzzleEditor() {
return (PuzzleEditorPanel) panels[2];
}
- /**
- * Repaints the tree view in the proof editor.
- */
+ /** Repaints the tree view in the proof editor. */
public void repaintTree() {
getProofEditor().repaintTree();
}
diff --git a/src/main/java/edu/rpi/legup/ui/PickGameDialog.java b/src/main/java/edu/rpi/legup/ui/PickGameDialog.java
index a6501e2a0..3b66931a7 100644
--- a/src/main/java/edu/rpi/legup/ui/PickGameDialog.java
+++ b/src/main/java/edu/rpi/legup/ui/PickGameDialog.java
@@ -16,9 +16,8 @@
import javax.swing.JTextField;
/**
- * A dialog for selecting a game.
- * This class extends {@link JDialog} and implements {@link ActionListener}
- * to handle user interactions for selecting a game type and puzzle file.
+ * A dialog for selecting a game. This class extends {@link JDialog} and implements {@link
+ * ActionListener} to handle user interactions for selecting a game type and puzzle file.
*/
public class PickGameDialog extends JDialog implements ActionListener {
JLabel gameLabel = new JLabel("Game:");
@@ -112,8 +111,8 @@ public PickGameDialog(JFrame parent, boolean pickBothAtOnce) {
}
/**
- * Initializes the available games and puzzles.
- * Populates the {@link JComboBox} with game types and sets up the puzzle options.
+ * Initializes the available games and puzzles. Populates the {@link JComboBox} with game types
+ * and sets up the puzzle options.
*/
public void initPuzzles() {
Object[] o = GameBoardFacade.getInstance().getConfig().getPuzzleClassNames().toArray();
@@ -156,9 +155,8 @@ public String getGame() {
}
/**
- * Handles action events for the dialog components.
- * Responds to user interactions such as selecting a puzzle, choosing a puzzle file,
- * and pressing the 'Ok' or 'Cancel' buttons.
+ * Handles action events for the dialog components. Responds to user interactions such as
+ * selecting a puzzle, choosing a puzzle file, and pressing the 'Ok' or 'Cancel' buttons.
*
* @param e the action event
*/
diff --git a/src/main/java/edu/rpi/legup/ui/PreferencesDialog.java b/src/main/java/edu/rpi/legup/ui/PreferencesDialog.java
index c8639f796..e90d06640 100644
--- a/src/main/java/edu/rpi/legup/ui/PreferencesDialog.java
+++ b/src/main/java/edu/rpi/legup/ui/PreferencesDialog.java
@@ -18,10 +18,10 @@
import javax.swing.*;
/**
- * A dialog for managing user preferences in the LEGUP application.
- * This dialog allows users to configure various settings such as screen mode,
- * update preferences, work directory path, and specific features related to board and tree views.
- * Users can access this dialog from the home screen or proof editor.
+ * A dialog for managing user preferences in the LEGUP application. This dialog allows users to
+ * configure various settings such as screen mode, update preferences, work directory path, and
+ * specific features related to board and tree views. Users can access this dialog from the home
+ * screen or proof editor.
*/
public class PreferencesDialog extends JDialog {
@@ -364,10 +364,9 @@ private JScrollPane createPuzzleTab(Puzzle puzzle) {
}
/**
- * Creates a JPanel that represents a single row for a rule in the rule list.
- * Each row displays the rule's name and an area for showing keyboard shortcuts
- * associated with the rule. The keyboard shortcuts are dynamically updated based
- * on user input.
+ * Creates a JPanel that represents a single row for a rule in the rule list. Each row displays
+ * the rule's name and an area for showing keyboard shortcuts associated with the rule. The
+ * keyboard shortcuts are dynamically updated based on user input.
*
* @param rule the rule object to be displayed
* @return a JPanel representing the row for the rule
@@ -425,9 +424,8 @@ public void keyPressed(KeyEvent e) {
}
/**
- * Creates a JPanel containing a left-aligned label with the specified text.
- * This label is typically used for section headings or descriptive text in the
- * preferences dialog.
+ * Creates a JPanel containing a left-aligned label with the specified text. This label is
+ * typically used for section headings or descriptive text in the preferences dialog.
*
* @param text the text to be displayed on the label
* @return a JPanel containing the left-aligned label
@@ -446,8 +444,8 @@ private JPanel createLeftLabel(String text) {
}
/**
- * Creates a JSeparator with a maximum height of 5 pixels.
- * This separator is used to visually divide sections in the preferences dialog.
+ * Creates a JSeparator with a maximum height of 5 pixels. This separator is used to visually
+ * divide sections in the preferences dialog.
*
* @return a JSeparator with a fixed height
*/
@@ -458,10 +456,10 @@ private JSeparator createLineSeparator() {
}
/**
- * Applies the current user preferences and updates the associated components.
- * This method retrieves user preferences from the dialog's components and stores
- * them in the {@link LegupPreferences} instance. It also updates the rule panels
- * in the rules frame if it is not null.
+ * Applies the current user preferences and updates the associated components. This method
+ * retrieves user preferences from the dialog's components and stores them in the {@link
+ * LegupPreferences} instance. It also updates the rule panels in the rules frame if it is not
+ * null.
*/
public void applyPreferences() {
LegupPreferences prefs = LegupPreferences.getInstance();
diff --git a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
index 88c1ee427..5ecbd5564 100644
--- a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
+++ b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
@@ -17,7 +17,6 @@
import edu.rpi.legup.ui.boardview.BoardView;
import edu.rpi.legup.ui.proofeditorui.rulesview.RuleFrame;
import edu.rpi.legup.ui.proofeditorui.treeview.TreePanel;
-import edu.rpi.legup.ui.proofeditorui.treeview.TreeTransitionView;
import edu.rpi.legup.ui.proofeditorui.treeview.TreeViewSelection;
import edu.rpi.legup.user.Submission;
import java.awt.*;
@@ -38,12 +37,11 @@
import org.apache.logging.log4j.Logger;
/**
- * {@code ProofEditorPanel} is a panel that serves as the main user interface
- * component for the proof editing functionality of LEGUP. It provides
- * the graphical components and interactive elements necessary for editing and managing
- * proofs, including toolbars, menus, and views for different aspects of proof editing.
- * It also manages interactions with the rest of the application and updates the UI
- * based on user actions and application state changes.
+ * {@code ProofEditorPanel} is a panel that serves as the main user interface component for the
+ * proof editing functionality of LEGUP. It provides the graphical components and interactive
+ * elements necessary for editing and managing proofs, including toolbars, menus, and views for
+ * different aspects of proof editing. It also manages interactions with the rest of the application
+ * and updates the UI based on user actions and application state changes.
*/
public class ProofEditorPanel extends LegupPanel implements IHistoryListener {
private static final Logger LOGGER = LogManager.getLogger(ProofEditorPanel.class.getName());
@@ -136,8 +134,8 @@ public ProofEditorPanel(FileDialog fileDialog, JFrame frame, LegupUI legupUI) {
}
/**
- * Makes the panel visible by setting up the toolbar and content components.
- * This method also sets the menu bar of the frame to the one used by this panel.
+ * Makes the panel visible by setting up the toolbar and content components. This method also
+ * sets the menu bar of the frame to the one used by this panel.
*/
@Override
public void makeVisible() {
@@ -149,20 +147,22 @@ public void makeVisible() {
}
/**
- * Constructs and returns the {@code JMenuBar} for this panel.
- * It populates it with various {@code JMenu} and {@code JMenuItem} components related
- * to file operations, editing, viewing, and proof management.
- * The menu bar includes:
+ * Constructs and returns the {@code JMenuBar} for this panel. It populates it with various
+ * {@code JMenu} and {@code JMenuItem} components related to file operations, editing, viewing,
+ * and proof management. The menu bar includes:
+ *
*
- *
- *
- *
*/
private void setupToolBar2() {
@@ -933,9 +935,10 @@ private void setupToolBar2() {
JButton redo = new JButton("Redo", RedoImageIcon);
redo.setFocusPainted(false);
- redo.addActionListener((ActionEvent) -> {
- GameBoardFacade.getInstance().getHistory().redo();
- });
+ redo.addActionListener(
+ (ActionEvent) -> {
+ GameBoardFacade.getInstance().getHistory().redo();
+ });
getToolBar2Buttons()[2] = redo;
toolBar2.add(getToolBar2Buttons()[2]);
@@ -960,7 +963,6 @@ private void setupToolBar2() {
getToolBar2Buttons()[3] = check;
toolBar2.add(getToolBar2Buttons()[3]);
-
this.add(toolBar2, BorderLayout.NORTH);
}
@@ -1001,8 +1003,9 @@ public JButton[] getToolBar2Buttons() {
}
/**
- * Uses the {@link GameBoardFacade} to obtain the current puzzle and board. If the puzzle is complete,
- * it notifies the user of a correct proof. If not, it alerts the user that the board is not solved.
+ * Uses the {@link GameBoardFacade} to obtain the current puzzle and board. If the puzzle is
+ * complete, it notifies the user of a correct proof. If not, it alerts the user that the board
+ * is not solved.
*/
private void checkProof() {
GameBoardFacade facade = GameBoardFacade.getInstance();
@@ -1031,42 +1034,49 @@ private void checkProof() {
}
/**
- * Retrieves the puzzle name from the `GameBoardFacade` and opens a corresponding rules page in the default web browser.
+ * Retrieves the puzzle name from the `GameBoardFacade` and opens a corresponding rules page in
+ * the default web browser.
*
* @throws IOException if an error occurs while trying to open the web page
*/
private void directionsToolButton() {
String puzzleName = GameBoardFacade.getInstance().getPuzzleModule().getName();
- //System.out.println(puzzleName);
+ // System.out.println(puzzleName);
try {
if (puzzleName.equals("Fillapix")) {
java.awt.Desktop.getDesktop()
- .browse(URI.create("https://github.com/Bram-Hub/LEGUP/wiki/Fill-a-pix-rules"));
- }
- else if (puzzleName.equals("LightUp")) {
+ .browse(
+ URI.create(
+ "https://github.com/Bram-Hub/LEGUP/wiki/Fill-a-pix-rules"));
+ } else if (puzzleName.equals("LightUp")) {
java.awt.Desktop.getDesktop()
- .browse(URI.create("https://github.com/Bram-Hub/LEGUP/wiki/Light-up-rules"));
- }
- else if (puzzleName.equals("TreeTent")) {
+ .browse(
+ URI.create(
+ "https://github.com/Bram-Hub/LEGUP/wiki/Light-up-rules"));
+ } else if (puzzleName.equals("TreeTent")) {
java.awt.Desktop.getDesktop()
- .browse(URI.create("https://github.com/Bram-Hub/LEGUP/wiki/Tree-tent-rules"));
- }
- else if (puzzleName.equals("ShortTruthTables")) {
+ .browse(
+ URI.create(
+ "https://github.com/Bram-Hub/LEGUP/wiki/Tree-tent-rules"));
+ } else if (puzzleName.equals("ShortTruthTables")) {
java.awt.Desktop.getDesktop()
- .browse(URI.create("https://github.com/Bram-Hub/LEGUP/wiki/Short-truth-table-rules"));
- }
- else {
+ .browse(
+ URI.create(
+ "https://github.com/Bram-Hub/LEGUP/wiki/Short-truth-table-rules"));
+ } else {
java.awt.Desktop.getDesktop()
- .browse(URI.create("https://github.com/Bram-Hub/LEGUP/wiki/" + puzzleName + "-rules"));
+ .browse(
+ URI.create(
+ "https://github.com/Bram-Hub/LEGUP/wiki/"
+ + puzzleName
+ + "-rules"));
}
} catch (IOException e) {
LOGGER.error("Can't open web page");
}
}
- /**
- * Repaints the board view and tree panel
- */
+ /** Repaints the board view and tree panel */
private void repaintAll() {
boardView.repaint();
treePanel.repaint();
@@ -1081,7 +1091,6 @@ private void repaintAll() {
public void setPuzzleView(Puzzle puzzle) {
this.boardView = puzzle.getBoardView();
-
dynamicBoardView = new DynamicView(boardView, DynamicViewType.BOARD);
this.topHalfPanel.setRightComponent(dynamicBoardView);
this.topHalfPanel.setVisible(true);
@@ -1107,12 +1116,11 @@ public void setPuzzleView(Puzzle puzzle) {
reloadGui();
}
- /**
- * Calls {@code repaintTree()} to refresh the tree view.
- */
+ /** Calls {@code repaintTree()} to refresh the tree view. */
public void reloadGui() {
repaintTree();
}
+
/**
* Updates the tree view displayed in the tree panel to reflect the current state of the tree.
*/
@@ -1242,7 +1250,6 @@ public BoardView getBoardView() {
return boardView;
}
-
/**
* Returns the current dynamic board view.
*
@@ -1278,12 +1285,11 @@ public void onPushChange(ICommand command) {
}
/**
- * Updates the state of the undo and redo buttons to reflect that there are no actions
- * available to undo or redo. It disables both buttons when the history is cleared.
+ * Updates the state of the undo and redo buttons to reflect that there are no actions available
+ * to undo or redo. It disables both buttons when the history is cleared.
*/
@Override
- public void onClearHistory() {
- }
+ public void onClearHistory() {}
/**
* Called when an action is redone
@@ -1359,10 +1365,7 @@ public void showStatus(String status, boolean error, int timer) {
// TODO: implement
}
-
- /**
- * Zooms the tree view to fit within the available screen space
- */
+ /** Zooms the tree view to fit within the available screen space */
protected void fitTreeViewToScreen() {
this.treePanel.getTreeView().zoomFit();
}
diff --git a/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java b/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
index 2f3c16eac..7c2ba06ff 100644
--- a/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
+++ b/src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
@@ -10,14 +10,9 @@
import edu.rpi.legup.history.IHistoryListener;
import edu.rpi.legup.model.Puzzle;
import edu.rpi.legup.model.PuzzleExporter;
-import edu.rpi.legup.model.tree.Tree;
-import edu.rpi.legup.model.tree.TreeNode;
-import edu.rpi.legup.model.tree.TreeTransition;
import edu.rpi.legup.save.ExportFileException;
import edu.rpi.legup.save.InvalidFileFormatException;
-import edu.rpi.legup.ui.HomePanel;
import edu.rpi.legup.ui.boardview.BoardView;
-import edu.rpi.legup.ui.proofeditorui.treeview.TreeViewSelection;
import edu.rpi.legup.ui.puzzleeditorui.elementsview.ElementFrame;
import java.awt.*;
import java.awt.event.ActionEvent;
@@ -27,7 +22,6 @@
import java.io.IOException;
import java.net.URI;
import java.net.URL;
-import java.util.List;
import java.util.Objects;
import javax.swing.*;
import javax.swing.border.TitledBorder;
@@ -35,9 +29,9 @@
import org.apache.logging.log4j.Logger;
/**
- * Represents the panel used for puzzle editor in the LEGUP.
- * This panel includes a variety of UI components such as toolbars, menus, and split panes.
- * It handles puzzle file operations, including creating and editing puzzles.
+ * Represents the panel used for puzzle editor in the LEGUP. This panel includes a variety of UI
+ * components such as toolbars, menus, and split panes. It handles puzzle file operations, including
+ * creating and editing puzzles.
*/
public class PuzzleEditorPanel extends LegupPanel implements IHistoryListener {
@@ -71,7 +65,8 @@ public class PuzzleEditorPanel extends LegupPanel implements IHistoryListener {
private File puzzleFile;
/**
- * Constructs a {@code PuzzleEditorPanel} with the specified file dialog, frame, and Legup UI instance
+ * Constructs a {@code PuzzleEditorPanel} with the specified file dialog, frame, and Legup UI
+ * instance
*
* @param fileDialog the file dialog used for file operations
* @param frame the main application frame
@@ -86,8 +81,8 @@ public PuzzleEditorPanel(FileDialog fileDialog, JFrame frame, LegupUI legupUI) {
}
/**
- * Sets up the content of the panel, including the layout and UI components.
- * Initializes and configures the {@code DynamicView} and {@code ElementFrame}, and adds them to the panel.
+ * Sets up the content of the panel, including the layout and UI components. Initializes and
+ * configures the {@code DynamicView} and {@code ElementFrame}, and adds them to the panel.
*/
protected void setupContent() {
JSplitPane splitPanel;
@@ -121,9 +116,8 @@ protected void setupContent() {
}
/**
- * Configures the menu bar with menus and menu items for the application.
- * Adds actions for opening, creating, and exiting puzzles.
- * Also sets up help and about menu items.
+ * Configures the menu bar with menus and menu items for the application. Adds actions for
+ * opening, creating, and exiting puzzles. Also sets up help and about menu items.
*/
public void setMenuBar() {
String os = LegupUI.getOS();
@@ -147,13 +141,14 @@ public void setMenuBar() {
}
// file>create
JMenuItem createPuzzle = new JMenuItem("Create");
- createPuzzle.addActionListener((ActionEvent) -> {
- hp = new HomePanel(this.frame, this.legupUI);
- cpd = new CreatePuzzleDialog(this.frame, hp);
- cpd.setLocationRelativeTo(null);
- cpd.setVisible(true);
- existingPuzzle = false;
- });
+ createPuzzle.addActionListener(
+ (ActionEvent) -> {
+ hp = new HomePanel(this.frame, this.legupUI);
+ cpd = new CreatePuzzleDialog(this.frame, hp);
+ cpd.setLocationRelativeTo(null);
+ cpd.setVisible(true);
+ existingPuzzle = false;
+ });
if (os.equals("mac")) {
createPuzzle.setAccelerator(
KeyStroke.getKeyStroke(
@@ -162,7 +157,6 @@ public void setMenuBar() {
createPuzzle.setAccelerator(KeyStroke.getKeyStroke('C', InputEvent.CTRL_DOWN_MASK));
}
-
JMenuItem exit = new JMenuItem("Exit");
exit.addActionListener((ActionEvent) -> exitEditor());
if (os.equals("mac")) {
@@ -174,7 +168,7 @@ public void setMenuBar() {
}
menus[0].add(openPuzzle);
menus[0].add(createPuzzle);
- //menus[0].add(directSavePuzzle);
+ // menus[0].add(directSavePuzzle);
menus[0].add(exit);
// EDIT
@@ -186,7 +180,7 @@ public void setMenuBar() {
fitBoardToScreen = new JMenuItem("Fit Board to Screen");
// TODO: Undo operation currently does not get updated correctly in history
- //menus[1].add(undo);
+ // menus[1].add(undo);
undo.addActionListener((ActionEvent) -> GameBoardFacade.getInstance().getHistory().undo());
if (os.equals("mac")) {
undo.setAccelerator(
@@ -197,7 +191,7 @@ public void setMenuBar() {
}
// TODO: Redo operation currently does not get updated correctly in history
- //menus[1].add(redo);
+ // menus[1].add(redo);
// Created action to support two keybinds (CTRL-SHIFT-Z, CTRL-Y)
Action redoAction =
new AbstractAction() {
@@ -272,10 +266,9 @@ public void actionPerformed(ActionEvent e) {
}
/**
- * Exits the puzzle editor and resets the application state to its initial condition.
- * This method clears the current puzzle from the {@code GameBoardFacade},
- * resets the display to the initial panel, and nullifies references to the
- * tree panel and board view.
+ * Exits the puzzle editor and resets the application state to its initial condition. This
+ * method clears the current puzzle from the {@code GameBoardFacade}, resets the display to the
+ * initial panel, and nullifies references to the tree panel and board view.
*/
public void exitEditor() {
// Wipes the puzzle entirely as if LEGUP just started
@@ -286,8 +279,8 @@ public void exitEditor() {
}
/**
- * Makes the panel visible by setting up the toolbar, content, and menu bar.
- * This method is called to refresh the panel's user interface.
+ * Makes the panel visible by setting up the toolbar, content, and menu bar. This method is
+ * called to refresh the panel's user interface.
*/
@Override
public void makeVisible() {
@@ -298,8 +291,8 @@ public void makeVisible() {
}
/**
- * Sets up the first toolbar with buttons for opening and creating puzzles.
- * This method initializes the toolbar buttons with their icons and actions.
+ * Sets up the first toolbar with buttons for opening and creating puzzles. This method
+ * initializes the toolbar buttons with their icons and actions.
*/
private void setupToolBar1() {
setToolBar1Buttons(new JButton[2]);
@@ -341,13 +334,14 @@ private void setupToolBar1() {
JButton create = new JButton("Create", CreateImageIcon);
create.setFocusPainted(false);
- create.addActionListener((ActionEvent) -> {
- hp = new HomePanel(this.frame, this.legupUI);
- cpd = new CreatePuzzleDialog(this.frame, hp);
- cpd.setLocationRelativeTo(null);
- cpd.setVisible(true);
- existingPuzzle = false;
- });
+ create.addActionListener(
+ (ActionEvent) -> {
+ hp = new HomePanel(this.frame, this.legupUI);
+ cpd = new CreatePuzzleDialog(this.frame, hp);
+ cpd.setLocationRelativeTo(null);
+ cpd.setVisible(true);
+ existingPuzzle = false;
+ });
getToolBar1Buttons()[1] = create;
toolBar1.setFloatable(false);
@@ -383,19 +377,22 @@ private void setupToolBar2() {
resetButton.setFocusPainted(false);
resetButton.addActionListener(
- a -> {
- if (existingPuzzle) {
- legupUI.getPuzzleEditor().loadPuzzle(fileName, puzzleFile);
- }
- else {
- if (cpd.getGame().equals("ShortTruthTable")) {
- GameBoardFacade.getInstance().loadPuzzle(cpd.getGame(), cpd.getTextArea());
- }
- else {
- GameBoardFacade.getInstance().loadPuzzle(cpd.getGame(), Integer.valueOf(cpd.getRows()), Integer.valueOf(cpd.getColumns()));
+ a -> {
+ if (existingPuzzle) {
+ legupUI.getPuzzleEditor().loadPuzzle(fileName, puzzleFile);
+ } else {
+ if (cpd.getGame().equals("ShortTruthTable")) {
+ GameBoardFacade.getInstance()
+ .loadPuzzle(cpd.getGame(), cpd.getTextArea());
+ } else {
+ GameBoardFacade.getInstance()
+ .loadPuzzle(
+ cpd.getGame(),
+ Integer.valueOf(cpd.getRows()),
+ Integer.valueOf(cpd.getColumns()));
+ }
}
- }
- });
+ });
getToolBar2Buttons()[0] = resetButton;
toolBar2.add(getToolBar2Buttons()[0]);
@@ -500,11 +497,12 @@ public void loadPuzzleFromHome(String game, String[] statements) {
}
/**
- * Prompts the user to select a puzzle file to open.
- * Opens a file chooser dialog and returns the selected file's name and file object.
- * If a puzzle is currently loaded, prompts the user to confirm if they want to open a new puzzle.
+ * Prompts the user to select a puzzle file to open. Opens a file chooser dialog and returns the
+ * selected file's name and file object. If a puzzle is currently loaded, prompts the user to
+ * confirm if they want to open a new puzzle.
*
- * @return an array containing the selected file name and file object, or null if the operation was canceled
+ * @return an array containing the selected file name and file object, or null if the operation
+ * was canceled
*/
public Object[] promptPuzzle() {
GameBoardFacade facade = GameBoardFacade.getInstance();
@@ -548,9 +546,9 @@ public Object[] promptPuzzle() {
}
/**
- * Loads a puzzle by prompting the user to select a puzzle file.
- * If the user cancels the operation, no action is taken. If a puzzle file is selected,
- * it will be loaded using the file name and file object.
+ * Loads a puzzle by prompting the user to select a puzzle file. If the user cancels the
+ * operation, no action is taken. If a puzzle file is selected, it will be loaded using the file
+ * name and file object.
*/
public void loadPuzzle() {
Object[] items = promptPuzzle();
@@ -564,9 +562,8 @@ public void loadPuzzle() {
}
/**
- * Loads a puzzle from the specified file.
- * If the puzzle file is valid and exists, it loads the puzzle and updates the UI.
- * If the file format is invalid, an error message is displayed.
+ * Loads a puzzle from the specified file. If the puzzle file is valid and exists, it loads the
+ * puzzle and updates the UI. If the file format is invalid, an error message is displayed.
*
* @param fileName the name of the puzzle file
* @param puzzleFile the file object representing the puzzle file
@@ -595,9 +592,8 @@ public void loadPuzzle(String fileName, File puzzleFile) {
}
/**
- * Displays a confirmation dialog with the given instruction message.
- * The method returns true if the user selected "No" or cancelled the dialog,
- * and false if the user selected "Yes".
+ * Displays a confirmation dialog with the given instruction message. The method returns true if
+ * the user selected "No" or cancelled the dialog, and false if the user selected "Yes".
*
* @param instr the instruction message to display in the confirmation dialog
* @return true if the user selected "No" or canceled; false if the user selected "Yes"
@@ -607,31 +603,21 @@ public boolean noQuit(String instr) {
return n != JOptionPane.YES_OPTION;
}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
@Override
public void onPushChange(ICommand command) {}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
@Override
public void onUndo(boolean isBottom, boolean isTop) {}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
@Override
public void onRedo(boolean isBottom, boolean isTop) {}
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
@Override
- public void onClearHistory() {
- }
-
+ public void onClearHistory() {}
/**
* Returns the current board view
@@ -678,16 +664,14 @@ public void setToolBar2Buttons(JButton[] toolBar2Buttons) {
this.toolBar2Buttons = toolBar2Buttons;
}
- /**
- * Repaints the current board view
- */
+ /** Repaints the current board view */
private void repaintAll() {
boardView.repaint();
}
/**
- * Sets the puzzle view based on the provided puzzle object.
- * Updates the UI components to display the new puzzle.
+ * Sets the puzzle view based on the provided puzzle object. Updates the UI components to
+ * display the new puzzle.
*
* @param puzzle the puzzle object to display
*/
@@ -734,11 +718,11 @@ private void direct_save() {
}
/**
- * Saves the current puzzle to a user-selected directory.
- * Prompts the user to select a directory and saves the puzzle to that directory.
- * Returns the path where the puzzle was saved.
+ * Saves the current puzzle to a user-selected directory. Prompts the user to select a directory
+ * and saves the puzzle to that directory. Returns the path where the puzzle was saved.
*
- * @return the path where the puzzle was saved, or an empty string if the save operation was canceled
+ * @return the path where the puzzle was saved, or an empty string if the save operation was
+ * canceled
*/
private String savePuzzle() {
Puzzle puzzle = GameBoardFacade.getInstance().getPuzzleModule();
diff --git a/src/main/java/edu/rpi/legup/ui/ScrollView.java b/src/main/java/edu/rpi/legup/ui/ScrollView.java
index 18aff4d1c..589573154 100644
--- a/src/main/java/edu/rpi/legup/ui/ScrollView.java
+++ b/src/main/java/edu/rpi/legup/ui/ScrollView.java
@@ -7,8 +7,9 @@
import javax.swing.*;
/**
- * ScrollView extends {@link JScrollPane} to provide a customizable view with zoom and scroll capabilities.
- * It uses a {@link ZoomablePane} as the canvas and allows for zooming and scrolling with respect to the canvas content.
+ * ScrollView extends {@link JScrollPane} to provide a customizable view with zoom and scroll
+ * capabilities. It uses a {@link ZoomablePane} as the canvas and allows for zooming and scrolling
+ * with respect to the canvas content.
*/
public class ScrollView extends JScrollPane {
private static final Logger LOGGER = Logger.getLogger(ScrollView.class.getName());
@@ -170,7 +171,8 @@ public void zoom(int n, Point point) {
}
/**
- * Adjusts the zoom level to the given scale and centers the viewport on the current center point
+ * Adjusts the zoom level to the given scale and centers the viewport on the current center
+ * point
*
* @param newScale the new scale to set
*/
diff --git a/src/main/java/edu/rpi/legup/ui/ToolbarName.java b/src/main/java/edu/rpi/legup/ui/ToolbarName.java
index 53936a141..622d16d8d 100644
--- a/src/main/java/edu/rpi/legup/ui/ToolbarName.java
+++ b/src/main/java/edu/rpi/legup/ui/ToolbarName.java
@@ -1,8 +1,8 @@
package edu.rpi.legup.ui;
/**
- * This enum defines constants for toolbar names used in the user interface.
- * Each represents a specific toolbar action.
+ * This enum defines constants for toolbar names used in the user interface. Each represents a
+ * specific toolbar action.
*/
public enum ToolbarName {
DIRECTIONS,
diff --git a/src/main/java/edu/rpi/legup/ui/ZoomWidget.java b/src/main/java/edu/rpi/legup/ui/ZoomWidget.java
index 34e828250..40f36113f 100644
--- a/src/main/java/edu/rpi/legup/ui/ZoomWidget.java
+++ b/src/main/java/edu/rpi/legup/ui/ZoomWidget.java
@@ -36,17 +36,13 @@ public ZoomWidget(ScrollView parent) {
addMouseListener(open);
}
- /**
- * A {@code JPopupMenu} subclass that contains a vertical slider for adjusting zoom level.
- */
+ /** A {@code JPopupMenu} subclass that contains a vertical slider for adjusting zoom level. */
private class PopupSlider extends JPopupMenu implements ChangeListener {
private static final long serialVersionUID = 8225019381200459814L;
private JSlider slider;
- /**
- * Constructs a {@code PopupSlider} with a vertical slider
- */
+ /** Constructs a {@code PopupSlider} with a vertical slider */
public PopupSlider() {
slider = new JSlider(SwingConstants.VERTICAL, 0, 400, 200);
slider.setMajorTickSpacing(25);
diff --git a/src/main/java/edu/rpi/legup/ui/boardview/BoardView.java b/src/main/java/edu/rpi/legup/ui/boardview/BoardView.java
index fa3ec70b7..18b47d98b 100644
--- a/src/main/java/edu/rpi/legup/ui/boardview/BoardView.java
+++ b/src/main/java/edu/rpi/legup/ui/boardview/BoardView.java
@@ -12,8 +12,8 @@
import java.util.ArrayList;
/**
- * An abstract class representing a view for a board in the puzzle game.
- * It handles the visual representation and user interactions with the board elements.
+ * An abstract class representing a view for a board in the puzzle game. It handles the visual
+ * representation and user interactions with the board elements.
*/
public abstract class BoardView extends ScrollView implements IBoardListener {
protected TreeElement treeElement;
@@ -129,9 +129,7 @@ public void setBoard(Board board) {
}
}
- /**
- * Configures the view to handle case interactions
- */
+ /** Configures the view to handle case interactions */
protected void setCasePickable() {
CaseBoard caseBoard = (CaseBoard) board;
Board baseBoard = caseBoard.getBaseBoard();
@@ -199,7 +197,6 @@ public ElementController getElementController() {
return elementController;
}
-
@Override
public void draw(Graphics2D graphics2D) {
drawBoard(graphics2D);
diff --git a/src/main/java/edu/rpi/legup/ui/boardview/DataSelectionView.java b/src/main/java/edu/rpi/legup/ui/boardview/DataSelectionView.java
index a3d82b461..bc40e3d58 100644
--- a/src/main/java/edu/rpi/legup/ui/boardview/DataSelectionView.java
+++ b/src/main/java/edu/rpi/legup/ui/boardview/DataSelectionView.java
@@ -6,8 +6,8 @@
import javax.swing.border.BevelBorder;
/**
- * DataSelectionView is a popup menu used for selecting data elements.
- * It extends JPopupMenu and is styled with a gray background and a raised bevel border.
+ * DataSelectionView is a popup menu used for selecting data elements. It extends JPopupMenu and is
+ * styled with a gray background and a raised bevel border.
*/
public class DataSelectionView extends JPopupMenu {
diff --git a/src/main/java/edu/rpi/legup/ui/boardview/ElementSelection.java b/src/main/java/edu/rpi/legup/ui/boardview/ElementSelection.java
index 9ad4132d6..eaa85082d 100644
--- a/src/main/java/edu/rpi/legup/ui/boardview/ElementSelection.java
+++ b/src/main/java/edu/rpi/legup/ui/boardview/ElementSelection.java
@@ -4,8 +4,8 @@
import java.util.ArrayList;
/**
- * ElementSelection manages the selection and hover states of ElementViews.
- * It maintains a list of selected elements, the currently hovered element, and the mouse point location.
+ * ElementSelection manages the selection and hover states of ElementViews. It maintains a list of
+ * selected elements, the currently hovered element, and the mouse point location.
*/
public class ElementSelection {
private ArrayList