blob: 09bdebd046f1dca2750b4ed6744b730a6036ea80 (
plain) (
tree)
|
|
package org.openslx.dozmod.gui.window.layout;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Font;
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 backButtonLabel = "Zurück";
// --------------------------------------
// 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 backButton;
public ImageListWindowLayout() {
super(new BorderLayout());
// --------------------------------------
// 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.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);
backButton = new JButton(backButtonLabel);
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(backButton);
add(buttonPanel, BorderLayout.PAGE_END);
}
}
|