From affb246bbf57b536b4173d881f9d153b124969ee Mon Sep 17 00:00:00 2001 From: Chase-Grajeda Date: Fri, 2 Dec 2022 17:24:38 -0500 Subject: [PATCH] Skeleton + comments Added skeleton function for drag+drop and extra comments Co-Authored-By: Weijun Li <83390795+wei-jun7@users.noreply.github.com> --- src/main/java/edu/rpi/legup/ui/HomePanel.java | 4 ++++ .../edu/rpi/legup/ui/ProofEditorPanel.java | 21 ++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/main/java/edu/rpi/legup/ui/HomePanel.java b/src/main/java/edu/rpi/legup/ui/HomePanel.java index fb3e1db0e..823d96577 100644 --- a/src/main/java/edu/rpi/legup/ui/HomePanel.java +++ b/src/main/java/edu/rpi/legup/ui/HomePanel.java @@ -277,6 +277,10 @@ public void checkfolder(){ } } + /* + This function is use to check each function xml proof file have the flag = true. + Also, we will go to check each file is xml file or not which we have 3 result solve, unsolve and ungradeable + */ public void use_xml_to_check() throws Exception{ GameBoardFacade facade = GameBoardFacade.getInstance(); diff --git a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java index 150b04b03..4aa8d60d2 100644 --- a/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java +++ b/src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java @@ -29,6 +29,7 @@ import javax.swing.border.TitledBorder; import java.awt.*; import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; import java.awt.event.InputEvent; import java.io.BufferedWriter; import java.io.File; @@ -483,8 +484,26 @@ private void helpTutorial() { e.printStackTrace(); } } + //add the new function need to implement + public void add_drop(){ + // add the mouse event then we can use the new listener to implement and + // we should create a need jbuttom for it to ship the rule we select. + JPanel panel= new JPanel(); + JButton moveing_buttom= new JButton(); + moveing_buttom.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + //get the selected rule + } + }); + panel.add(moveing_buttom); - // Quick save, does not prompt user for name chane + } + + + + + // Quick save, does not prompt user for name change private void saveProofChange(){ Puzzle puzzle = GameBoardFacade.getInstance().getPuzzleModule(); if (puzzle == null) {