Merge branch 'master' of https://xp-dev.com/git/RRRRHHHH_Code
[RRRRHHHH_Code] / ruralHouses / src / gui / HousesRelatedOwnerGUI.java
1 package gui;
2
3 import java.awt.Frame;
4 import java.awt.event.ActionEvent;
5 import java.awt.event.ActionListener;
6
7 import javax.swing.GroupLayout;
8 import javax.swing.GroupLayout.Alignment;
9 import javax.swing.JButton;
10 import javax.swing.JFrame;
11 import javax.swing.JPanel;
12 import javax.swing.border.EmptyBorder;
13
14 import domain.Owner;
15
16 public class HousesRelatedOwnerGUI extends JFrame {
17
18         /**
19          * 
20          */
21         private static final long serialVersionUID = 1L;
22         private JPanel contentPane;
23         private Owner owner;
24         /**
25          * Create the frame.
26          */
27         public HousesRelatedOwnerGUI(Owner o) {
28                 this.getContentPane().setLayout(null);
29                 owner = o;
30                 setBounds(100, 100, 450, 562);
31                 contentPane = new JPanel();
32                 contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
33                 setContentPane(contentPane);
34                 
35                 JButton btnCreateHouses = new JButton("Create Request");
36                 btnCreateHouses.addActionListener(new ActionListener() {
37                         public void actionPerformed(ActionEvent arg0) {
38                                 Frame a = new RequestNewHouseGUI(owner);
39                                 a.setVisible(true);
40                         }
41                 });
42                 
43                 JButton btnModifyHouses = new JButton("Modify Houses");
44                 btnModifyHouses.addActionListener(new ActionListener() {
45                         public void actionPerformed(ActionEvent e) {
46                                 
47                                 Frame a = new ModifyHouseGUI(owner);
48                                 a.setVisible(true);
49                                 
50                         }
51                 });
52                 
53                 JButton btnDeleteHouses = new JButton("Delete Request");
54                 btnDeleteHouses.addActionListener(new ActionListener() {
55                         public void actionPerformed(ActionEvent e) {
56                                 Frame a = new RequestDeleteHouseGUI(owner);
57                                 a.setVisible(true);
58                         }
59                 });
60                 GroupLayout gl_contentPane = new GroupLayout(contentPane);
61                 gl_contentPane.setHorizontalGroup(
62                         gl_contentPane.createParallelGroup(Alignment.LEADING)
63                                 .addGroup(gl_contentPane.createSequentialGroup()
64                                         .addGap(110)
65                                         .addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING)
66                                                 .addComponent(btnDeleteHouses, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 1125, Short.MAX_VALUE)
67                                                 .addComponent(btnModifyHouses, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 1125, Short.MAX_VALUE)
68                                                 .addComponent(btnCreateHouses, GroupLayout.DEFAULT_SIZE, 1125, Short.MAX_VALUE))
69                                         .addGap(121))
70                 );
71                 gl_contentPane.setVerticalGroup(
72                         gl_contentPane.createParallelGroup(Alignment.LEADING)
73                                 .addGroup(gl_contentPane.createSequentialGroup()
74                                         .addGap(88)
75                                         .addComponent(btnCreateHouses, GroupLayout.PREFERRED_SIZE, 58, GroupLayout.PREFERRED_SIZE)
76                                         .addGap(40)
77                                         .addComponent(btnModifyHouses, GroupLayout.PREFERRED_SIZE, 57, GroupLayout.PREFERRED_SIZE)
78                                         .addGap(39)
79                                         .addComponent(btnDeleteHouses, GroupLayout.PREFERRED_SIZE, 54, GroupLayout.PREFERRED_SIZE)
80                                         .addContainerGap(394, Short.MAX_VALUE))
81                 );
82                 contentPane.setLayout(gl_contentPane);
83         }
84 }