Merge branch 'master' of https://xp-dev.com/git/RRRRHHHH_Code
authorpinene <epinzolas001@ikasle.ehu.es>
Sun, 19 Apr 2015 14:18:02 +0000 (16:18 +0200)
committerpinene <epinzolas001@ikasle.ehu.es>
Sun, 19 Apr 2015 14:18:02 +0000 (16:18 +0200)
Conflicts:
ruralHouses/src/businessLogic/OfferManager.java
ruralHouses/src/gui/HouseFeaturesGUI.java
ruralHouses/src/gui/ModifyHouseGUI.java
ruralHouses/src/gui/StartWindow.java

ruralHouses/src/businessLogic/OfferManager.java
ruralHouses/src/gui/HouseFeaturesGUI.java
ruralHouses/src/gui/ModifyHouseGUI.java
ruralHouses/src/gui/StartWindow.java
ruralHouses/src/gui/listOfAdditionRequestsGUI.java

index 955d64e..8c6fb3e 100644 (file)
@@ -22,6 +22,7 @@ public final class OfferManager {
                }
        }
 
+
        
        /**
         * This method creates an offer with a house number, first day, last day and price
index f5258cb..a8643e4 100644 (file)
@@ -54,6 +54,7 @@ public class HouseFeaturesGUI extends JFrame {
        private int row;
        private JLabel labelPhone;
 
+
        /**
         * Create the frame.
         */
@@ -184,7 +185,7 @@ public class HouseFeaturesGUI extends JFrame {
                JLabel lblNewLabel = new JLabel(
                                "Green: Suit your dates. Red: Do not suit your dates");
                lblNewLabel.setEnabled(false);
-               lblNewLabel.setBounds(152, 277, 261, 23);
+               lblNewLabel.setBounds(170, 282, 261, 23);
                contentPane.add(lblNewLabel);
                
                JLabel lblNewLabel_1 = new JLabel("Telephone num:");
@@ -195,10 +196,11 @@ public class HouseFeaturesGUI extends JFrame {
                telIn.setBounds(99, 505, 129, 20);
                contentPane.add(telIn);
                telIn.setColumns(10);
-               
+
                labelPhone = new JLabel("");
                labelPhone.setBounds(238, 252, 178, 14);
                contentPane.add(labelPhone);
+
                table.addMouseListener( new MouseAdapter(){                     
                        @Override
                        public void mouseClicked(MouseEvent arg0) {
@@ -264,6 +266,8 @@ public class HouseFeaturesGUI extends JFrame {
                        }
                } else {
                        labelPhone.setText("Phone format is wrong");
+
+               
                }
        }
 }
index 6d980d1..6b64b19 100644 (file)
@@ -46,8 +46,8 @@ public class ModifyHouseGUI extends JFrame {
        private JTextField baths_f;
        private JButton btnConfirm;
        private JComboBox<RuralHouse> houseBox;
-       private RuralHouse rh;
        private  JComboBox<String> comboBox;
+       private RuralHouse rh;
 
        /**
         * Create the frame.
@@ -55,6 +55,7 @@ public class ModifyHouseGUI extends JFrame {
        public ModifyHouseGUI(final Owner o) {
                this.distric=Districs.longNames();
                 comboBox = new JComboBox<String>(new DefaultComboBoxModel<String>(
+
                                this.distric));
                this.getContentPane().setLayout(null);
                owner = o;
@@ -134,8 +135,8 @@ public class ModifyHouseGUI extends JFrame {
                                HouseManager hm = new HouseManager();
 
                                if (hm.registerNewHouse(newRh)) {
-                                       o.getRuralHouses().remove(rh);
-                                       o.getRuralHouses().add(newRh);
+                                       owner.getRuralHouses().remove(rh);
+                                       owner.getRuralHouses().add(newRh);
                                        houseBox.removeItem(rh);
                                        feedback.setText("House properly modified");
                                } else
index 600233b..385d09b 100644 (file)
@@ -48,7 +48,7 @@ public class StartWindow extends JFrame {
                        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
 
                        c=configuration.ConfigXML.getInstance();
+
                }catch (com.db4o.ext.DatabaseFileLockedException e) {
                        a.lblNewLabel.setText("Database locked: Do not run BusinessLogicServer or BusinessLogicServer!!");
                        a.lblNewLabel.setForeground(Color.RED);         
index 8a24d45..0fbf336 100644 (file)
@@ -90,10 +90,10 @@ public class listOfAdditionRequestsGUI extends JFrame {
                                        RuralHouse rh = houses.get(table.getSelectedRow());
                                        //TODO when the house is not added show a warning to the user. Method below returns a boolean stating that.
                                        hm.registerNewHouse(rh);
-                                       houses.remove(rh);
                                        am.removeHouseAdditionRequests(rh);
                                        Administrator.saveInstance();
                                        ((DefaultTableModel)table.getModel()).removeRow(houses.indexOf(rh));
+                                       houses.remove(rh);
                                }
                        }
                });