Skip to content

Commit e18045e

Browse files
committed
Print functie aanpassingen
Print knop verplaatst. Datum toegevoegd en Naam employee toegevoegd. Print on register verwijderd
1 parent a32a92d commit e18045e

File tree

5 files changed

+31
-92
lines changed

5 files changed

+31
-92
lines changed

LuggageTrackerTool2/src/utility/PDFGenerator.java

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
package utility;
66

77

8+
import com.sun.servicetag.RegistrationData;
89
import model.*;
910

1011
import java.io.IOException;
@@ -40,7 +41,7 @@ public PDFGenerator() {
4041
public void generate(Passenger passenger, Luggage luggage){
4142

4243
DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
43-
String basicInformationOutput[] = {"Basic information", "Name: ", "Surname: ", "Date of birth: ", "Gender: ", "Home phone number: ", "Mobile phone number:", "Home address", "Country: ", "City: ", "Street: ", "Postal code: ", "Temporary address", "Country: ", "City: ", "Street: ", "Postal code: ", "Luggage", "Label Id: " ,"Label number: " ,"Description: ", "Storage location: ", "Status: "};
44+
String basicInformationOutput[] = {"Personal information", "Name: ", "Surname: ", "Date of birth: ", "Gender: ", "Home phone number: ", "Mobile phone number:", "Home address", "Country: ", "City: ", "Street: ", "Postal code: ", "Temporary address", "Country: ", "City: ", "Street: ", "Postal code: ", "Luggage", "Label Id: " ,"Label number: " ,"Description: ", "Storage location: ", "Status: ", " " , "Employee information: " , "Employee: ", "Date: "};
4445
String gegevens = null;
4546
try {
4647
int x = 75;
@@ -70,11 +71,11 @@ public void generate(Passenger passenger, Luggage luggage){
7071
}
7172
if (i == 17) {
7273
this.contentStream.setFont(PDType1Font.HELVETICA_BOLD, 16);
73-
74-
}
74+
}
7575
if (i == 23) {
7676
this.contentStream.setFont(PDType1Font.HELVETICA_BOLD, 16);
77-
77+
78+
7879
}else {
7980
this.contentStream.drawString(basicInformationOutput[i]);
8081

@@ -124,9 +125,17 @@ public void generate(Passenger passenger, Luggage luggage){
124125
case 20: gegevens = luggage.getDescription();
125126
break;
126127
case 21: gegevens = luggage.getStoragelocation();
127-
break;
128+
break;
128129
case 22: gegevens = luggage.getLuggagestatus().name();
129130
break;
131+
case 23: gegevens = "Employee information: ";
132+
break;
133+
case 24: gegevens = "";
134+
break;
135+
case 25: gegevens = User.getAdmin().getUsername();
136+
break;
137+
case 26: gegevens = luggage.getDateAdded().toString();
138+
break;
130139
default:
131140
break;
132141

LuggageTrackerTool2/src/view/RegistrationLuggage.form

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,10 @@
3939
<Component id="STORAGE_LOCATION" min="-2" max="-2" attributes="0"/>
4040
<Component id="DESCRIPTION" min="-2" max="-2" attributes="0"/>
4141
<Component id="LUGGAGEID_LABEL" alignment="0" min="-2" max="-2" attributes="0"/>
42-
<Component id="PRINT_ON_REGISTER_INPUT" min="-2" max="-2" attributes="0"/>
4342
<Component id="ANDERS" alignment="0" min="-2" pref="41" max="-2" attributes="0"/>
4443
<Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
45-
<Component id="PRINT_BUTTON" alignment="0" min="-2" max="-2" attributes="0"/>
4644
</Group>
47-
<EmptySpace min="-2" pref="13" max="-2" attributes="0"/>
45+
<EmptySpace min="-2" pref="35" max="-2" attributes="0"/>
4846
<Group type="103" groupAlignment="0" attributes="0">
4947
<Component id="SUBMIT_BUTTON" min="-2" max="-2" attributes="0"/>
5048
<Component id="STATUS_COMBOBOX" min="-2" max="-2" attributes="0"/>
@@ -55,7 +53,7 @@
5553
<Component id="LUGGAGEID_INPUT" max="32767" attributes="0"/>
5654
</Group>
5755
</Group>
58-
<EmptySpace pref="66" max="32767" attributes="0"/>
56+
<EmptySpace pref="43" max="32767" attributes="0"/>
5957
</Group>
6058
</Group>
6159
</DimensionLayout>
@@ -89,13 +87,8 @@
8987
<Component id="STATUS_COMBOBOX" alignment="0" min="-2" max="-2" attributes="0"/>
9088
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
9189
</Group>
92-
<EmptySpace max="-2" attributes="0"/>
93-
<Component id="PRINT_ON_REGISTER_INPUT" min="-2" max="-2" attributes="0"/>
94-
<EmptySpace max="-2" attributes="0"/>
95-
<Group type="103" groupAlignment="3" attributes="0">
96-
<Component id="PRINT_BUTTON" alignment="3" min="-2" max="-2" attributes="0"/>
97-
<Component id="SUBMIT_BUTTON" alignment="3" min="-2" max="-2" attributes="0"/>
98-
</Group>
90+
<EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
91+
<Component id="SUBMIT_BUTTON" min="-2" max="-2" attributes="0"/>
9992
<EmptySpace pref="19" max="32767" attributes="0"/>
10093
</Group>
10194
</Group>
@@ -142,12 +135,6 @@
142135
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="STORAGE_LOCATION_INPUTActionPerformed"/>
143136
</Events>
144137
</Component>
145-
<Component class="javax.swing.JCheckBox" name="PRINT_ON_REGISTER_INPUT">
146-
<Properties>
147-
<Property name="selected" type="boolean" value="true"/>
148-
<Property name="text" type="java.lang.String" value="Print on register"/>
149-
</Properties>
150-
</Component>
151138
<Component class="javax.swing.JLabel" name="ANDERS">
152139
<Properties>
153140
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
@@ -176,11 +163,6 @@
176163
</Component>
177164
</SubComponents>
178165
</Container>
179-
<Component class="javax.swing.JButton" name="PRINT_BUTTON">
180-
<Properties>
181-
<Property name="text" type="java.lang.String" value="Print"/>
182-
</Properties>
183-
</Component>
184166
<Component class="javax.swing.JButton" name="SUBMIT_BUTTON">
185167
<Properties>
186168
<Property name="text" type="java.lang.String" value="Submit"/>

LuggageTrackerTool2/src/view/RegistrationLuggage.java

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,9 @@ private void initComponents() {
9797
DESCRIPTION_INPUT1 = new javax.swing.JTextArea();
9898
STORAGE_LOCATION = new javax.swing.JLabel();
9999
STORAGE_LOCATION_INPUT = new javax.swing.JComboBox();
100-
PRINT_ON_REGISTER_INPUT = new javax.swing.JCheckBox();
101100
ANDERS = new javax.swing.JLabel();
102101
ANDERS_INPUT_FRAME = new javax.swing.JScrollPane();
103102
ANDERS_INPUT = new javax.swing.JTextArea();
104-
PRINT_BUTTON = new javax.swing.JButton();
105103
SUBMIT_BUTTON = new javax.swing.JButton();
106104
LUGGAGEID_LABEL = new javax.swing.JLabel();
107105
LUGGAGEID_INPUT = new javax.swing.JTextField();
@@ -129,9 +127,6 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
129127
}
130128
});
131129

132-
PRINT_ON_REGISTER_INPUT.setSelected(true);
133-
PRINT_ON_REGISTER_INPUT.setText("Print on register");
134-
135130
ANDERS.setFont(new java.awt.Font("Tahoma", 2, 13)); // NOI18N
136131
ANDERS.setText("Other");
137132

@@ -142,8 +137,6 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
142137
ANDERS_INPUT.setEnabled(false);
143138
ANDERS_INPUT_FRAME.setViewportView(ANDERS_INPUT);
144139

145-
PRINT_BUTTON.setText("Print");
146-
147140
SUBMIT_BUTTON.setText("Submit");
148141
SUBMIT_BUTTON.addActionListener(new java.awt.event.ActionListener() {
149142
public void actionPerformed(java.awt.event.ActionEvent evt) {
@@ -173,11 +166,9 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
173166
.addComponent(STORAGE_LOCATION)
174167
.addComponent(DESCRIPTION)
175168
.addComponent(LUGGAGEID_LABEL)
176-
.addComponent(PRINT_ON_REGISTER_INPUT)
177169
.addComponent(ANDERS, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
178-
.addComponent(jLabel1)
179-
.addComponent(PRINT_BUTTON))
180-
.addGap(13, 13, 13)
170+
.addComponent(jLabel1))
171+
.addGap(35, 35, 35)
181172
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
182173
.addComponent(SUBMIT_BUTTON)
183174
.addComponent(STATUS_COMBOBOX, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
@@ -186,7 +177,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
186177
.addComponent(DESCRIPTION_INPUT_FRAME, javax.swing.GroupLayout.DEFAULT_SIZE, 309, Short.MAX_VALUE)
187178
.addComponent(STORAGE_LOCATION_INPUT, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
188179
.addComponent(LUGGAGEID_INPUT)))
189-
.addContainerGap(66, Short.MAX_VALUE))
180+
.addContainerGap(43, Short.MAX_VALUE))
190181
);
191182
layout.setVerticalGroup(
192183
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -212,12 +203,8 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
212203
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
213204
.addComponent(STATUS_COMBOBOX, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
214205
.addComponent(jLabel1))
215-
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
216-
.addComponent(PRINT_ON_REGISTER_INPUT)
217-
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
218-
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
219-
.addComponent(PRINT_BUTTON)
220-
.addComponent(SUBMIT_BUTTON))
206+
.addGap(27, 27, 27)
207+
.addComponent(SUBMIT_BUTTON)
221208
.addContainerGap(19, Short.MAX_VALUE))
222209
);
223210
}// </editor-fold>//GEN-END:initComponents
@@ -270,8 +257,6 @@ private void LUGGAGEID_INPUTActionPerformed(java.awt.event.ActionEvent evt) {//G
270257
private javax.swing.JScrollPane DESCRIPTION_INPUT_FRAME;
271258
private javax.swing.JTextField LUGGAGEID_INPUT;
272259
private javax.swing.JLabel LUGGAGEID_LABEL;
273-
private javax.swing.JButton PRINT_BUTTON;
274-
private javax.swing.JCheckBox PRINT_ON_REGISTER_INPUT;
275260
private javax.swing.JComboBox STATUS_COMBOBOX;
276261
private javax.swing.JLabel STORAGE_LOCATION;
277262
private javax.swing.JComboBox STORAGE_LOCATION_INPUT;

LuggageTrackerTool2/src/view/RegistrationPassenger.form

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@
5959
<Component id="TEMP_POSTAL_CODE" min="-2" max="-2" attributes="0"/>
6060
<Component id="HOME_PHONE_NUMBER" min="-2" max="-2" attributes="0"/>
6161
<Component id="MOBILE_PHONE_NUMBER" min="-2" max="-2" attributes="0"/>
62-
<Component id="PRINT_ON_REGISTER" alignment="0" min="-2" max="-2" attributes="0"/>
63-
<Component id="PRINT" alignment="0" min="-2" max="-2" attributes="0"/>
6462
<Component id="SURNAME" alignment="0" min="-2" max="-2" attributes="0"/>
6563
</Group>
6664
</Group>
@@ -97,7 +95,6 @@
9795
</Group>
9896
</Group>
9997
</Group>
100-
<Component id="ADDITIONAL_OPTIONS_TITLE" min="-2" max="-2" attributes="0"/>
10198
<Group type="102" alignment="0" attributes="0">
10299
<Component id="HOME_ADDRESS_TITLE" min="-2" max="-2" attributes="0"/>
103100
<EmptySpace min="-2" pref="94" max="-2" attributes="0"/>
@@ -113,6 +110,7 @@
113110
<Component id="TEMP_CITY_INPUT" alignment="0" max="32767" attributes="0"/>
114111
</Group>
115112
</Group>
113+
<Component id="PRINT" alignment="1" min="-2" max="-2" attributes="0"/>
116114
</Group>
117115
<Group type="102" alignment="1" attributes="0">
118116
<EmptySpace min="-2" pref="188" max="-2" attributes="0"/>
@@ -227,16 +225,11 @@
227225
<Component id="TEMP_POSTAL_CODE" min="-2" max="-2" attributes="0"/>
228226
<Component id="TEMP_POSTAL_CODE_INPUT" min="-2" max="-2" attributes="0"/>
229227
</Group>
230-
<EmptySpace type="unrelated" max="-2" attributes="0"/>
231-
<Component id="ADDITIONAL_OPTIONS_TITLE" min="-2" max="-2" attributes="0"/>
232-
<EmptySpace max="-2" attributes="0"/>
233-
<Group type="103" groupAlignment="3" attributes="0">
234-
<Component id="PRINT_ON_REGISTER" alignment="3" min="-2" max="-2" attributes="0"/>
235-
<Component id="PAIR_PASSENGER_LUGGAGE" alignment="3" min="-2" max="-2" attributes="0"/>
236-
</Group>
228+
<EmptySpace min="-2" pref="29" max="-2" attributes="0"/>
229+
<Component id="PAIR_PASSENGER_LUGGAGE" min="-2" max="-2" attributes="0"/>
237230
<EmptySpace type="unrelated" max="-2" attributes="0"/>
238231
<Group type="103" groupAlignment="3" attributes="0">
239-
<Component id="PRINT" alignment="3" min="-2" max="-2" attributes="0"/>
232+
<Component id="PRINT" alignment="0" min="-2" max="-2" attributes="0"/>
240233
<Component id="REGISTER" alignment="3" min="-2" max="-2" attributes="0"/>
241234
</Group>
242235
<EmptySpace max="-2" attributes="0"/>
@@ -420,20 +413,6 @@
420413
<BindingProperty name="enabled" source="EQUALCHECKBOX" sourcePath="${!selected}" target="TEMP_POSTAL_CODE_INPUT" targetPath="enabled" updateStrategy="0" immediately="false"/>
421414
</BindingProperties>
422415
</Component>
423-
<Component class="javax.swing.JLabel" name="ADDITIONAL_OPTIONS_TITLE">
424-
<Properties>
425-
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
426-
<Font name="Tahoma" size="13" style="1"/>
427-
</Property>
428-
<Property name="text" type="java.lang.String" value="Additional Options"/>
429-
</Properties>
430-
</Component>
431-
<Component class="javax.swing.JCheckBox" name="PRINT_ON_REGISTER">
432-
<Properties>
433-
<Property name="selected" type="boolean" value="true"/>
434-
<Property name="text" type="java.lang.String" value="Print on register"/>
435-
</Properties>
436-
</Component>
437416
<Component class="javax.swing.JCheckBox" name="PAIR_PASSENGER_LUGGAGE">
438417
<Properties>
439418
<Property name="selected" type="boolean" value="true"/>

0 commit comments

Comments
 (0)