summaryrefslogtreecommitdiffstats
path: root/Dozentenmodul/src/GUI/EingabeAllgemein.java
blob: 4643332e76ae76d42aa4f753c855b8c26737febf (plain) (blame)
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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
package GUI;


import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.border.EmptyBorder;
import java.awt.Color;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JTextPane;
import java.awt.SystemColor;
import javax.swing.JTextField;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JCheckBox;
import javax.swing.JSeparator;
import javax.swing.event.ChangeListener;
import javax.swing.event.ChangeEvent;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;

import Models.person;

@SuppressWarnings("serial")
public class EingabeAllgemein extends JDialog {

	private final JPanel contentPanel = new JPanel();
	String[] result;
	private JTextField Vorname_V;
	private JTextField Nachname_V;
	private JTextField Hochschule_V;
	private JTextField EMail_V;
	private JTextField Tel_V;
	private JTextField Fak_V;
	private JTextField Vorname_E;
	private JTextField Nachname_E;
	private JTextField Hochschule_E;
	private JTextField EMail_E;
	private JTextField Tel_E;
	private JTextField Fak_E;
	JCheckBox chckbxDerVerantwortlicheEntspricht;
	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		try {
			EingabeAllgemein dialog = new EingabeAllgemein();
			dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
			dialog.setVisible(true);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Create the dialog.
	 */
	public EingabeAllgemein() {
		setResizable(false);
		
		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (ClassNotFoundException | InstantiationException
				| IllegalAccessException | UnsupportedLookAndFeelException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		setTitle("Dozentenmodul");
		setBounds(100, 100, 545, 689);
		getContentPane().setLayout(null);
		{
			JPanel panel = new JPanel();
			panel.setBounds(0, 0, 529, 68);
			getContentPane().add(panel);
			panel.setLayout(null);
			{
				JLabel lblNewLabel = new JLabel("Eingabe der allgemeinen Daten (Schritt 3 von 6)");
				lblNewLabel.setBounds(10, 11, 509, 22);
				panel.add(lblNewLabel);
				lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 18));
			}
			
			JTextPane txtpnBitteWhlenSie = new JTextPane();
			txtpnBitteWhlenSie.setEditable(false);
			txtpnBitteWhlenSie.setBackground(SystemColor.menu);
			txtpnBitteWhlenSie.setText("Geben Sie hier bitte die Kontaktdaten des Vernatwortlichen und des Erstellers der VMDK ein");
			txtpnBitteWhlenSie.setBounds(10, 36, 509, 42);
			panel.add(txtpnBitteWhlenSie);
		}
		contentPanel.setBounds(10, 91, 509, 483);
		contentPanel.setBackground(Color.WHITE);
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		getContentPane().add(contentPanel);
		contentPanel.setLayout(null);
		
		JLabel lblNewLabel_1 = new JLabel("Allgemeine Informationen zum Verantwortlichen");
		lblNewLabel_1.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblNewLabel_1.setBounds(10, 0, 338, 25);
		contentPanel.add(lblNewLabel_1);
		
		JLabel lblNewLabel_2 = new JLabel("Vorname: *");
		lblNewLabel_2.setBounds(10, 36, 125, 20);
		contentPanel.add(lblNewLabel_2);
		
		Vorname_V = new JTextField();
		Vorname_V.setBounds(145, 36, 125, 20);
		Vorname_V.setText(person.verantowrtlicher.getVorname());
		contentPanel.add(Vorname_V);
		Vorname_V.setColumns(10);
		
		JLabel lblNachname = new JLabel("Nachname: *");
		lblNachname.setBounds(10, 67, 125, 20);
		contentPanel.add(lblNachname);
		
		Nachname_V = new JTextField();
		Nachname_V.setBounds(145, 67, 125, 20);
		Nachname_V.setText(person.verantowrtlicher.getName());
		contentPanel.add(Nachname_V);
		Nachname_V.setColumns(10);
		
		JLabel lblHochschule = new JLabel("Hochschule: *");
		lblHochschule.setBounds(10, 98, 125, 20);
		contentPanel.add(lblHochschule);
		
		Hochschule_V = new JTextField();
		Hochschule_V.setColumns(10);
		Hochschule_V.setBounds(145, 98, 125, 20);
		Hochschule_V.setText(person.verantowrtlicher.getHochschule());
		contentPanel.add(Hochschule_V);
		
		JLabel lblEmail = new JLabel("E-Mail: *");
		lblEmail.setBounds(10, 129, 125, 20);
		contentPanel.add(lblEmail);
		
		EMail_V = new JTextField();
		EMail_V.setColumns(10);
		EMail_V.setBounds(145, 129, 125, 20);
		EMail_V.setText(person.verantowrtlicher.getEMail());
		contentPanel.add(EMail_V);
		
		JLabel lblTelnummer = new JLabel("Tel.-Nummer:");
		lblTelnummer.setBounds(10, 160, 125, 20);
		contentPanel.add(lblTelnummer);
		
		Tel_V = new JTextField();
		Tel_V.setColumns(10);
		Tel_V.setBounds(145, 160, 125, 20);
		Tel_V.setText(person.verantowrtlicher.getTel());
		contentPanel.add(Tel_V);
		
		JLabel lblFakultt = new JLabel("Fakult\u00E4t:");
		lblFakultt.setBounds(10, 191, 125, 20);
		contentPanel.add(lblFakultt);
		
		Fak_V = new JTextField();
		Fak_V.setColumns(10);
		Fak_V.setBounds(145, 191, 125, 20);
		Fak_V.setText(person.verantowrtlicher.getFakultät());
		contentPanel.add(Fak_V);
		
		chckbxDerVerantwortlicheEntspricht = new JCheckBox("Der Verantwortliche entspricht dem Ersteller");
		chckbxDerVerantwortlicheEntspricht.setSelected(person.verantowrtlicher.isIschecked());
		chckbxDerVerantwortlicheEntspricht.addChangeListener(new ChangeListener() {
			public void stateChanged(ChangeEvent arg0) {
				if(chckbxDerVerantwortlicheEntspricht.isSelected()==true){
				Nachname_E.setText(Nachname_V.getText());
				Vorname_E.setText(Vorname_V.getText());
				Hochschule_E.setText(Hochschule_V.getText());
				EMail_E.setText(EMail_V.getText());
				Tel_E.setText(Tel_V.getText());
				Fak_E.setText(Fak_V.getText());
				}else{
					Nachname_E.setText("");
					Vorname_E.setText("");
					Hochschule_E.setText("");
					EMail_E.setText("");
					Tel_E.setText("");
					Fak_E.setText("");
				}
			}
		});
		chckbxDerVerantwortlicheEntspricht.setBackground(Color.WHITE);
		chckbxDerVerantwortlicheEntspricht.setBounds(6, 228, 264, 23);
		contentPanel.add(chckbxDerVerantwortlicheEntspricht);
		
		JLabel lblAllgemeineInformationenZum = new JLabel("Allgemeine Informationen zum Ersteller");
		lblAllgemeineInformationenZum.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblAllgemeineInformationenZum.setBounds(10, 258, 338, 25);
		contentPanel.add(lblAllgemeineInformationenZum);
		
		JLabel label_1 = new JLabel("Vorname: *");
		label_1.setBounds(10, 294, 125, 20);
		contentPanel.add(label_1);
		
		Vorname_E = new JTextField();
		Vorname_E.setColumns(10);
		Vorname_E.setBounds(145, 294, 125, 20);
		Vorname_E.setText(person.ersteller.getVorname());
		contentPanel.add(Vorname_E);
		
		JLabel label_2 = new JLabel("Nachname: *");
		label_2.setBounds(10, 325, 125, 20);
		contentPanel.add(label_2);
		
		Nachname_E = new JTextField();
		Nachname_E.setColumns(10);
		Nachname_E.setBounds(145, 325, 125, 20);
		Nachname_E.setText(person.ersteller.getName());
		contentPanel.add(Nachname_E);
		
		Hochschule_E = new JTextField();
		Hochschule_E.setColumns(10);
		Hochschule_E.setBounds(145, 356, 125, 20);
		Hochschule_E.setText(person.ersteller.getHochschule());
		contentPanel.add(Hochschule_E);
		
		JLabel label_3 = new JLabel("Hochschule: *");
		label_3.setBounds(10, 356, 125, 20);
		contentPanel.add(label_3);
		
		JLabel label_4 = new JLabel("E-Mail: *");
		label_4.setBounds(10, 387, 125, 20);
		contentPanel.add(label_4);
		
		EMail_E = new JTextField();
		EMail_E.setColumns(10);
		EMail_E.setBounds(145, 387, 125, 20);
		EMail_E.setText(person.ersteller.getEMail());
		contentPanel.add(EMail_E);
		
		Tel_E = new JTextField();
		Tel_E.setColumns(10);
		Tel_E.setBounds(145, 418, 125, 20);
		Tel_E.setText(person.ersteller.getTel());
		contentPanel.add(Tel_E);
		
		JLabel label_5 = new JLabel("Tel.-Nummer:");
		label_5.setBounds(10, 418, 125, 20);
		contentPanel.add(label_5);
		
		JLabel label_6 = new JLabel("Fakult\u00E4t:");
		label_6.setBounds(10, 449, 125, 20);
		contentPanel.add(label_6);
		
		Fak_E = new JTextField();
		Fak_E.setColumns(10);
		Fak_E.setText(person.ersteller.getFakultät());
		Fak_E.setBounds(145, 449, 125, 20);
		contentPanel.add(Fak_E);
		{
			JPanel buttonPane = new JPanel();
			buttonPane.setBounds(0, 597, 529, 33);
			buttonPane.setBackground(SystemColor.menu);
			buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
			getContentPane().add(buttonPane);
			{
				JButton okButton = new JButton("Zur\u00FCck");
				okButton.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {
						person.verantowrtlicher.setVorname(Vorname_V.getText());
						person.verantowrtlicher.setName(Nachname_V.getText());
						person.verantowrtlicher.setEMail(EMail_V.getText());
						person.verantowrtlicher.setFakultät(Fak_V.getText());
						person.verantowrtlicher.setHochschule(Hochschule_V.getText());
						person.verantowrtlicher.setTel(Tel_V.getText());
						person.verantowrtlicher.setIschecked(chckbxDerVerantwortlicheEntspricht.isSelected());
						person.ersteller.setEMail(EMail_E.getText());
						person.ersteller.setFakultät(Fak_E.getText());
						person.ersteller.setHochschule(Hochschule_E.getText());
						person.ersteller.setName(Nachname_E.getText());
						person.ersteller.setVorname(Vorname_V.getText());
						person.ersteller.setTel(Tel_E.getText());
						getVMwarePlayer sr=new getVMwarePlayer();
						sr.setVisible(true);
						dispose();
					}
				});
				okButton.setActionCommand("OK");
				buttonPane.add(okButton);
				getRootPane().setDefaultButton(okButton);
			}
			{
				JButton cancelButton = new JButton("Weiter");
				cancelButton.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {
						if(Vorname_V.getText().isEmpty()==false && Nachname_V.getText().isEmpty()==false && Hochschule_V.getText().isEmpty()==false&&EMail_V.getText().isEmpty()==false&&Vorname_E.getText().isEmpty()==false && Nachname_E.getText().isEmpty()==false && Hochschule_E.getText().isEmpty()==false&&EMail_E.getText().isEmpty()==false)
						{
						person.verantowrtlicher.setVorname(Vorname_V.getText());
						person.verantowrtlicher.setName(Nachname_V.getText());
						person.verantowrtlicher.setEMail(EMail_V.getText());
						person.verantowrtlicher.setFakultät(Fak_V.getText());
						person.verantowrtlicher.setHochschule(Hochschule_V.getText());
						person.verantowrtlicher.setTel(Tel_V.getText());
						person.verantowrtlicher.setIschecked(chckbxDerVerantwortlicheEntspricht.isSelected());
						person.ersteller.setEMail(EMail_E.getText());
						person.ersteller.setFakultät(Fak_E.getText());
						person.ersteller.setHochschule(Hochschule_E.getText());
						person.ersteller.setName(Nachname_E.getText());
						person.ersteller.setVorname(Vorname_V.getText());
						person.ersteller.setTel(Tel_E.getText());
						EingabeSystemDaten ea=new EingabeSystemDaten();
						ea.setVisible(true);
						dispose();
						}
						else{
							JOptionPane.showMessageDialog(null, "Bitte geben Sie alle notwendigen Daten an!",
									"Error", JOptionPane.ERROR_MESSAGE);	
						}
					}
				});
				cancelButton.setActionCommand("Cancel");
				buttonPane.add(cancelButton);
			}
		}
		
		JSeparator separator = new JSeparator();
		separator.setBounds(0, 79, 529, 2);
		getContentPane().add(separator);
		
		JSeparator separator_1 = new JSeparator();
		separator_1.setBounds(0, 585, 529, 2);
		getContentPane().add(separator_1);
		
		JMenuBar menuBar = new JMenuBar();
		setJMenuBar(menuBar);
		
		JMenu mnNewMenu = new JMenu("Suchen");
		menuBar.add(mnNewMenu);
		
		JMenuItem mntmVlSuche = new JMenuItem("VL Suche");
		mnNewMenu.add(mntmVlSuche);
		
		JMenu mnNewMenu_1 = new JMenu("Hilfe");
		menuBar.add(mnNewMenu_1);
		
		JMenuItem mntmFaq = new JMenuItem("FAQ");
		mnNewMenu_1.add(mntmFaq);
		
		JMenuItem mntmOtrs = new JMenuItem("OTRS");
		mnNewMenu_1.add(mntmOtrs);
		
	}
}