The bug found in the presentation that we forgot to review has been fixed
[RRRRHHHH_Code] / ruralHouses / src / gui / RequestDeleteHouseGUI.java
diff --git a/ruralHouses/src/gui/RequestDeleteHouseGUI.java b/ruralHouses/src/gui/RequestDeleteHouseGUI.java
deleted file mode 100644 (file)
index 4bd854c..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-package gui;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.rmi.Naming;
-import java.rmi.RemoteException;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JRadioButton;
-import javax.swing.border.EmptyBorder;
-
-import common.AdminInterface;
-
-import configuration.___IntNames;
-import domain.Owner;
-import domain.RuralHouse;
-
-public class RequestDeleteHouseGUI extends JFrame {
-
-       /**
-        * 
-        */
-       private static final long serialVersionUID = 1L;
-       private JPanel contentPane;
-       private Owner owner;
-       private JComboBox<RuralHouse> comboBox;
-       private JButton btnDelete;
-       private AdminInterface am = null;
-       JLabel feedback = new JLabel("");
-
-       /**
-        * Create the frame.
-        */
-       public RequestDeleteHouseGUI(Owner o) {
-               try {
-                       am = (AdminInterface) Naming
-                                       .lookup(___IntNames.AdminManager);
-               } catch (Exception e1) {
-                       System.out.println("Error accessing remote authentication: "
-                                       + e1.toString());
-               }
-               this.owner = o;
-               setBounds(100, 100, 450, 300);
-               contentPane = new JPanel();
-               contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
-               setContentPane(contentPane);
-       
-               comboBox = new JComboBox<RuralHouse>(this.owner.getRuralHouses());
-               comboBox.setBounds(75, 55, 332, 20);
-               
-
-               JRadioButton rdbtnIAmSure = new JRadioButton("I am sure");
-               rdbtnIAmSure.setBounds(90, 154, 90, 23);
-               
-               btnDelete = new JButton("REQUEST");
-               btnDelete.setBounds(90, 213, 90, 23);
-               btnDelete.setEnabled(false);
-               
-               rdbtnIAmSure.addItemListener(new ItemListener() {
-
-                       @Override
-                       public void itemStateChanged(ItemEvent e) {
-                               int state = e.getStateChange();
-                               if (state == ItemEvent.SELECTED){
-                                       btnDelete.setEnabled(true);
-                               }
-                               else if (state == ItemEvent.DESELECTED){
-                                       btnDelete.setEnabled(false);
-                               }
-                       }
-               });
-               contentPane.setLayout(null);
-               contentPane.add(comboBox);
-               contentPane.add(rdbtnIAmSure);
-               contentPane.add(btnDelete);
-               feedback.setBounds(90, 184, 274, 18);
-               contentPane.add(feedback);
-               
-               btnDelete.addActionListener(new ActionListener() {
-                       public void actionPerformed(ActionEvent arg0) {
-                               actionListenerButton(arg0);
-                               
-                       }
-
-                       
-               });
-       }
-       
-       private void actionListenerButton(ActionEvent e){
-               RuralHouse toDel = (RuralHouse)comboBox.getSelectedItem();
-               
-               try {
-                       if(am.addDeletionRequest(toDel)){
-                               am.saveInstance();
-                               feedback.setText("Delete request sended");
-                               
-                       }else{
-                               feedback.setText("Request cannot be sended(Already sended)");
-                       }
-               } catch (RemoteException e1) {
-                       // TODO Auto-generated catch block
-                       e1.printStackTrace();
-               }
-       }
-}