Commit b18c7ea0 authored by Seyed Reza  Sajjadinasab's avatar Seyed Reza Sajjadinasab
Browse files

Merge branch 'Reza' into 'master'

Reza

See merge request ec504/ec504_projects/group6!75
parents fd7ad9b8 531fa30b
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ public class ColorSpectrumPanel extends JPanel {
        super.paintComponent(g);
        Graphics2D g2d = (Graphics2D) g;

        // Draw color spectrum
        for (int i = 0; i < width; i++) {
            float saturation = (float) i / (float) width;
            Color color = Color.getHSBColor(0, saturation, 1);
@@ -26,7 +25,6 @@ public class ColorSpectrumPanel extends JPanel {
            g2d.drawLine(i, 0, i, height);
        }

        // Add labels
        g2d.setColor(Color.BLACK);
        g2d.drawString("Confidence=0", 5, height - 5);
        g2d.drawString("Confidence=100    ", width - 110, height - 5);
+0 −3
Original line number Diff line number Diff line
@@ -74,9 +74,7 @@ public class SelectCorrectionGUI extends JFrame {
                for (JButton button : buttons) {
                    flags.add(button.getBackground().equals(Color.GREEN));
                }
                // Pass the flags and counter to Main using the interface method
                updateCounter(listener.updateFlagsAndLabel(flags));
                // Update buttons based on file changes
                updatePanel();
                
            }
@@ -95,7 +93,6 @@ public class SelectCorrectionGUI extends JFrame {
                    System.exit(0);
                    return;
                }
                // Update buttons based on file changes
                updateCounter(sentence);
                updatePanel();
                
+4 −6
Original line number Diff line number Diff line
@@ -124,9 +124,7 @@ public class WordRoleUpdater extends JFrame {
            @Override
            public void actionPerformed(ActionEvent e) {
                changes.put(getCurrentWord(), false);
                //wordRoles.remove(getCurrentWord()); // Remove the current word
                //changes.remove(getCurrentWord()); // Remove the change for the current word
                updateNextWord(); // Move to the next word
                updateNextWord(); 
            }
        });

@@ -141,9 +139,9 @@ public class WordRoleUpdater extends JFrame {
        rejectAllButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                wordRoles.clear(); // Clear all word roles
                changes.clear(); // Clear all changes
                updateDatabase(); // Update database (clear the table)
                wordRoles.clear(); 
                changes.clear(); 
                updateDatabase();
                JOptionPane.showMessageDialog(WordRoleUpdater.this, "All changes rejected. Table cleared.");
                System.exit(0);
            }
+0 −2
Original line number Diff line number Diff line
@@ -156,8 +156,6 @@ public class WordPairDatabase {
        } catch (SQLException e) {
            System.err.println("Error accessing database: " + e.getMessage());
        }

        // Write word counts to the output file
        //System.out.print("WORDCOUNTS: ");
        //System.out.println(wordCounts);
        try (BufferedWriter writer = new BufferedWriter(new FileWriter(outputFile))) {
+1 −1
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ public class DirectTranslatorDutchToEnglish {
                replacedSentence.append(word);
            }
        }
        // Remove extra space at the end and ensure no space before punctuation
    
        return replacedSentence.toString().trim().replaceAll("\\s(?=\\p{Punct})", "");
    }
}
Loading