summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/MainMenuWindowLayout.java
blob: a205196ce24f34bdc360ea7efca21a63ae40048c (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
package org.openslx.dozmod.gui.window.layout;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JLabel;

import org.openslx.dozmod.gui.helper.CompositePage;
import org.openslx.dozmod.gui.helper.GridManager;
import org.openslx.dozmod.util.ResourceLoader;

/*
 * Structure/workflow should be:
 * 
 * 1) App starts with Login Window for now [1]
 *
 * 2) After login, the main window opens.
 * 2a) If the disclaimer has not been accepted yet, the main window will open it as a modal window
 * 2b) Maybe do the same with the "you need vmware" window afterwards, or just show a hint in mainwindow
 *     that would open the vmware info window when clicked.
 * The disclaimer and vmware info should still be reachable via the menu at any time
 * 
 * - Clicking vm list or lecture list would show the according list in the same window
 * - adding/editing lecture/image will open a wizard
 * - doubleclicking a lecture/image will open a detailed info window
 * 
 * 
 * GuiManager's add/remove content needs refactoring or needs to be moved, as it's
 * designed like we only have one main window with changing content, but we
 * actually have lots of independent windows and wizards. 
 * 
 * (TODO: Make sure it doesn't suck on multiscreen setups)
 * 
 * [1] Later on we might support a "stay logged in" feature that
 * will skip the login screen
 */

@SuppressWarnings("serial")
public abstract class MainMenuWindowLayout extends CompositePage {
	// text for info for the vms selection
	protected String vmInfo = "<html><b>Übersicht Virtuelle Maschinen</b><br>"
			+ "Zur Übersicht über die verfügbaren Virtuellen Maschinen wechseln. Hier können Sie:<br><br>"
			+ "1) Veranstaltungen auf Basis einer Virtuellen Maschine erstellen<br>"
			+ "2) Neue Virtuelle Maschinen hochladen<br>"
			+ "3) Virtuelle Maschinen herunterladen<br>"
			+ "4) Virtuelle Maschinen bearbeiten und löschen</html>";

	// text for the info for the lecture selection
	protected String lecturesInfo = "<html><b>Übersicht Veranstaltungen</b><br>"
			+ "Zur Übersicht über die verfügbaren Veranstaltungen wechseln. Hier können Sie:<br><br>"
			+ "1) Veranstaltungen bearbeiten oder löschen<br>"
			+ "2) Zu Veranstaltungen gehörende Virtuelle Maschinen herunterladen<br>&nbsp;</html>";

	// buttons
	protected JButton vmButton;
	protected JButton lecturesButton;

	public MainMenuWindowLayout() {
		this.setBorder(BorderFactory.createTitledBorder("bwSuite-Hauptmenü"));
		GridManager grid = new GridManager(this, 2);

		vmButton = new JButton(ResourceLoader.getIcon("/img/virtualization.png", "VM-Übersicht"));
		JLabel vmInfoLabel = new JLabel(vmInfo);
		vmInfoLabel.setVerticalAlignment(JLabel.TOP);
		lecturesButton = new JButton(ResourceLoader.getIcon("/img/lecture.png", "Veranstaltungen"));
		JLabel lecturesInfoLabel = new JLabel(lecturesInfo);
		lecturesInfoLabel.setVerticalAlignment(JLabel.TOP);
		grid.add(vmButton).fill(true, false).expand(true, false);
		grid.add(lecturesButton).fill(true, false).expand(true, false);
		grid.nextRow();
		grid.add(vmInfoLabel).fill(true, true).expand(true, true);
		grid.add(lecturesInfoLabel).fill(true, true).expand(true, true);
		grid.nextRow();

		grid.finish(true);
	}

}