Manage Legal Notices - View
[habeas.git] / src / habeas / ViewNoticeDialog.java
1 /*
2 * To change this license header, choose License Headers in Project Properties.
3 * To change this template file, choose Tools | Templates
4 * and open the template in the editor.
5 */
6 package habeas;
7
8 import java.text.DateFormat;
9 import java.text.SimpleDateFormat;
10 import java.util.Date;
11
12 /**
13 *
14 * @author hari
15 */
16 public class ViewNoticeDialog extends javax.swing.JDialog {
17
18 /**
19 * Creates new form ViewNoticeDialog
20 */
21 public ViewNoticeDialog(java.awt.Frame parent, boolean modal) {
22 super(parent, modal);
23 initComponents();
24 }
25
26 /**
27 * This method is called from within the constructor to initialize the form.
28 * WARNING: Do NOT modify this code. The content of this method is always
29 * regenerated by the Form Editor.
30 */
31 @SuppressWarnings("unchecked")
32 // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
33 private void initComponents() {
34
35 jScrollPane1 = new javax.swing.JScrollPane();
36 jPanel1 = new javax.swing.JPanel();
37 jLabel1 = new javax.swing.JLabel();
38 textReferenceNumber = new javax.swing.JTextField();
39 jLabel2 = new javax.swing.JLabel();
40 jScrollPane2 = new javax.swing.JScrollPane();
41 textDescription = new javax.swing.JTextArea();
42 jLabel3 = new javax.swing.JLabel();
43 textEntrustmentDate = new javax.swing.JTextField();
44 jLabel4 = new javax.swing.JLabel();
45 textClientName = new javax.swing.JTextField();
46 checkDraftCreated = new javax.swing.JCheckBox();
47 checkDraftApproved = new javax.swing.JCheckBox();
48 checkNoticeSent = new javax.swing.JCheckBox();
49 jLabel5 = new javax.swing.JLabel();
50 textSentDate = new javax.swing.JTextField();
51 jLabel6 = new javax.swing.JLabel();
52 textRPADReference = new javax.swing.JTextField();
53 checkNoticeDelivered = new javax.swing.JCheckBox();
54 jLabel7 = new javax.swing.JLabel();
55 textDeliveryDate = new javax.swing.JTextField();
56 jLabel8 = new javax.swing.JLabel();
57 textBillStatus = new javax.swing.JTextField();
58 jLabel9 = new javax.swing.JLabel();
59 jLabel10 = new javax.swing.JLabel();
60 textBillDate = new javax.swing.JTextField();
61 valBillAmount = new javax.swing.JFormattedTextField();
62 checkClarificationPending = new javax.swing.JCheckBox();
63 jLabel11 = new javax.swing.JLabel();
64 jScrollPane3 = new javax.swing.JScrollPane();
65 textClarificationRemarks = new javax.swing.JTextArea();
66
67 setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
68 setTitle("View Notice");
69 setLocationByPlatform(true);
70
71 jLabel1.setText("Reference Number");
72
73 textReferenceNumber.setEditable(false);
74
75 jLabel2.setText("Description");
76
77 textDescription.setEditable(false);
78 textDescription.setColumns(20);
79 textDescription.setRows(5);
80 jScrollPane2.setViewportView(textDescription);
81
82 jLabel3.setText("Entrustment Date");
83
84 textEntrustmentDate.setEditable(false);
85
86 jLabel4.setText("Client");
87
88 textClientName.setEditable(false);
89
90 checkDraftCreated.setText("Draft Created");
91 checkDraftCreated.setEnabled(false);
92
93 checkDraftApproved.setText("Draft Approved");
94 checkDraftApproved.setEnabled(false);
95
96 checkNoticeSent.setText("Notice Sent");
97 checkNoticeSent.setEnabled(false);
98
99 jLabel5.setText("Sent Date");
100
101 textSentDate.setEditable(false);
102
103 jLabel6.setText("RPAD Reference");
104
105 textRPADReference.setEditable(false);
106
107 checkNoticeDelivered.setText("Notice Delivered");
108 checkNoticeDelivered.setEnabled(false);
109
110 jLabel7.setText("Delivery Date");
111
112 textDeliveryDate.setEditable(false);
113
114 jLabel8.setText("Bill Status");
115
116 textBillStatus.setEditable(false);
117
118 jLabel9.setText("Bill Amount");
119
120 jLabel10.setText("Bill Date");
121
122 textBillDate.setEditable(false);
123
124 valBillAmount.setEditable(false);
125 valBillAmount.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(java.text.NumberFormat.getIntegerInstance())));
126
127 checkClarificationPending.setText("Clarification pending");
128 checkClarificationPending.setEnabled(false);
129
130 jLabel11.setText("Clarification Remarks");
131
132 textClarificationRemarks.setEditable(false);
133 textClarificationRemarks.setColumns(20);
134 textClarificationRemarks.setRows(5);
135 jScrollPane3.setViewportView(textClarificationRemarks);
136
137 javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
138 jPanel1.setLayout(jPanel1Layout);
139 jPanel1Layout.setHorizontalGroup(
140 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
141 .addGroup(jPanel1Layout.createSequentialGroup()
142 .addContainerGap()
143 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
144 .addComponent(jLabel11, javax.swing.GroupLayout.DEFAULT_SIZE, 157, Short.MAX_VALUE)
145 .addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
146 .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
147 .addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
148 .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
149 .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
150 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
151 .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
152 .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
153 .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
154 .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 142, Short.MAX_VALUE))
155 .addComponent(checkDraftCreated, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
156 .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
157 .addGap(15, 15, 15)
158 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
159 .addComponent(textDeliveryDate)
160 .addComponent(textReferenceNumber)
161 .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 386, Short.MAX_VALUE)
162 .addComponent(textEntrustmentDate)
163 .addComponent(textClientName)
164 .addComponent(checkDraftApproved, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
165 .addComponent(textSentDate)
166 .addComponent(textRPADReference)
167 .addComponent(textBillStatus)
168 .addComponent(textBillDate)
169 .addComponent(valBillAmount)
170 .addComponent(checkClarificationPending, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
171 .addComponent(checkNoticeDelivered, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
172 .addComponent(checkNoticeSent, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
173 .addComponent(jScrollPane3))
174 .addContainerGap())
175 );
176 jPanel1Layout.setVerticalGroup(
177 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
178 .addGroup(jPanel1Layout.createSequentialGroup()
179 .addContainerGap()
180 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
181 .addComponent(jLabel1)
182 .addComponent(textReferenceNumber, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
183 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
184 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
185 .addComponent(jLabel2)
186 .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE))
187 .addGap(8, 8, 8)
188 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
189 .addComponent(jLabel3)
190 .addComponent(textEntrustmentDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
191 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
192 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
193 .addComponent(jLabel4)
194 .addComponent(textClientName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
195 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
196 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
197 .addComponent(checkDraftCreated)
198 .addComponent(checkDraftApproved))
199 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
200 .addComponent(checkNoticeSent)
201 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
202 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
203 .addComponent(jLabel5)
204 .addComponent(textSentDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
205 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
206 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
207 .addComponent(jLabel6)
208 .addComponent(textRPADReference, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
209 .addGap(18, 18, 18)
210 .addComponent(checkNoticeDelivered)
211 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
212 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
213 .addComponent(jLabel7)
214 .addComponent(textDeliveryDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
215 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
216 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
217 .addComponent(jLabel8)
218 .addComponent(textBillStatus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
219 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
220 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
221 .addComponent(jLabel9)
222 .addComponent(valBillAmount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
223 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
224 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
225 .addComponent(jLabel10)
226 .addComponent(textBillDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
227 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
228 .addComponent(checkClarificationPending)
229 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
230 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
231 .addGroup(jPanel1Layout.createSequentialGroup()
232 .addComponent(jLabel11)
233 .addGap(0, 60, Short.MAX_VALUE))
234 .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
235 .addContainerGap())
236 );
237
238 jScrollPane1.setViewportView(jPanel1);
239
240 javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
241 getContentPane().setLayout(layout);
242 layout.setHorizontalGroup(
243 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
244 .addGroup(layout.createSequentialGroup()
245 .addContainerGap()
246 .addComponent(jScrollPane1)
247 .addContainerGap())
248 );
249 layout.setVerticalGroup(
250 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
251 .addGroup(layout.createSequentialGroup()
252 .addContainerGap()
253 .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 347, Short.MAX_VALUE)
254 .addContainerGap())
255 );
256
257 pack();
258 }// </editor-fold>//GEN-END:initComponents
259
260 /**
261 * @param args the command line arguments
262 */
263 public static void main(String args[]) {
264 /* Set the Nimbus look and feel */
265 //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
266 /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
267 * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
268 */
269 try {
270 for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
271 if ("Nimbus".equals(info.getName())) {
272 javax.swing.UIManager.setLookAndFeel(info.getClassName());
273 break;
274 }
275 }
276 } catch (ClassNotFoundException ex) {
277 java.util.logging.Logger.getLogger(ViewNoticeDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
278 } catch (InstantiationException ex) {
279 java.util.logging.Logger.getLogger(ViewNoticeDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
280 } catch (IllegalAccessException ex) {
281 java.util.logging.Logger.getLogger(ViewNoticeDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
282 } catch (javax.swing.UnsupportedLookAndFeelException ex) {
283 java.util.logging.Logger.getLogger(ViewNoticeDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
284 }
285 //</editor-fold>
286
287 /* Create and display the dialog */
288 java.awt.EventQueue.invokeLater(new Runnable() {
289 public void run() {
290 ViewNoticeDialog dialog = new ViewNoticeDialog(new javax.swing.JFrame(), true);
291 dialog.addWindowListener(new java.awt.event.WindowAdapter() {
292 @Override
293 public void windowClosing(java.awt.event.WindowEvent e) {
294 System.exit(0);
295 }
296 });
297 dialog.setVisible(true);
298 }
299 });
300 }
301
302 // Variables declaration - do not modify//GEN-BEGIN:variables
303 private javax.swing.JCheckBox checkClarificationPending;
304 private javax.swing.JCheckBox checkDraftApproved;
305 private javax.swing.JCheckBox checkDraftCreated;
306 private javax.swing.JCheckBox checkNoticeDelivered;
307 private javax.swing.JCheckBox checkNoticeSent;
308 private javax.swing.JLabel jLabel1;
309 private javax.swing.JLabel jLabel10;
310 private javax.swing.JLabel jLabel11;
311 private javax.swing.JLabel jLabel2;
312 private javax.swing.JLabel jLabel3;
313 private javax.swing.JLabel jLabel4;
314 private javax.swing.JLabel jLabel5;
315 private javax.swing.JLabel jLabel6;
316 private javax.swing.JLabel jLabel7;
317 private javax.swing.JLabel jLabel8;
318 private javax.swing.JLabel jLabel9;
319 private javax.swing.JPanel jPanel1;
320 private javax.swing.JScrollPane jScrollPane1;
321 private javax.swing.JScrollPane jScrollPane2;
322 private javax.swing.JScrollPane jScrollPane3;
323 private javax.swing.JTextField textBillDate;
324 private javax.swing.JTextField textBillStatus;
325 private javax.swing.JTextArea textClarificationRemarks;
326 private javax.swing.JTextField textClientName;
327 private javax.swing.JTextField textDeliveryDate;
328 private javax.swing.JTextArea textDescription;
329 private javax.swing.JTextField textEntrustmentDate;
330 private javax.swing.JTextField textRPADReference;
331 private javax.swing.JTextField textReferenceNumber;
332 private javax.swing.JTextField textSentDate;
333 private javax.swing.JFormattedTextField valBillAmount;
334 // End of variables declaration//GEN-END:variables
335
336 void setFields(int selid, String reference_number,
337 String description, Date entrustment_date, String client_name,
338 boolean draft_created, boolean draft_approved,
339 boolean notice_sent, Date sent_date, String rpad_reference,
340 boolean notice_delivered, Date delivery_date,
341 String bill_status, int bill_amount, Date bill_date,
342 boolean clarification_pending, String clarification_remarks) {
343 DateFormat fmt = new SimpleDateFormat("dd/MM/yyyy");
344
345 textReferenceNumber.setText(reference_number);
346 textDescription.setText(description);
347 textEntrustmentDate.setText(entrustment_date == null ? "" : fmt.format(entrustment_date));
348 textClientName.setText(client_name);
349 checkDraftCreated.setSelected(draft_created);
350 checkDraftApproved.setSelected(draft_approved);
351 checkNoticeSent.setSelected(notice_sent);
352 textSentDate.setText(sent_date == null ? "" : fmt.format(sent_date));
353 textRPADReference.setText(rpad_reference);
354 checkNoticeDelivered.setSelected(notice_delivered);
355 textDeliveryDate.setText(delivery_date == null ? "" : fmt.format(delivery_date));
356 textBillStatus.setText(bill_status);
357 valBillAmount.setValue(bill_amount);
358 textBillDate.setText (bill_date == null ? "" : fmt.format(bill_date));
359 checkClarificationPending.setSelected(clarification_pending);
360 textClarificationRemarks.setText(clarification_remarks);
361 }
362 }