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


                             
                          

                               
                                                      
                                                   
 
 
                                                                   
 

                                                                                           
                                                                                                                                                 

                                                                                         
                                                                                   
                                                                     
                                                                       
                                                                     
                                                                                              
 
                                                 
                                          


                                                        
                                           

                                               
                                                 
 
                                        
                                          
                                                                       



                                                                  


                                                                             
                                                             
                                                             
                                                   


                                                          
 
                                                         

                                                  
                                                                                   

                                                                                       
                                                                      
                                                              
                                                          
                                                                  
                                                                      
                                           
                                                                           
                                                  
                                            
                                                


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

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Font;

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

import org.apache.log4j.Logger;
import org.openslx.dozmod.gui.control.ImageListViewer;
import org.openslx.dozmod.gui.helper.CompositePage;


public abstract class ImageListWindowLayout extends CompositePage {

	private final static Logger LOGGER = Logger.getLogger(ImageListWindowLayout.class);

	protected final static String infoTextString = "Hier können Sie Virtuelle Maschinen hochladen, herunterladen, bearbeiten und löschen.";
	protected final static String infoTitleString = "Übersicht Virtuelle Maschinen";
	protected final static String newButtonLabel = "Neu";
	protected final static String newLectureButtonLabel = "Neue Veranstaltung";
	protected final static String editButtonLabel = "Bearbeiten";
	protected final static String downloadButtonLabel = "Download";
	protected final static String deleteButtonLabel = "Löschen";
	protected final static String switchViewButtonLabel = "Zu 'Veranstaltungen' wechseln";

	// --------------------------------------
	// search field, table and buttons
	protected final ImageListViewer imageListViewer;
	protected final JButton newButton;
	protected final JButton newLectureButton;
	protected final JButton editButton;
	protected final JButton downloadButton;
	protected final JButton deleteButton;
	protected final JButton switchViewButton;

	public ImageListWindowLayout() {
		super(new BorderLayout());
		setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

		// --------------------------------------
		// Info panel on the top with a search box
		JPanel infoPanel = new JPanel(new BorderLayout());
		JLabel infoTitle = new JLabel(infoTitleString);
		infoTitle.setFont(infoTitle.getFont().deriveFont(Font.BOLD));
		JLabel infoText = new JLabel(infoTextString);
		infoPanel.add(infoTitle, BorderLayout.NORTH);
		infoPanel.add(infoText, BorderLayout.CENTER);
		add(infoPanel, BorderLayout.NORTH);
		
		imageListViewer = new ImageListViewer();
		add(imageListViewer, BorderLayout.CENTER);

		// --------------------------------------
		// the buttons at the bottom
		JPanel buttonPanel = new JPanel();
		buttonPanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
		buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.LINE_AXIS));
		newButton = new JButton(newButtonLabel);
		newLectureButton = new JButton(newLectureButtonLabel);
		deleteButton = new JButton(deleteButtonLabel);
		editButton = new JButton(editButtonLabel);
		downloadButton = new JButton(downloadButtonLabel);
		switchViewButton = new JButton(switchViewButtonLabel);
		buttonPanel.add(newButton);
		buttonPanel.add(Box.createRigidArea(new Dimension(5,  0)));
		buttonPanel.add(newLectureButton);
		buttonPanel.add(editButton);
		buttonPanel.add(downloadButton);
		buttonPanel.add(Box.createRigidArea(new Dimension(5,  0)));
		buttonPanel.add(deleteButton);
		buttonPanel.add(Box.createHorizontalGlue());
		buttonPanel.add(switchViewButton);
		add(buttonPanel, BorderLayout.PAGE_END);
	}

}