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

import java.awt.Dimension;
import java.awt.Frame;

import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;

import org.openslx.dozmod.gui.helper.GridManager;

@SuppressWarnings("serial")
public abstract class VirtualizerNoticeWindowLayout extends JDialog {
	private static final String title = "Hinweis VMWare Player";
	private static final String infoText = "<html><body style='width:100%'>"
			+ "Für die Arbeit mit der bwLehrpool Suite wird zwingend der <b>VMWare Player</b> benötigt. "
			+ "Diesen können Sie sich unter folgendem Link kostenfrei herunterladen. "
			+ "Wenn Sie bereits den VMWare Player oder die VMWare Workstation installiert haben, können Sie diesen Hinweis ignorieren."
			+ "</body></html>";


//	protected JButton windowsDLButton;
	protected JButton btnDL;
	protected JButton continueButton;

	public VirtualizerNoticeWindowLayout(Frame modalParent) {
		super(modalParent, title, modalParent != null ? ModalityType.APPLICATION_MODAL : ModalityType.MODELESS);
		
		JPanel contentPanel = new JPanel();
		contentPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
		add(contentPanel);
		
		GridManager grid = new GridManager(contentPanel, 1);
		
		JPanel infoPane = new JPanel();
		infoPane.setLayout(new BoxLayout(infoPane, BoxLayout.PAGE_AXIS));

		// infotext
		JLabel infoLabel = new JLabel(infoText);
		infoLabel.setBorder(BorderFactory.createTitledBorder("Hinweis"));
		infoPane.add(infoLabel);
		
		// Spacing
		infoPane.add(Box.createRigidArea(new Dimension(0, 10)));

		// Download buttons
//		windowsDLButton = new JButton("<html>VMWare Player für <b>Windows</b> herunterladen</html>");
		btnDL = new JButton("<html>VMWare Player herunterladen</html>");
//		infoPane.add(windowsDLButton);
		infoPane.add(btnDL);
		
		// Bottom controls
		JPanel bottomPane = new JPanel();
		bottomPane.setLayout(new BoxLayout(bottomPane, BoxLayout.LINE_AXIS));

		
		bottomPane.add(Box.createHorizontalGlue());

		continueButton = new JButton("Schließen");
		bottomPane.add(continueButton);

		grid.add(infoPane).fill(true, true).expand(true, true);
		grid.nextRow();
		grid.skip().fill(true, true).expand(true, true);
		grid.nextRow();
		grid.add(bottomPane).fill(true, false).expand(true, false);
		grid.nextRow();
		grid.finish(false);


		setSize(new Dimension(600, 250));
		setLocationRelativeTo(modalParent);
		validate();
	}

}