Repository navigation
Expand file tree
/
Copy pathRentRequestsPage.java
More file actions
272 lines (239 loc) · 11.4 KB
/
Copy pathRentRequestsPage.java
File metadata and controls
272 lines (239 loc) · 11.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.util.ArrayList;
import javax.swing.GroupLayout.Alignment;
import javax.swing.GroupLayout;
/**
*
* @author thesc
*/
public class RentRequestsPage extends javax.swing.JPanel { //View class for rent requests page, generated using NetBeans
private JPanel panelInsideScrollPane;
private ArrayList<JButton> approveButtons = new ArrayList<>();
private ArrayList<JButton> denyButtons = new ArrayList<>();
/**
* Creates new form RentRequestsPage
*/
public RentRequestsPage() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
requestScrollPane = new javax.swing.JScrollPane();
requestScrollPane.setBounds(250, 62, 750, 600);
rentRequestTitleLabel = new javax.swing.JLabel();
rentRequestTitleLabel.setBounds(250, 23, 276, 33);
requestSideBarPanel = new javax.swing.JPanel();
requestSideBarPanel.setBounds(0, 0, 244, 700);
sidebarPanel = new javax.swing.JPanel();
homeButton = new javax.swing.JButton();
rentRequestsButton = new javax.swing.JButton();
managePropertiesButton = new javax.swing.JButton();
newPropertyPageButton = new javax.swing.JButton();
logOutButton = new javax.swing.JButton();
setPreferredSize(new java.awt.Dimension(1024, 700));
setSize(new java.awt.Dimension(1024, 700));
requestScrollPane.setPreferredSize(null);
rentRequestTitleLabel.setFont(new java.awt.Font("Source Serif Pro Black", 0, 24)); // NOI18N
rentRequestTitleLabel.setText("Incoming Rent Requests");
sidebarPanel.setBackground(new Color(236, 77, 55));
sidebarPanel.setPreferredSize(new java.awt.Dimension(255, 684));
homeButton.setBackground(new Color(236, 77, 55));
homeButton.setFont(new Font("Source Serif Pro Black", Font.PLAIN, 25)); // NOI18N
homeButton.setForeground(new java.awt.Color(255, 255, 255));
homeButton.setText("Home");
homeButton.setBorder(null);
rentRequestsButton.setBackground(new Color(236, 77, 55));
rentRequestsButton.setFont(new Font("Source Serif Pro Black", Font.PLAIN, 25)); // NOI18N
rentRequestsButton.setForeground(new java.awt.Color(255, 255, 255));
rentRequestsButton.setText("Rent requests");
rentRequestsButton.setBorder(null);
managePropertiesButton.setBackground(new Color(236, 77, 55));
managePropertiesButton.setFont(new Font("Source Serif Pro Black", Font.PLAIN, 23)); // NOI18N
managePropertiesButton.setForeground(new java.awt.Color(255, 255, 255));
managePropertiesButton.setText("Manage Properties");
managePropertiesButton.setBorder(null);
newPropertyPageButton.setBackground(new Color(236, 77, 55));
newPropertyPageButton.setFont(new Font("Source Serif Pro Black", Font.PLAIN, 25)); // NOI18N
newPropertyPageButton.setForeground(new java.awt.Color(255, 255, 255));
newPropertyPageButton.setText("New Property");
newPropertyPageButton.setBorder(null);
logOutButton.setBackground(new Color(236, 77, 55));
logOutButton.setFont(new Font("Source Serif Pro Black", Font.PLAIN, 25)); // NOI18N
logOutButton.setForeground(new java.awt.Color(255, 255, 255));
logOutButton.setText("Log Out");
logOutButton.setBorder(null);
javax.swing.GroupLayout sidebarPanelLayout = new javax.swing.GroupLayout(sidebarPanel);
sidebarPanelLayout.setHorizontalGroup(
sidebarPanelLayout.createParallelGroup(Alignment.LEADING)
.addGroup(sidebarPanelLayout.createSequentialGroup()
.addGap(27)
.addGroup(sidebarPanelLayout.createParallelGroup(Alignment.LEADING)
.addComponent(logOutButton)
.addComponent(newPropertyPageButton)
.addComponent(managePropertiesButton)
.addComponent(rentRequestsButton)
.addComponent(homeButton))
.addContainerGap(14, Short.MAX_VALUE))
);
sidebarPanelLayout.setVerticalGroup(
sidebarPanelLayout.createParallelGroup(Alignment.LEADING)
.addGroup(sidebarPanelLayout.createSequentialGroup()
.addGap(38)
.addComponent(homeButton)
.addGap(18)
.addComponent(rentRequestsButton)
.addGap(36)
.addComponent(managePropertiesButton)
.addGap(29)
.addComponent(newPropertyPageButton)
.addGap(26)
.addComponent(logOutButton)
.addContainerGap(380, Short.MAX_VALUE))
);
sidebarPanel.setLayout(sidebarPanelLayout);
javax.swing.GroupLayout requestSideBarPanelLayout = new javax.swing.GroupLayout(requestSideBarPanel);
requestSideBarPanel.setLayout(requestSideBarPanelLayout);
requestSideBarPanelLayout.setHorizontalGroup(
requestSideBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(sidebarPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 285, Short.MAX_VALUE)
);
requestSideBarPanelLayout.setVerticalGroup(
requestSideBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(sidebarPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 700, javax.swing.GroupLayout.PREFERRED_SIZE)
);
panelInsideScrollPane = new JPanel();
panelInsideScrollPane.setPreferredSize(new Dimension(400,400));
requestScrollPane = new JScrollPane(panelInsideScrollPane,
JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
requestScrollPane.getVerticalScrollBar().setUnitIncrement(16);
panelInsideScrollPane.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
panelInsideScrollPane.add(new JPanel());
requestScrollPane.setLocation(247, 82);
requestScrollPane.setSize(761, 575);
setLayout(null);
add(requestSideBarPanel);
add(rentRequestTitleLabel);
add(requestScrollPane);
}
// </editor-fold>//GEN-END:initComponents
public void setRentRequest(ArrayList<requestContactInstance> requestsList) {
panelInsideScrollPane.removeAll();
approveButtons.clear();
denyButtons.clear();
if(requestsList.size() == 0) {
// noResultFoundMessage();
}
for(int i = 0; i < requestsList.size(); i++){
requestsList.get(i).setBackground(Color.white);
approveButtons.add(requestsList.get(i).getApproveRequestButton());
denyButtons.add(requestsList.get(i).getDenyRequestButton());
panelInsideScrollPane.setPreferredSize(new Dimension(800,200 * (i+1)));
panelInsideScrollPane.add(requestsList.get(i));
}
}
private void managePropertiesButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_managePropertiesButtonActionPerformed
// TODO add your handling code here:
new ManagePropertiesPage().setVisible(true);
setVisible(false);
}//GEN-LAST:event_managePropertiesButtonActionPerformed
private void newPropertyPageButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newPropertyPageButtonActionPerformed
// TODO add your handling code here:
new NewPropertyPage().setVisible(true);
setVisible(false);
}//GEN-LAST:event_newPropertyPageButtonActionPerformed
private void logOutButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_logOutButtonActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_logOutButtonActionPerformed
/**
* @param args the command line arguments
*/
// public static void main(String args[]) { //Main method used for testing panel
// /* Set the Nimbus look and feel */
// //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
// /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
// * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
// */
// try {
// for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
// if ("Nimbus".equals(info.getName())) {
// javax.swing.UIManager.setLookAndFeel(info.getClassName());
// break;
// }
// }
// } catch (ClassNotFoundException ex) {
// java.util.logging.Logger.getLogger(RentRequestsPage.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
// } catch (InstantiationException ex) {
// java.util.logging.Logger.getLogger(RentRequestsPage.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
// } catch (IllegalAccessException ex) {
// java.util.logging.Logger.getLogger(RentRequestsPage.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
// } catch (javax.swing.UnsupportedLookAndFeelException ex) {
// java.util.logging.Logger.getLogger(RentRequestsPage.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
// }
// //</editor-fold>
// /* Create and display the form */
// java.awt.EventQueue.invokeLater(new Runnable() {
// public void run() {
// new RentRequestsPage().setVisible(true);
// }
// });
// }
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton homeButton;
private javax.swing.JButton logOutButton;
private javax.swing.JButton managePropertiesButton;
private javax.swing.JButton newPropertyPageButton;
private javax.swing.JLabel rentRequestTitleLabel;
private javax.swing.JButton rentRequestsButton;
private javax.swing.JScrollPane requestScrollPane;
private javax.swing.JPanel requestSideBarPanel;
private javax.swing.JPanel sidebarPanel;
// End of variables declaration//GEN-END:variables
//Getters for all components
public javax.swing.JButton getHomeButton() {
return homeButton;
}
public javax.swing.JButton getLogOutButton() {
return logOutButton;
}
public javax.swing.JButton getManagePropertiesButton() {
return managePropertiesButton;
}
public javax.swing.JButton getNewPropertyPageButton() {
return newPropertyPageButton;
}
public javax.swing.JLabel getRentRequestTitleLabel() {
return rentRequestTitleLabel;
}
public javax.swing.JButton getRentRequestsButton() {
return rentRequestsButton;
}
public javax.swing.JScrollPane getRequestScrollPane() {
return requestScrollPane;
}
public javax.swing.JPanel getRequestSideBarPanel() {
return requestSideBarPanel;
}
public javax.swing.JPanel getSidebarPanel() {
return sidebarPanel;
}
public ArrayList<JButton> getApproveButtons() {
return approveButtons;
}
public ArrayList<JButton> getDenyButtons() {
return denyButtons;
}
}