summaryrefslogblamecommitdiffstats
path: root/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/VirtualizerNoticeWindowLayout.java
blob: 2742d9315b57161d8dd5d64b79ee563ede4770f5 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                                             
 
                             
                       


                          
 

                             


                           
                          
 

                                                                     

                                                                                                                
                                                                                                

                                                                                                                                                    
 
                                                                   
 



                                          
 

                                                                                                   
                
 

                                                                                 
 
                                       

                                                                             
                                         
                                         
 
                           


























                                                                                                              
 
         

 
 
package org.openslx.dozmod.gui.window.layout;

import java.awt.BorderLayout;
import java.awt.Button;
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 javax.swing.JPanel;

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 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."
			+ "</body></html>";

	private final static String infoTitle = "bwLehrpool Suite";

	protected JButton windowsDLButton;
	protected JButton linuxDLButton;
	protected JButton readCheck;
	protected JButton continueButton;

	public VirtualizerNoticeWindowLayout(boolean modal) {
		super(null, title, modal ? ModalityType.APPLICATION_MODAL : ModalityType.MODELESS);
		

		JPanel infoPane = new JPanel();
		infoPane.setLayout(new BoxLayout(infoPane, BoxLayout.PAGE_AXIS));

		// bold title at start.
		JLabel titleLabel = new JLabel(infoTitle);
		final Font font = titleLabel.getFont().deriveFont(Font.BOLD);
		titleLabel.setFont(font);
		infoPane.add(titleLabel);

		// infotext
		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);

	}


}