summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/VirtualizerNoticeWindowLayout.java
diff options
context:
space:
mode:
authorSimon Rettberg2015-07-28 14:42:13 +0200
committerSimon Rettberg2015-07-28 14:42:13 +0200
commit95b388cfb49e92e5395f3158a9f25bb4c575dfe5 (patch)
treed14bb5e072285170710223ffd13240b7f280494f /dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/VirtualizerNoticeWindowLayout.java
parent[client] Swing (diff)
downloadtutor-module-95b388cfb49e92e5395f3158a9f25bb4c575dfe5.tar.gz
tutor-module-95b388cfb49e92e5395f3158a9f25bb4c575dfe5.tar.xz
tutor-module-95b388cfb49e92e5395f3158a9f25bb4c575dfe5.zip
[client] bwKrischan
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/VirtualizerNoticeWindowLayout.java')
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/VirtualizerNoticeWindowLayout.java99
1 files changed, 45 insertions, 54 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/VirtualizerNoticeWindowLayout.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/VirtualizerNoticeWindowLayout.java
index ab1d9327..2742d931 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/VirtualizerNoticeWindowLayout.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/VirtualizerNoticeWindowLayout.java
@@ -1,23 +1,27 @@
package org.openslx.dozmod.gui.window.layout;
+import java.awt.BorderLayout;
import java.awt.Button;
-import java.awt.Composite;
-import java.awt.GridLayout;
-import java.awt.Label;
+import java.awt.Container;
+import java.awt.Dimension;
+import java.awt.Font;
+import javax.swing.Box;
+import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
-
-import org.openslx.dozmod.gui.Gui;
+import javax.swing.JPanel;
public abstract class VirtualizerNoticeWindowLayout extends JDialog {
private static final String title = "Hinweis VMWare Player";
- private static final String infoText = "Für die Arbeit mit der bwLehrpool Suite wird zwingend ein VMWare Player benötigt. "
+ private static final String infoText = "<html><body style='width:100%'>"
+ + "Für die Arbeit mit der bwLehrpool Suite wird zwingend ein VMWare Player benötigt. "
+ "Diesen können Sie sich unter folgendem Link kostenfrei downloaden. "
- + "Wenn Sie bereits den VMWare Player oder die VMWare Workstation installiert haben, können Sie diesen Hinweis ignorieren.";
+ + "Wenn Sie bereits den VMWare Player oder die VMWare Workstation installiert haben, können Sie diesen Hinweis ignorieren."
+ + "</body></html>";
- private final String infoTitle = "bwLehrpool Suite";
+ private final static String infoTitle = "bwLehrpool Suite";
protected JButton windowsDLButton;
protected JButton linuxDLButton;
@@ -26,58 +30,45 @@ public abstract class VirtualizerNoticeWindowLayout extends JDialog {
public VirtualizerNoticeWindowLayout(boolean modal) {
super(null, title, modal ? ModalityType.APPLICATION_MODAL : ModalityType.MODELESS);
+
- // layout for this composite
- this.setLayout(new GridLayout(1, false));
- GridData gd = new GridData();
- gd.widthHint = 500;
- this.setLayoutData(gd);
+ JPanel infoPane = new JPanel();
+ infoPane.setLayout(new BoxLayout(infoPane, BoxLayout.PAGE_AXIS));
// bold title at start.
- JLabel titleLabel = new JLabel(this, SWT.NONE);
- titleLabel.setText(infoTitle);
- JFontData fontData = titleLabel.getFont().getFontData()[0];
- final JFont font = new JFont(Gui.display, new FontData(fontData.getName(), fontData.getHeight(), SWT.BOLD));
+ JLabel titleLabel = new JLabel(infoTitle);
+ final Font font = titleLabel.getFont().deriveFont(Font.BOLD);
titleLabel.setFont(font);
+ infoPane.add(titleLabel);
// infotext
- JLabel infoLabel = new JLabel(this, SWT.NONE | SWT.WRAP);
- infoLabel.setText(infoText);
- infoLabel.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false));
-
- // composite for the windows vmware-download button
- Composite windowsComposite = new Composite(this, SWT.NONE);
- windowsComposite.setLayout(new GridLayout());
- windowsComposite.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false));
-
- new Label(windowsComposite, SWT.NONE).setText("Windows:");
- windowsDLButton = new Button(windowsComposite, SWT.PUSH);
- windowsDLButton.setText("VMWare Player Herunterladen");
-
- // composite for the linux vmware-download button
- Composite linuxComposite = new Composite(this, SWT.NONE);
- linuxComposite.setLayout(new GridLayout());
- linuxComposite.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false));
-
- new Label(windowsComposite, SWT.NONE).setText("Linux:");
- linuxDLButton = new Button(windowsComposite, SWT.PUSH);
- linuxDLButton.setText("VMWare Player Herunterladen");
-
- readCheck = new Button(this, SWT.CHECK);
- readCheck.setText("Diese Benachrichtigung nicht mehr anzeigen.");
- readCheck.setLayoutData(new GridData(GridData.BEGINNING, GridData.END, false, false));
-
- continueButton = new Button(this, SWT.PUSH);
- continueButton.setText("Weiter");
- continueButton.setLayoutData(new GridData(GridData.BEGINNING, GridData.END, false, false));
-
- // Dispose of stuff we allocated
- this.addDisposeListener(new DisposeListener() {
- @Override
- public void widgetDisposed(DisposeEvent e) {
- font.dispose();
- }
- });
+ JLabel infoLabel = new JLabel(infoText);
+ 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>");
+ linuxDLButton = new JButton("<html>VMWare Player für <b>Linux</b> herunterladen</html>");
+ infoPane.add(windowsDLButton);
+ infoPane.add(linuxDLButton);
+
+ // Bottom controls
+ JPanel bottomPane = new JPanel();
+ bottomPane.setLayout(new BoxLayout(infoPane, BoxLayout.PAGE_AXIS));
+
+ readCheck = new JButton("Diese Benachrichtigung nicht mehr anzeigen");
+ bottomPane.add(readCheck);
+
+ bottomPane.add(Box.createHorizontalGlue());
+
+ continueButton = new JButton("Schließen");
+ bottomPane.add(continueButton);
+
+ final Container content = getContentPane();
+ content.add(infoPane, BorderLayout.CENTER);
+ content.add(bottomPane, BorderLayout.PAGE_END);
}