da026080f8f9bbb8be3e8f7abdd0221e307bdf90
[RRRRHHHH_Code] / ruralHouses / src / gui / OffersRelatedOwnerGUI.java
1 package gui;
2
3 import java.awt.BorderLayout;
4 import java.awt.EventQueue;
5 import java.awt.Frame;
6
7 import javax.swing.JFrame;
8 import javax.swing.JPanel;
9 import javax.swing.border.EmptyBorder;
10 import javax.swing.JButton;
11 import javax.swing.GroupLayout;
12 import javax.swing.GroupLayout.Alignment;
13
14 import domain.Owner;
15 import domain.RuralHouse;
16
17 import java.awt.event.ActionListener;
18 import java.awt.event.ActionEvent;
19 import java.util.Vector;
20 import javax.swing.JLabel;
21 import java.awt.Color;
22 import java.awt.Font;
23
24 public class OffersRelatedOwnerGUI extends JFrame {
25
26         /**
27          * 
28          */
29         private static final long serialVersionUID = 1L;
30         private JPanel contentPane;
31         private Owner owner;
32         /**
33          * Create the frame.
34          */
35         public OffersRelatedOwnerGUI(Owner o) {
36                 this.getContentPane().setLayout(null);
37                 owner = o;
38                 setBounds(100, 100, 450, 562);
39                 contentPane = new JPanel();
40                 contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
41                 setContentPane(contentPane);
42                 
43                 JButton btnCreateOffers = new JButton("Create Offers");
44                 btnCreateOffers.addActionListener(new ActionListener() {
45                         public void actionPerformed(ActionEvent arg0) {
46                                 Frame a = new NewHouseGUI(owner);
47                                 a.setVisible(true);
48                         }
49                 });
50                 
51                 JButton btnModifyOffers = new JButton("Modify Offers");
52                 btnModifyOffers.setEnabled(false);
53                 btnModifyOffers.addActionListener(new ActionListener() {
54                         public void actionPerformed(ActionEvent e) {
55                                 
56                                 /* TODO to be implemented in a future.
57                                 Frame a = new ModifyHouseGUI(owner);
58                                 a.setVisible(true);
59                                 */
60                         }
61                 });
62                 
63                 JButton btnDeleteOffers = new JButton("Delete Offers");
64                 btnDeleteOffers.addActionListener(new ActionListener() {
65                         public void actionPerformed(ActionEvent e) {
66                                 Frame a = new DeleteHouseGUI(owner);
67                                 a.setVisible(true);
68                         }
69                 });
70                 GroupLayout gl_contentPane = new GroupLayout(contentPane);
71                 gl_contentPane.setHorizontalGroup(
72                         gl_contentPane.createParallelGroup(Alignment.LEADING)
73                                 .addGroup(gl_contentPane.createSequentialGroup()
74                                         .addGap(110)
75                                         .addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING)
76                                                 .addComponent(btnDeleteOffers, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 1125, Short.MAX_VALUE)
77                                                 .addComponent(btnModifyOffers, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 1125, Short.MAX_VALUE)
78                                                 .addComponent(btnCreateOffers, GroupLayout.DEFAULT_SIZE, 1125, Short.MAX_VALUE))
79                                         .addGap(121))
80                 );
81                 gl_contentPane.setVerticalGroup(
82                         gl_contentPane.createParallelGroup(Alignment.LEADING)
83                                 .addGroup(gl_contentPane.createSequentialGroup()
84                                         .addGap(88)
85                                         .addComponent(btnCreateOffers, GroupLayout.PREFERRED_SIZE, 58, GroupLayout.PREFERRED_SIZE)
86                                         .addGap(40)
87                                         .addComponent(btnModifyOffers, GroupLayout.PREFERRED_SIZE, 57, GroupLayout.PREFERRED_SIZE)
88                                         .addGap(39)
89                                         .addComponent(btnDeleteOffers, GroupLayout.PREFERRED_SIZE, 54, GroupLayout.PREFERRED_SIZE)
90                                         .addContainerGap(394, Short.MAX_VALUE))
91                 );
92                 contentPane.setLayout(gl_contentPane);
93         }
94 }