forked from IF-LK-2020/stundenplan
Datensätze, implementierung und ERD
This commit is contained in:
parent
5de292cf44
commit
d2a920b9fc
|
@ -25,3 +25,4 @@ hs_err_pid*
|
|||
|
||||
/out/
|
||||
/.idea/
|
||||
/.~lock.Tage.csv#
|
||||
|
|
|
@ -0,0 +1,301 @@
|
|||
id,blocknummer,raum,klassen_id,datum,wochentag
|
||||
1,1,106,1,01.11.21,Mo
|
||||
2,2,121,1,01.11.21,Mo
|
||||
3,3,418,1,01.11.21,Mo
|
||||
4,4,322,1,01.11.21,Mo
|
||||
5,5,118,1,01.11.21,Mo
|
||||
6,6,409,1,01.11.21,Mo
|
||||
7,7,422,1,01.11.21,Mo
|
||||
8,8,321,1,01.11.21,Mo
|
||||
9,9,407,1,01.11.21,Mo
|
||||
10,10,407,1,01.11.21,Mo
|
||||
11,1,307,2,01.11.21,Mo
|
||||
12,2,405,2,01.11.21,Mo
|
||||
13,3,207,2,01.11.21,Mo
|
||||
14,4,217,2,01.11.21,Mo
|
||||
15,5,117,2,01.11.21,Mo
|
||||
16,6,419,2,01.11.21,Mo
|
||||
17,7,212,2,01.11.21,Mo
|
||||
18,8,116,2,01.11.21,Mo
|
||||
19,9,424,2,01.11.21,Mo
|
||||
20,10,315,2,01.11.21,Mo
|
||||
21,1,305,3,01.11.21,Mo
|
||||
22,2,321,3,01.11.21,Mo
|
||||
23,3,402,3,01.11.21,Mo
|
||||
24,4,409,3,01.11.21,Mo
|
||||
25,5,102,3,01.11.21,Mo
|
||||
26,6,124,3,01.11.21,Mo
|
||||
27,7,321,3,01.11.21,Mo
|
||||
28,8,223,3,01.11.21,Mo
|
||||
29,9,102,3,01.11.21,Mo
|
||||
30,10,107,3,01.11.21,Mo
|
||||
31,1,318,4,01.11.21,Mo
|
||||
32,2,118,4,01.11.21,Mo
|
||||
33,3,424,4,01.11.21,Mo
|
||||
34,4,311,4,01.11.21,Mo
|
||||
35,5,123,4,01.11.21,Mo
|
||||
36,6,321,4,01.11.21,Mo
|
||||
37,7,402,4,01.11.21,Mo
|
||||
38,8,306,4,01.11.21,Mo
|
||||
39,9,418,4,01.11.21,Mo
|
||||
40,10,203,4,01.11.21,Mo
|
||||
41,1,312,5,01.11.21,Mo
|
||||
42,2,416,5,01.11.21,Mo
|
||||
43,3,406,5,01.11.21,Mo
|
||||
44,4,324,5,01.11.21,Mo
|
||||
45,5,315,5,01.11.21,Mo
|
||||
46,6,204,5,01.11.21,Mo
|
||||
47,7,109,5,01.11.21,Mo
|
||||
48,8,412,5,01.11.21,Mo
|
||||
49,9,222,5,01.11.21,Mo
|
||||
50,10,410,5,01.11.21,Mo
|
||||
51,1,123,6,01.11.21,Mo
|
||||
52,2,408,6,01.11.21,Mo
|
||||
53,3,314,6,01.11.21,Mo
|
||||
54,4,103,6,01.11.21,Mo
|
||||
55,5,110,6,01.11.21,Mo
|
||||
56,6,413,6,01.11.21,Mo
|
||||
57,7,406,6,01.11.21,Mo
|
||||
58,8,406,6,01.11.21,Mo
|
||||
59,9,216,6,01.11.21,Mo
|
||||
60,10,317,6,01.11.21,Mo
|
||||
61,1,106,1,02.11.21,Di
|
||||
62,2,121,1,02.11.21,Di
|
||||
63,3,418,1,02.11.21,Di
|
||||
64,4,322,1,02.11.21,Di
|
||||
65,5,118,1,02.11.21,Di
|
||||
66,6,409,1,02.11.21,Di
|
||||
67,7,422,1,02.11.21,Di
|
||||
68,8,321,1,02.11.21,Di
|
||||
69,9,407,1,02.11.21,Di
|
||||
70,10,407,1,02.11.21,Di
|
||||
71,1,307,2,02.11.21,Di
|
||||
72,2,405,2,02.11.21,Di
|
||||
73,3,207,2,02.11.21,Di
|
||||
74,4,217,2,02.11.21,Di
|
||||
75,5,117,2,02.11.21,Di
|
||||
76,6,419,2,02.11.21,Di
|
||||
77,7,212,2,02.11.21,Di
|
||||
78,8,116,2,02.11.21,Di
|
||||
79,9,424,2,02.11.21,Di
|
||||
80,10,315,2,02.11.21,Di
|
||||
81,1,305,3,02.11.21,Di
|
||||
82,2,321,3,02.11.21,Di
|
||||
83,3,402,3,02.11.21,Di
|
||||
84,4,409,3,02.11.21,Di
|
||||
85,5,102,3,02.11.21,Di
|
||||
86,6,124,3,02.11.21,Di
|
||||
87,7,321,3,02.11.21,Di
|
||||
88,8,223,3,02.11.21,Di
|
||||
89,9,102,3,02.11.21,Di
|
||||
90,10,107,3,02.11.21,Di
|
||||
91,1,318,4,02.11.21,Di
|
||||
92,2,118,4,02.11.21,Di
|
||||
93,3,424,4,02.11.21,Di
|
||||
94,4,311,4,02.11.21,Di
|
||||
95,5,123,4,02.11.21,Di
|
||||
96,6,321,4,02.11.21,Di
|
||||
97,7,402,4,02.11.21,Di
|
||||
98,8,306,4,02.11.21,Di
|
||||
99,9,418,4,02.11.21,Di
|
||||
100,10,203,4,02.11.21,Di
|
||||
101,1,312,5,02.11.21,Di
|
||||
102,2,416,5,02.11.21,Di
|
||||
103,3,406,5,02.11.21,Di
|
||||
104,4,324,5,02.11.21,Di
|
||||
105,5,315,5,02.11.21,Di
|
||||
106,6,204,5,02.11.21,Di
|
||||
107,7,109,5,02.11.21,Di
|
||||
108,8,412,5,02.11.21,Di
|
||||
109,9,222,5,02.11.21,Di
|
||||
110,10,410,5,02.11.21,Di
|
||||
111,1,123,6,02.11.21,Di
|
||||
112,2,408,6,02.11.21,Di
|
||||
113,3,314,6,02.11.21,Di
|
||||
114,4,103,6,02.11.21,Di
|
||||
115,5,110,6,02.11.21,Di
|
||||
116,6,413,6,02.11.21,Di
|
||||
117,7,406,6,02.11.21,Di
|
||||
118,8,406,6,02.11.21,Di
|
||||
119,9,216,6,02.11.21,Di
|
||||
120,10,317,6,02.11.21,Di
|
||||
121,1,106,1,03.11.21,Mi
|
||||
122,2,121,1,03.11.21,Mi
|
||||
123,3,418,1,03.11.21,Mi
|
||||
124,4,322,1,03.11.21,Mi
|
||||
125,5,118,1,03.11.21,Mi
|
||||
126,6,409,1,03.11.21,Mi
|
||||
127,7,422,1,03.11.21,Mi
|
||||
128,8,321,1,03.11.21,Mi
|
||||
129,9,407,1,03.11.21,Mi
|
||||
130,10,407,1,03.11.21,Mi
|
||||
131,1,307,2,03.11.21,Mi
|
||||
132,2,405,2,03.11.21,Mi
|
||||
133,3,207,2,03.11.21,Mi
|
||||
134,4,217,2,03.11.21,Mi
|
||||
135,5,117,2,03.11.21,Mi
|
||||
136,6,419,2,03.11.21,Mi
|
||||
137,7,212,2,03.11.21,Mi
|
||||
138,8,116,2,03.11.21,Mi
|
||||
139,9,424,2,03.11.21,Mi
|
||||
140,10,315,2,03.11.21,Mi
|
||||
141,1,305,3,03.11.21,Mi
|
||||
142,2,321,3,03.11.21,Mi
|
||||
143,3,402,3,03.11.21,Mi
|
||||
144,4,409,3,03.11.21,Mi
|
||||
145,5,102,3,03.11.21,Mi
|
||||
146,6,124,3,03.11.21,Mi
|
||||
147,7,321,3,03.11.21,Mi
|
||||
148,8,223,3,03.11.21,Mi
|
||||
149,9,102,3,03.11.21,Mi
|
||||
150,10,107,3,03.11.21,Mi
|
||||
151,1,318,4,03.11.21,Mi
|
||||
152,2,118,4,03.11.21,Mi
|
||||
153,3,424,4,03.11.21,Mi
|
||||
154,4,311,4,03.11.21,Mi
|
||||
155,5,123,4,03.11.21,Mi
|
||||
156,6,321,4,03.11.21,Mi
|
||||
157,7,402,4,03.11.21,Mi
|
||||
158,8,306,4,03.11.21,Mi
|
||||
159,9,418,4,03.11.21,Mi
|
||||
160,10,203,4,03.11.21,Mi
|
||||
161,1,312,5,03.11.21,Mi
|
||||
162,2,416,5,03.11.21,Mi
|
||||
163,3,406,5,03.11.21,Mi
|
||||
164,4,324,5,03.11.21,Mi
|
||||
165,5,315,5,03.11.21,Mi
|
||||
166,6,204,5,03.11.21,Mi
|
||||
167,7,109,5,03.11.21,Mi
|
||||
168,8,412,5,03.11.21,Mi
|
||||
169,9,222,5,03.11.21,Mi
|
||||
170,10,410,5,03.11.21,Mi
|
||||
171,1,123,6,03.11.21,Mi
|
||||
172,2,408,6,03.11.21,Mi
|
||||
173,3,314,6,03.11.21,Mi
|
||||
174,4,103,6,03.11.21,Mi
|
||||
175,5,110,6,03.11.21,Mi
|
||||
176,6,413,6,03.11.21,Mi
|
||||
177,7,406,6,03.11.21,Mi
|
||||
178,8,406,6,03.11.21,Mi
|
||||
179,9,216,6,03.11.21,Mi
|
||||
180,10,317,6,03.11.21,Mi
|
||||
181,1,106,1,04.11.21,Do
|
||||
182,2,121,1,04.11.21,Do
|
||||
183,3,418,1,04.11.21,Do
|
||||
184,4,322,1,04.11.21,Do
|
||||
185,5,118,1,04.11.21,Do
|
||||
186,6,409,1,04.11.21,Do
|
||||
187,7,422,1,04.11.21,Do
|
||||
188,8,321,1,04.11.21,Do
|
||||
189,9,407,1,04.11.21,Do
|
||||
190,10,407,1,04.11.21,Do
|
||||
191,1,307,2,04.11.21,Do
|
||||
192,2,405,2,04.11.21,Do
|
||||
193,3,207,2,04.11.21,Do
|
||||
194,4,217,2,04.11.21,Do
|
||||
195,5,117,2,04.11.21,Do
|
||||
196,6,419,2,04.11.21,Do
|
||||
197,7,212,2,04.11.21,Do
|
||||
198,8,116,2,04.11.21,Do
|
||||
199,9,424,2,04.11.21,Do
|
||||
200,10,315,2,04.11.21,Do
|
||||
201,1,305,3,04.11.21,Do
|
||||
202,2,321,3,04.11.21,Do
|
||||
203,3,402,3,04.11.21,Do
|
||||
204,4,409,3,04.11.21,Do
|
||||
205,5,102,3,04.11.21,Do
|
||||
206,6,124,3,04.11.21,Do
|
||||
207,7,321,3,04.11.21,Do
|
||||
208,8,223,3,04.11.21,Do
|
||||
209,9,102,3,04.11.21,Do
|
||||
210,10,107,3,04.11.21,Do
|
||||
211,1,318,4,04.11.21,Do
|
||||
212,2,118,4,04.11.21,Do
|
||||
213,3,424,4,04.11.21,Do
|
||||
214,4,311,4,04.11.21,Do
|
||||
215,5,123,4,04.11.21,Do
|
||||
216,6,321,4,04.11.21,Do
|
||||
217,7,402,4,04.11.21,Do
|
||||
218,8,306,4,04.11.21,Do
|
||||
219,9,418,4,04.11.21,Do
|
||||
220,10,203,4,04.11.21,Do
|
||||
221,1,312,5,04.11.21,Do
|
||||
222,2,416,5,04.11.21,Do
|
||||
223,3,406,5,04.11.21,Do
|
||||
224,4,324,5,04.11.21,Do
|
||||
225,5,315,5,04.11.21,Do
|
||||
226,6,204,5,04.11.21,Do
|
||||
227,7,109,5,04.11.21,Do
|
||||
228,8,412,5,04.11.21,Do
|
||||
229,9,222,5,04.11.21,Do
|
||||
230,10,410,5,04.11.21,Do
|
||||
231,1,123,6,04.11.21,Do
|
||||
232,2,408,6,04.11.21,Do
|
||||
233,3,314,6,04.11.21,Do
|
||||
234,4,103,6,04.11.21,Do
|
||||
235,5,110,6,04.11.21,Do
|
||||
236,6,413,6,04.11.21,Do
|
||||
237,7,406,6,04.11.21,Do
|
||||
238,8,406,6,04.11.21,Do
|
||||
239,9,216,6,04.11.21,Do
|
||||
240,10,317,6,04.11.21,Do
|
||||
241,1,106,1,05.11.21,Fr
|
||||
242,2,121,1,05.11.21,Fr
|
||||
243,3,418,1,05.11.21,Fr
|
||||
244,4,322,1,05.11.21,Fr
|
||||
245,5,118,1,05.11.21,Fr
|
||||
246,6,409,1,05.11.21,Fr
|
||||
247,7,422,1,05.11.21,Fr
|
||||
248,8,321,1,05.11.21,Fr
|
||||
249,9,407,1,05.11.21,Fr
|
||||
250,10,407,1,05.11.21,Fr
|
||||
251,1,307,2,05.11.21,Fr
|
||||
252,2,405,2,05.11.21,Fr
|
||||
253,3,207,2,05.11.21,Fr
|
||||
254,4,217,2,05.11.21,Fr
|
||||
255,5,117,2,05.11.21,Fr
|
||||
256,6,419,2,05.11.21,Fr
|
||||
257,7,212,2,05.11.21,Fr
|
||||
258,8,116,2,05.11.21,Fr
|
||||
259,9,424,2,05.11.21,Fr
|
||||
260,10,315,2,05.11.21,Fr
|
||||
261,1,305,3,05.11.21,Fr
|
||||
262,2,321,3,05.11.21,Fr
|
||||
263,3,402,3,05.11.21,Fr
|
||||
264,4,409,3,05.11.21,Fr
|
||||
265,5,102,3,05.11.21,Fr
|
||||
266,6,124,3,05.11.21,Fr
|
||||
267,7,321,3,05.11.21,Fr
|
||||
268,8,223,3,05.11.21,Fr
|
||||
269,9,102,3,05.11.21,Fr
|
||||
270,10,107,3,05.11.21,Fr
|
||||
271,1,318,4,05.11.21,Fr
|
||||
272,2,118,4,05.11.21,Fr
|
||||
273,3,424,4,05.11.21,Fr
|
||||
274,4,311,4,05.11.21,Fr
|
||||
275,5,123,4,05.11.21,Fr
|
||||
276,6,321,4,05.11.21,Fr
|
||||
277,7,402,4,05.11.21,Fr
|
||||
278,8,306,4,05.11.21,Fr
|
||||
279,9,418,4,05.11.21,Fr
|
||||
280,10,203,4,05.11.21,Fr
|
||||
281,1,312,5,05.11.21,Fr
|
||||
282,2,416,5,05.11.21,Fr
|
||||
283,3,406,5,05.11.21,Fr
|
||||
284,4,324,5,05.11.21,Fr
|
||||
285,5,315,5,05.11.21,Fr
|
||||
286,6,204,5,05.11.21,Fr
|
||||
287,7,109,5,05.11.21,Fr
|
||||
288,8,412,5,05.11.21,Fr
|
||||
289,9,222,5,05.11.21,Fr
|
||||
290,10,410,5,05.11.21,Fr
|
||||
291,1,123,6,05.11.21,Fr
|
||||
292,2,408,6,05.11.21,Fr
|
||||
293,3,314,6,05.11.21,Fr
|
||||
294,4,103,6,05.11.21,Fr
|
||||
295,5,110,6,05.11.21,Fr
|
||||
296,6,413,6,05.11.21,Fr
|
||||
297,7,406,6,05.11.21,Fr
|
||||
298,8,406,6,05.11.21,Fr
|
||||
299,9,216,6,05.11.21,Fr
|
||||
300,10,317,6,05.11.21,Fr
|
|
|
@ -1,61 +0,0 @@
|
|||
id,blocknummer,raum,klassen_id,datum
|
||||
1,1,106,3,01.11.21
|
||||
2,2,121,6,01.11.21
|
||||
3,3,418,1,01.11.21
|
||||
4,4,322,6,01.11.21
|
||||
5,5,118,1,01.11.21
|
||||
6,6,409,1,01.11.21
|
||||
7,7,422,2,01.11.21
|
||||
8,8,321,6,01.11.21
|
||||
9,9,407,5,01.11.21
|
||||
10,10,407,1,01.11.21
|
||||
11,11,307,2,01.11.21
|
||||
12,12,405,4,01.11.21
|
||||
13,13,207,6,01.11.21
|
||||
14,14,217,4,01.11.21
|
||||
15,15,117,6,01.11.21
|
||||
16,16,419,2,01.11.21
|
||||
17,17,212,1,01.11.21
|
||||
18,18,116,5,01.11.21
|
||||
19,19,424,2,01.11.21
|
||||
20,20,315,4,01.11.21
|
||||
21,21,305,3,01.11.21
|
||||
22,22,321,6,01.11.21
|
||||
23,23,402,4,01.11.21
|
||||
24,24,409,1,01.11.21
|
||||
25,25,102,2,01.11.21
|
||||
26,26,124,1,01.11.21
|
||||
27,27,321,2,01.11.21
|
||||
28,28,223,5,01.11.21
|
||||
29,29,102,5,01.11.21
|
||||
30,30,107,6,01.11.21
|
||||
31,31,318,2,01.11.21
|
||||
32,32,118,4,01.11.21
|
||||
33,33,424,5,01.11.21
|
||||
34,34,311,1,01.11.21
|
||||
35,35,123,3,01.11.21
|
||||
36,36,321,1,01.11.21
|
||||
37,37,402,5,01.11.21
|
||||
38,38,306,6,01.11.21
|
||||
39,39,418,5,01.11.21
|
||||
40,40,203,6,01.11.21
|
||||
41,41,312,2,01.11.21
|
||||
42,42,416,6,01.11.21
|
||||
43,43,406,6,01.11.21
|
||||
44,44,324,5,01.11.21
|
||||
45,45,315,6,01.11.21
|
||||
46,46,204,3,01.11.21
|
||||
47,47,109,2,01.11.21
|
||||
48,48,412,3,01.11.21
|
||||
49,49,222,3,01.11.21
|
||||
50,50,410,2,01.11.21
|
||||
51,51,123,3,01.11.21
|
||||
52,52,408,6,01.11.21
|
||||
53,53,314,5,01.11.21
|
||||
54,54,103,4,01.11.21
|
||||
55,55,110,5,01.11.21
|
||||
56,56,413,5,01.11.21
|
||||
57,57,406,6,01.11.21
|
||||
58,58,406,3,01.11.21
|
||||
59,59,216,5,01.11.21
|
||||
60,60,317,1,01.11.21
|
|
|
@ -1,5 +1,6 @@
|
|||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class Stundenplan implements SelectionListener {
|
||||
|
||||
|
@ -44,13 +45,20 @@ public class Stundenplan implements SelectionListener {
|
|||
for (int i = 0; i < r.getRowCount(); i++) {
|
||||
teachers[i] = r.getData()[i][0];
|
||||
}
|
||||
dbc.executeStatement("SELECT name FROM klassen");
|
||||
r = dbc.getCurrentQueryResult();
|
||||
String[] klassen = new String[r.getRowCount()];
|
||||
for (int i = 0; i < r.getRowCount(); i++) {
|
||||
klassen[i] = r.getData()[i][0];
|
||||
}
|
||||
gui.addFilter("Lehrer", teachers);
|
||||
|
||||
gui.addFilter("Klasse", klassen);
|
||||
// GUI anzeigen und Verhalten bei Interaktion festlegen
|
||||
gui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
gui.addSelectionListener(this); // GUI ruft Methode selectionChanged auf, wenn sich eine Auswahlbox ändert.
|
||||
gui.setLocationRelativeTo(null);
|
||||
gui.setVisible(true);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -65,29 +73,61 @@ public class Stundenplan implements SelectionListener {
|
|||
*/
|
||||
@Override
|
||||
public void selectionChanged(String pList, String pNewValue) {
|
||||
|
||||
if (pList == "Lehrer") {
|
||||
// Zuerst alle bisherigen Stunden aus der GUI entfernen
|
||||
gui.removeAllLessons();
|
||||
|
||||
// Neue Daten aus der Datenbank abfragen.
|
||||
// Hier gefakte Daten, die Struktur der Datenbank ist nicht vorgegeben.
|
||||
dbc.executeStatement("SELECT 0,'Q2','405',kuerzel,0,0,'Informatik',-16711936 FROM lehrer WHERE kuerzel = '" + pNewValue + "'");
|
||||
//dbc.executeStatement("SELECT 0,'Q2','405',kuerzel,0,0,'Informatik',-16711936 FROM lehrer WHERE kuerzel = '" + pNewValue + "'");
|
||||
dbc.executeStatement("SELECT blocknummer, raum, name, wochentag, kuerzel, Fach FROM Stunden JOIN klassen ON Stunden.klassen_id = klassen.id JOIN unterrichtet ON unterrichtet.Stundenid = Stunden.id WHERE kuerzel = \""+pNewValue+"\"");
|
||||
QueryResult r = dbc.getCurrentQueryResult();
|
||||
|
||||
// Falls es ein Ergebnis gibt ...
|
||||
if (r != null) {
|
||||
String[][] data = r.getData();
|
||||
|
||||
// Neue Stunden in die GUI schreiben
|
||||
for (int i = 0; i < data.length; i++) {
|
||||
System.out.println("a");
|
||||
int wochentag = getWochentag(r,i);
|
||||
gui.addLesson(
|
||||
Integer.parseInt(data[i][4]), // Spalte im Plan (0=Montag, ... ,4=Freitag)
|
||||
Integer.parseInt(data[i][5]), // Zeile im Plan (0=1. Stunde, ... ,9=10. Stunde)
|
||||
data[i][6], // Titel
|
||||
"Raum " + data[i][2], // Untertitel
|
||||
data[i][1], // Beschreibungstext
|
||||
|
||||
wochentag, // Spalte im Plan (0=Montag, ... ,4=Freitag)
|
||||
Integer.parseInt(data[i][0])-1, // Zeile im Plan (0=1. Stunde, ... ,9=10. Stunde)
|
||||
data[i][5], // Titel
|
||||
"Raum " + data[i][1], // Untertitel
|
||||
data[i][4], // Beschreibungstext
|
||||
data[i][3], // Fußzeile
|
||||
new Color(Integer.parseInt(data[i][7])) // Farbe (Objekt der Klasse Color)
|
||||
new Color(colors(data,i)) // Farbe (Objekt der Klasse Color)
|
||||
);
|
||||
}
|
||||
|
||||
// GUI-Fenster neu zeichnen, um neue Elemente anzuzeigen.
|
||||
gui.revalidate();
|
||||
gui.repaint();
|
||||
}
|
||||
}
|
||||
if (pList == "Klasse"){
|
||||
dbc.executeStatement("SELECT blocknummer, raum, name, wochentag, kuerzel, Fach FROM Stunden JOIN klassen ON Stunden.klassen_id = klassen.id JOIN unterrichtet ON unterrichtet.Stundenid = Stunden.id WHERE name = \""+pNewValue+"\"");
|
||||
QueryResult r = dbc.getCurrentQueryResult();
|
||||
if (r != null) {
|
||||
String[][] data = r.getData();
|
||||
|
||||
// Neue Stunden in die GUI schreiben
|
||||
for (int i = 0; i < data.length; i++) {
|
||||
System.out.println(Arrays.toString(r.getData()[i]));
|
||||
int wochentag = getWochentag(r,i);
|
||||
gui.addLesson(
|
||||
|
||||
wochentag, // Spalte im Plan (0=Montag, ... ,4=Freitag)
|
||||
Integer.parseInt(data[i][0])-1, // Zeile im Plan (0=1. Stunde, ... ,9=10. Stunde)
|
||||
//Integer.parseInt(t.getData()[i][0])-1,
|
||||
data[i][5], // Titel
|
||||
"Raum " + data[i][1], // Untertitel
|
||||
data[i][4], // Beschreibungstext
|
||||
data[i][2], // Fußzeile
|
||||
new Color(colors(data,i)) // Farbe (Objekt der Klasse Color)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -97,4 +137,44 @@ public class Stundenplan implements SelectionListener {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int colors(String[][]data,int row){
|
||||
switch(data[row][5]){
|
||||
case "Deutsch":
|
||||
return 0xf24e5e;
|
||||
case "Englisch":
|
||||
return 0xf5e77d;
|
||||
case "Mathe":
|
||||
return 0x3257fa;
|
||||
case "Informatik":
|
||||
return 0x9ee7ff;
|
||||
case "Kunst":
|
||||
return 0xc39cff;
|
||||
case "Physik":
|
||||
return 0x80ffa4;
|
||||
case "Sport":
|
||||
return 0xd6d6d6;
|
||||
}
|
||||
return 0x000000;
|
||||
}
|
||||
|
||||
private int getWochentag(QueryResult r,int row){
|
||||
String[][] data = r.getData();
|
||||
|
||||
switch (data[row][3]) {
|
||||
case "Mo":
|
||||
return 0;
|
||||
case "Di":
|
||||
return 1;
|
||||
case "Mi":
|
||||
return 2;
|
||||
case "Do":
|
||||
return 3;
|
||||
case "Fr":
|
||||
return 4;
|
||||
}
|
||||
return 0;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,11 @@ import javax.swing.border.LineBorder;
|
|||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* GUI für das Stundenplanprogramm.
|
||||
|
@ -162,8 +166,8 @@ public class StundenplanGUI extends JFrame implements ActionListener {
|
|||
* Entfernt alle derzeit angezeigten Stunden aus dem GUI.
|
||||
*/
|
||||
public void removeAllLessons() {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
for (int j = 0; j < 5; j++) {
|
||||
for (int i = 0; i < 5; i++) {
|
||||
for (int j = 0; j < 30; j++) {
|
||||
removeLesson(i, j);
|
||||
}
|
||||
}
|
||||
|
@ -212,6 +216,29 @@ public class StundenplanGUI extends JFrame implements ActionListener {
|
|||
jpPlan.setLayout(new GridBagLayout());
|
||||
jpPlan.add(new JPanel());
|
||||
|
||||
DatabaseConnector dbc = new DatabaseConnector("", 0, "stundenplan.db", "", "");
|
||||
dbc.executeStatement("SELECT datum FROM Tage");
|
||||
QueryResult r = dbc.getCurrentQueryResult();
|
||||
|
||||
//Datum
|
||||
GregorianCalendar [] tage = new GregorianCalendar[7];
|
||||
GregorianCalendar g = new GregorianCalendar();
|
||||
System.out.println("asd " + g.getTimeZone());
|
||||
Date d = new Date();
|
||||
SimpleDateFormat datum = new SimpleDateFormat("dd.MM.yyyy");
|
||||
SimpleDateFormat tag = new SimpleDateFormat("dd");
|
||||
SimpleDateFormat wochentag = new SimpleDateFormat("EEEEEEEEEEEE");
|
||||
System.out.println("current Date: " + datum.format(d));
|
||||
System.out.println("current Day: " + wochentag.format(d));
|
||||
/*
|
||||
for (int j = 0; j < 7; j++) {
|
||||
tage[j]= new GregorianCalendar();
|
||||
}
|
||||
for(int i = g.get(Calendar.DAY_OF_WEEK); i<0;i--){
|
||||
tage[i]= new GregorianCalendar();
|
||||
tage[i] = tage[i].roll(Calendar.DAY_OF_WEEK,-i+1);
|
||||
}
|
||||
*/
|
||||
// Überschriften für die Spalten (Wochentage)
|
||||
GridBagConstraints c = new GridBagConstraints();
|
||||
c.gridx = 1;
|
||||
|
@ -219,15 +246,15 @@ public class StundenplanGUI extends JFrame implements ActionListener {
|
|||
c.fill = GridBagConstraints.NONE;
|
||||
c.weightx = 0.5;
|
||||
c.weighty = 0.2;
|
||||
jpPlan.add(makeLabel("Montag", fHeader), c);
|
||||
jpPlan.add(makeLabel("Montag "/*+r.getData()[0][0]*/, fHeader), c);
|
||||
c.gridx++;
|
||||
jpPlan.add(makeLabel("Dienstag", fHeader), c);
|
||||
jpPlan.add(makeLabel("Dienstag "/*+r.getData()[1][0]*/, fHeader), c);
|
||||
c.gridx++;
|
||||
jpPlan.add(makeLabel("Mittwoch", fHeader), c);
|
||||
jpPlan.add(makeLabel("Mittwoch "/*+r.getData()[2][0]*/, fHeader), c);
|
||||
c.gridx++;
|
||||
jpPlan.add(makeLabel("Donnerstag", fHeader), c);
|
||||
jpPlan.add(makeLabel("Donnerstag "/*+r.getData()[3][0]*/, fHeader), c);
|
||||
c.gridx++;
|
||||
jpPlan.add(makeLabel("Freitag", fHeader), c);
|
||||
jpPlan.add(makeLabel("Freitag "/*+r.getData()[4][0]*/, fHeader), c);
|
||||
|
||||
// Überschriften für die Zeilen (Stunden)
|
||||
c = new GridBagConstraints();
|
||||
|
|
BIN
stundenplan.db
BIN
stundenplan.db
Binary file not shown.
250
unterrichtet.csv
250
unterrichtet.csv
|
@ -18,14 +18,14 @@ Stundenid,Kuerzel,Fach
|
|||
17,fri,Mathe
|
||||
18,ger,Sport
|
||||
19,gor,Englisch
|
||||
20,göt,Sport
|
||||
20,g<EFBFBD>t,Sport
|
||||
21,grd,Kunst
|
||||
22,gru,Informatik
|
||||
23,gry,Mathe
|
||||
24,hel,Deutsch
|
||||
25,hob,Englisch
|
||||
26,hof,Deutsch
|
||||
27,hök,Englisch
|
||||
27,h<EFBFBD>k,Englisch
|
||||
28,hor,Physik
|
||||
29,htn,Sport
|
||||
30,imm,Physik
|
||||
|
@ -41,12 +41,12 @@ Stundenid,Kuerzel,Fach
|
|||
40,ldr,Mathe
|
||||
41,leh,Mathe
|
||||
42,lin,Deutsch
|
||||
43,lÜb,Physik
|
||||
43,l<EFBFBD>b,Physik
|
||||
44,mab,Sport
|
||||
45,mei,Kunst
|
||||
46,mrg,Physik
|
||||
47,msl,Deutsch
|
||||
48,müh,Kunst
|
||||
48,m<EFBFBD>h,Kunst
|
||||
49,ngb,Deutsch
|
||||
50,nid,Informatik
|
||||
51,nkp,Informatik
|
||||
|
@ -54,8 +54,248 @@ Stundenid,Kuerzel,Fach
|
|||
53,par,Informatik
|
||||
54,pie,Sport
|
||||
55,plv,Mathe
|
||||
56,pör,Deutsch
|
||||
56,p<EFBFBD>r,Deutsch
|
||||
57,pui,Informatik
|
||||
58,rak,Deutsch
|
||||
59,rbg,Kunst
|
||||
60,rc,Deutsch
|
||||
61,bar,Englisch
|
||||
62,beh,Informatik
|
||||
63,bhz,Informatik
|
||||
64,bmr,Kunst
|
||||
65,bod,Informatik
|
||||
66,brs,Englisch
|
||||
67,bru,Mathe
|
||||
68,buk,Physik
|
||||
69,buo,Mathe
|
||||
70,det,Englisch
|
||||
71,dfe,Mathe
|
||||
72,dsl,Informatik
|
||||
73,est,Informatik
|
||||
74,fel,Deutsch
|
||||
75,fis,Sport
|
||||
76,frd,Mathe
|
||||
77,fri,Mathe
|
||||
78,ger,Sport
|
||||
79,gor,Englisch
|
||||
80,g<>t,Sport
|
||||
81,grd,Kunst
|
||||
82,gru,Informatik
|
||||
83,gry,Mathe
|
||||
84,hel,Deutsch
|
||||
85,hob,Englisch
|
||||
86,hof,Deutsch
|
||||
87,h<>k,Englisch
|
||||
88,hor,Physik
|
||||
89,htn,Sport
|
||||
90,imm,Physik
|
||||
91,jka,Englisch
|
||||
92,kah,Physik
|
||||
93,kch,Informatik
|
||||
94,khm,Kunst
|
||||
95,kop,Sport
|
||||
96,kpp,Mathe
|
||||
97,kse,Mathe
|
||||
98,ksg,Englisch
|
||||
99,kth,Kunst
|
||||
100,ldr,Mathe
|
||||
101,leh,Mathe
|
||||
102,lin,Deutsch
|
||||
103,l<>b,Physik
|
||||
104,mab,Sport
|
||||
105,mei,Kunst
|
||||
106,mrg,Physik
|
||||
107,msl,Deutsch
|
||||
108,m<>h,Kunst
|
||||
109,ngb,Deutsch
|
||||
110,nid,Informatik
|
||||
111,nkp,Informatik
|
||||
112,osm,Physik
|
||||
113,par,Informatik
|
||||
114,pie,Sport
|
||||
115,plv,Mathe
|
||||
116,p<>r,Deutsch
|
||||
117,pui,Informatik
|
||||
118,rak,Deutsch
|
||||
119,rbg,Kunst
|
||||
120,rc,Deutsch
|
||||
121,bar,Englisch
|
||||
122,beh,Informatik
|
||||
123,bhz,Informatik
|
||||
124,bmr,Kunst
|
||||
125,bod,Informatik
|
||||
126,brs,Englisch
|
||||
127,bru,Mathe
|
||||
128,buk,Physik
|
||||
129,buo,Mathe
|
||||
130,det,Englisch
|
||||
131,dfe,Mathe
|
||||
132,dsl,Informatik
|
||||
133,est,Informatik
|
||||
134,fel,Deutsch
|
||||
135,fis,Sport
|
||||
136,frd,Mathe
|
||||
137,fri,Mathe
|
||||
138,ger,Sport
|
||||
139,gor,Englisch
|
||||
140,g<>t,Sport
|
||||
141,grd,Kunst
|
||||
142,gru,Informatik
|
||||
143,gry,Mathe
|
||||
144,hel,Deutsch
|
||||
145,hob,Englisch
|
||||
146,hof,Deutsch
|
||||
147,h<>k,Englisch
|
||||
148,hor,Physik
|
||||
149,htn,Sport
|
||||
150,imm,Physik
|
||||
151,jka,Englisch
|
||||
152,kah,Physik
|
||||
153,kch,Informatik
|
||||
154,khm,Kunst
|
||||
155,kop,Sport
|
||||
156,kpp,Mathe
|
||||
157,kse,Mathe
|
||||
158,ksg,Englisch
|
||||
159,kth,Kunst
|
||||
160,ldr,Mathe
|
||||
161,leh,Mathe
|
||||
162,lin,Deutsch
|
||||
163,l<>b,Physik
|
||||
164,mab,Sport
|
||||
165,mei,Kunst
|
||||
166,mrg,Physik
|
||||
167,msl,Deutsch
|
||||
168,m<>h,Kunst
|
||||
169,ngb,Deutsch
|
||||
170,nid,Informatik
|
||||
171,nkp,Informatik
|
||||
172,osm,Physik
|
||||
173,par,Informatik
|
||||
174,pie,Sport
|
||||
175,plv,Mathe
|
||||
176,p<>r,Deutsch
|
||||
177,pui,Informatik
|
||||
178,rak,Deutsch
|
||||
179,rbg,Kunst
|
||||
180,rc,Deutsch
|
||||
181,bar,Englisch
|
||||
182,beh,Informatik
|
||||
183,bhz,Informatik
|
||||
184,bmr,Kunst
|
||||
185,bod,Informatik
|
||||
186,brs,Englisch
|
||||
187,bru,Mathe
|
||||
188,buk,Physik
|
||||
189,buo,Mathe
|
||||
190,det,Englisch
|
||||
191,dfe,Mathe
|
||||
192,dsl,Informatik
|
||||
193,est,Informatik
|
||||
194,fel,Deutsch
|
||||
195,fis,Sport
|
||||
196,frd,Mathe
|
||||
197,fri,Mathe
|
||||
198,ger,Sport
|
||||
199,gor,Englisch
|
||||
200,g<>t,Sport
|
||||
201,grd,Kunst
|
||||
202,gru,Informatik
|
||||
203,gry,Mathe
|
||||
204,hel,Deutsch
|
||||
205,hob,Englisch
|
||||
206,hof,Deutsch
|
||||
207,h<>k,Englisch
|
||||
208,hor,Physik
|
||||
209,htn,Sport
|
||||
210,imm,Physik
|
||||
211,jka,Englisch
|
||||
212,kah,Physik
|
||||
213,kch,Informatik
|
||||
214,khm,Kunst
|
||||
215,kop,Sport
|
||||
216,kpp,Mathe
|
||||
217,kse,Mathe
|
||||
218,ksg,Englisch
|
||||
219,kth,Kunst
|
||||
220,ldr,Mathe
|
||||
221,leh,Mathe
|
||||
222,lin,Deutsch
|
||||
223,l<>b,Physik
|
||||
224,mab,Sport
|
||||
225,mei,Kunst
|
||||
226,mrg,Physik
|
||||
227,msl,Deutsch
|
||||
228,m<>h,Kunst
|
||||
229,ngb,Deutsch
|
||||
230,nid,Informatik
|
||||
231,nkp,Informatik
|
||||
232,osm,Physik
|
||||
233,par,Informatik
|
||||
234,pie,Sport
|
||||
235,plv,Mathe
|
||||
236,p<>r,Deutsch
|
||||
237,pui,Informatik
|
||||
238,rak,Deutsch
|
||||
239,rbg,Kunst
|
||||
240,rc,Deutsch
|
||||
241,bar,Englisch
|
||||
242,beh,Informatik
|
||||
243,bhz,Informatik
|
||||
244,bmr,Kunst
|
||||
245,bod,Informatik
|
||||
246,brs,Englisch
|
||||
247,bru,Mathe
|
||||
248,buk,Physik
|
||||
249,buo,Mathe
|
||||
250,det,Englisch
|
||||
251,dfe,Mathe
|
||||
252,dsl,Informatik
|
||||
253,est,Informatik
|
||||
254,fel,Deutsch
|
||||
255,fis,Sport
|
||||
256,frd,Mathe
|
||||
257,fri,Mathe
|
||||
258,ger,Sport
|
||||
259,gor,Englisch
|
||||
260,g<>t,Sport
|
||||
261,grd,Kunst
|
||||
262,gru,Informatik
|
||||
263,gry,Mathe
|
||||
264,hel,Deutsch
|
||||
265,hob,Englisch
|
||||
266,hof,Deutsch
|
||||
267,h<>k,Englisch
|
||||
268,hor,Physik
|
||||
269,htn,Sport
|
||||
270,imm,Physik
|
||||
271,jka,Englisch
|
||||
272,kah,Physik
|
||||
273,kch,Informatik
|
||||
274,khm,Kunst
|
||||
275,kop,Sport
|
||||
276,kpp,Mathe
|
||||
277,kse,Mathe
|
||||
278,ksg,Englisch
|
||||
279,kth,Kunst
|
||||
280,ldr,Mathe
|
||||
281,leh,Mathe
|
||||
282,lin,Deutsch
|
||||
283,l<>b,Physik
|
||||
284,mab,Sport
|
||||
285,mei,Kunst
|
||||
286,mrg,Physik
|
||||
287,msl,Deutsch
|
||||
288,m<>h,Kunst
|
||||
289,ngb,Deutsch
|
||||
290,nid,Informatik
|
||||
291,nkp,Informatik
|
||||
292,osm,Physik
|
||||
293,par,Informatik
|
||||
294,pie,Sport
|
||||
295,plv,Mathe
|
||||
296,p<>r,Deutsch
|
||||
297,pui,Informatik
|
||||
298,rak,Deutsch
|
||||
299,rbg,Kunst
|
||||
300,rc,Deutsch
|
||||
|
|
|
Loading…
Reference in New Issue