Merged the two branches, DB separated
[RRRRHHHH_Code] / ruralHouses / src / gui / OwnerMenuGUI.java
index 532d373..244b242 100644 (file)
@@ -1,22 +1,18 @@
 package gui;
 
-import java.awt.BorderLayout;
-import java.awt.EventQueue;
 import java.awt.Frame;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
 
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.border.EmptyBorder;
 import javax.swing.GroupLayout;
 import javax.swing.GroupLayout.Alignment;
 import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.LayoutStyle.ComponentPlacement;
+import javax.swing.border.EmptyBorder;
 
 import domain.Owner;
-import domain.RuralHouse;
-
-import java.awt.event.ActionListener;
-import java.awt.event.ActionEvent;
-import java.util.Vector;
 
 public class OwnerMenuGUI extends JFrame {
 
@@ -47,11 +43,19 @@ public class OwnerMenuGUI extends JFrame {
                                a.setVisible(true);
                        }
                });
-               
+
                JButton btnOffers = new JButton("Offers");
                btnOffers.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e) {
-                               Frame a = new IntroduceOffer2GUI(owner.getRuralHouses());
+                               Frame a = new OffersRelatedOwnerGUI(owner);
+                               a.setVisible(true);
+                       }
+               });
+               
+               JButton btnBookings = new JButton("Bookings");
+               btnBookings.addActionListener(new ActionListener() {
+                       public void actionPerformed(ActionEvent e) {
+                               Frame a = new listOfOffers(owner);
                                a.setVisible(true);
                        }
                });
@@ -60,9 +64,10 @@ public class OwnerMenuGUI extends JFrame {
                        gl_contentPane.createParallelGroup(Alignment.LEADING)
                                .addGroup(gl_contentPane.createSequentialGroup()
                                        .addGap(115)
-                                       .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
-                                               .addComponent(btnOffers, GroupLayout.PREFERRED_SIZE, 164, GroupLayout.PREFERRED_SIZE)
-                                               .addComponent(btnHouses, GroupLayout.PREFERRED_SIZE, 164, GroupLayout.PREFERRED_SIZE))
+                                       .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING, false)
+                                               .addComponent(btnBookings, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+                                               .addComponent(btnOffers, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE)
+                                               .addComponent(btnHouses, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE))
                                        .addContainerGap(145, Short.MAX_VALUE))
                );
                gl_contentPane.setVerticalGroup(
@@ -72,7 +77,9 @@ public class OwnerMenuGUI extends JFrame {
                                        .addComponent(btnHouses, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE)
                                        .addGap(58)
                                        .addComponent(btnOffers, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE)
-                                       .addContainerGap(142, Short.MAX_VALUE))
+                                       .addPreferredGap(ComponentPlacement.RELATED, 50, Short.MAX_VALUE)
+                                       .addComponent(btnBookings, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE)
+                                       .addContainerGap())
                );
                contentPane.setLayout(gl_contentPane);
        }