From: pinene Date: Sun, 19 Apr 2015 14:18:02 +0000 (+0200) Subject: Merge branch 'master' of https://xp-dev.com/git/RRRRHHHH_Code X-Git-Url: https://xp-dev.com/git/RRRRHHHH_Code/commitdiff_plain/42679bcd0e79750f8a1ec7c2388cd4d675de58f1?hp=520867d5e278316fe874703c30b89de67ff5d82d Merge branch 'master' of https://xp-dev.com/git/RRRRHHHH_Code Conflicts: ruralHouses/src/businessLogic/OfferManager.java ruralHouses/src/gui/HouseFeaturesGUI.java ruralHouses/src/gui/ModifyHouseGUI.java ruralHouses/src/gui/StartWindow.java --- diff --git a/ruralHouses/src/businessLogic/OfferManager.java b/ruralHouses/src/businessLogic/OfferManager.java index 955d64e..8c6fb3e 100644 --- a/ruralHouses/src/businessLogic/OfferManager.java +++ b/ruralHouses/src/businessLogic/OfferManager.java @@ -22,6 +22,7 @@ public final class OfferManager { } } + /** * This method creates an offer with a house number, first day, last day and price diff --git a/ruralHouses/src/gui/HouseFeaturesGUI.java b/ruralHouses/src/gui/HouseFeaturesGUI.java index f5258cb..a8643e4 100644 --- a/ruralHouses/src/gui/HouseFeaturesGUI.java +++ b/ruralHouses/src/gui/HouseFeaturesGUI.java @@ -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"); + + } } } diff --git a/ruralHouses/src/gui/ModifyHouseGUI.java b/ruralHouses/src/gui/ModifyHouseGUI.java index 6d980d1..6b64b19 100644 --- a/ruralHouses/src/gui/ModifyHouseGUI.java +++ b/ruralHouses/src/gui/ModifyHouseGUI.java @@ -46,8 +46,8 @@ public class ModifyHouseGUI extends JFrame { private JTextField baths_f; private JButton btnConfirm; private JComboBox houseBox; - private RuralHouse rh; private JComboBox 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(new DefaultComboBoxModel( + 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 diff --git a/ruralHouses/src/gui/StartWindow.java b/ruralHouses/src/gui/StartWindow.java index 600233b..385d09b 100644 --- a/ruralHouses/src/gui/StartWindow.java +++ b/ruralHouses/src/gui/StartWindow.java @@ -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); diff --git a/ruralHouses/src/gui/listOfAdditionRequestsGUI.java b/ruralHouses/src/gui/listOfAdditionRequestsGUI.java index 8a24d45..0fbf336 100644 --- a/ruralHouses/src/gui/listOfAdditionRequestsGUI.java +++ b/ruralHouses/src/gui/listOfAdditionRequestsGUI.java @@ -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); } } });