diff --git a/src/IO/DataTypeDialogue.form b/src/IO/DataTypeDialogue.form index d4daf81..f40a2ea 100644 --- a/src/IO/DataTypeDialogue.form +++ b/src/IO/DataTypeDialogue.form @@ -155,17 +155,6 @@ - - - - - - - - - - - diff --git a/src/IO/DataTypeDialogue.java b/src/IO/DataTypeDialogue.java index 0f22718..1ad62fe 100644 --- a/src/IO/DataTypeDialogue.java +++ b/src/IO/DataTypeDialogue.java @@ -31,7 +31,6 @@ public class DataTypeDialogue extends JDialog { private JCheckBox input_already_merged_jcheckbox; private JCheckBox merge_all_lanes_jcheckbox; private JCheckBox mt_capture_jcheckbox; - private JTextField mtcapture_jtextfield; private JComboBox capture_type_combobox; private JButton capture_button_select; private JButton capture_mt_button_select; @@ -40,7 +39,7 @@ public DataTypeDialogue(final Communicator communicator) { setContentPane(contentPane); setModal(true); getRootPane().setDefaultButton(buttonOK); - mtcapture_jtextfield.setText(communicator.getFilter_for_mt()); + buttonOK.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { @@ -51,10 +50,8 @@ public void actionPerformed(ActionEvent e) { @Override public void actionPerformed(ActionEvent e) { if(mt_capture_jcheckbox.isSelected()){ - mtcapture_jtextfield.setEnabled(true); capture_mt_button_select.setEnabled(true); } else { - mtcapture_jtextfield.setEnabled(false); capture_mt_button_select.setEnabled(false); } } @@ -136,7 +133,6 @@ private void onOK(Communicator c) { if(mt_capture_jcheckbox.isSelected()) { c.setRun_mt_capture_mode(true); - c.setFilter_for_mt(mtcapture_jtextfield.getText()); } else { c.setRun_mt_capture_mode(false); } diff --git a/src/IO/ReferenceDialog.form b/src/IO/ReferenceDialog.form new file mode 100644 index 0000000..304eb3b --- /dev/null +++ b/src/IO/ReferenceDialog.form @@ -0,0 +1,101 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/IO/ReferenceDialog.java b/src/IO/ReferenceDialog.java new file mode 100644 index 0000000..cff8685 --- /dev/null +++ b/src/IO/ReferenceDialog.java @@ -0,0 +1,89 @@ +package IO; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +public class ReferenceDialog extends JDialog { + private JPanel contentPane; + private JButton buttonOK; + private JButton buttonCancel; + private JButton referenceButton; + private JTextField mtcapture_jtextfield; + private JTextPane pleaseInputTheNameTextPane; + private Communicator communicator; + private JButton runButton; + + public ReferenceDialog(final Communicator communicator, JButton runButton) { + setContentPane(contentPane); + setModal(true); + getRootPane().setDefaultButton(buttonOK); + mtcapture_jtextfield.setText(communicator.getFilter_for_mt()); + this.communicator = communicator; + this.runButton = runButton; + + buttonOK.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + onOK(); + } + }); + + buttonCancel.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + onCancel(); + } + }); + + referenceButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent actionEvent) { + ReferenceFastAChooser rffqc = new ReferenceFastAChooser(communicator); + referenceButton.setForeground(Color.green); + + if (checkIfInputWasSelected()) { + runButton.setEnabled(true); + buttonOK.setEnabled(true); + } else { + runButton.setEnabled(false); + buttonCancel.setEnabled(false); + } + } + }); + +// call onCancel() when cross is clicked + setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); + addWindowListener(new WindowAdapter() { + public void windowClosing(WindowEvent e) { + onCancel(); + } + }); + +// call onCancel() on ESCAPE + contentPane.registerKeyboardAction(new ActionListener() { + public void actionPerformed(ActionEvent e) { + onCancel(); + } + }, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); + } + + private void onOK() { +// add your code here + this.communicator.setFilter_for_mt(this.mtcapture_jtextfield.getText()); + dispose(); + } + + private void onCancel() { +// add your code here if necessary + dispose(); + } + + private boolean checkIfInputWasSelected() { + boolean tmp = false; + if (communicator.getGUI_inputfiles() != null && communicator.getGUI_reference() != null && communicator.getGUI_resultspath() != null) { + if(communicator.getGUI_inputfiles().size() != 0){ + tmp = true; + } + } + return tmp; + } +} diff --git a/src/main/DeDupDialog.form b/src/main/DeDupDialog.form index e71f0b5..26e26db 100644 --- a/src/main/DeDupDialog.form +++ b/src/main/DeDupDialog.form @@ -3,7 +3,7 @@ - + @@ -94,7 +94,7 @@ - +
diff --git a/src/main/EAGER.java b/src/main/EAGER.java index 0027384..92a1afe 100644 --- a/src/main/EAGER.java +++ b/src/main/EAGER.java @@ -349,14 +349,10 @@ public void actionPerformed(ActionEvent actionEvent) { referenceButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent actionEvent) { - ReferenceFastAChooser rffqc = new ReferenceFastAChooser(communicator); + ReferenceDialog rd = new ReferenceDialog(communicator, RunButton); + rd.setSize(600, 400); + rd.setVisible(true); referenceButton.setForeground(Color.green); - - if (checkIfInputWasSelected()) { - RunButton.setEnabled(true); - } else { - RunButton.setEnabled(false); - } } });