diff options
author | Jonathan Bauer | 2015-07-29 17:07:10 +0200 |
---|---|---|
committer | Jonathan Bauer | 2015-07-29 17:07:10 +0200 |
commit | 59782784a3e6ce52d3db84d569fa9e2da10a65cd (patch) | |
tree | aed765c7d71e356044b607c90cc889d8465796e5 /dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageListWindowLayout.java | |
parent | [client] register ImageListWindow in MainWindow (diff) | |
download | tutor-module-59782784a3e6ce52d3db84d569fa9e2da10a65cd.tar.gz tutor-module-59782784a3e6ce52d3db84d569fa9e2da10a65cd.tar.xz tutor-module-59782784a3e6ce52d3db84d569fa9e2da10a65cd.zip |
[client] ImageTable now with proper column labeling, finalized ImageListLayout based on BorderLayout
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageListWindowLayout.java')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageListWindowLayout.java | 51 |
1 files changed, 14 insertions, 37 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageListWindowLayout.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageListWindowLayout.java index e7ff4242..8c0c4cb3 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageListWindowLayout.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageListWindowLayout.java @@ -11,22 +11,20 @@ import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JSplitPane; -import javax.swing.JTable; import javax.swing.JTextField; -import javax.swing.ListSelectionModel; import javax.swing.border.TitledBorder; import org.apache.log4j.Logger; import org.openslx.dozmod.gui.control.table.ImageTable; import org.openslx.dozmod.gui.helper.CompositePage; import org.openslx.dozmod.gui.helper.GridPos; -import org.openslx.dozmod.gui.helper.ResizeColumnListener; 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 editButtonLabel = "Bearbeiten"; @@ -37,13 +35,17 @@ public abstract class ImageListWindowLayout extends CompositePage { protected final static String vmInfoGroupLabel = "Detailinformationen"; protected final static String filterGroupLabel = "Filter"; - // buttons + // -------------------------------------- + // Left panel: search field, table and buttons + protected JTextField searchTextField; + protected ImageTable imageTable; protected JButton newButton; protected JButton deleteButton; protected JButton downloadButton; protected JButton backButton; - // imageDetail texts + // -------------------------------------- + // Right panel: image details information protected JTextField imageSelectedNameLabel; protected JTextField idInfo; protected JTextField versionInfo; @@ -52,12 +54,6 @@ public abstract class ImageListWindowLayout extends CompositePage { protected JTextField ownerInfo; protected JTextField templateInfo; - protected JTextField searchTextField; - - protected ImageTable imageTable; - - protected String infoTextString = "Hier können Sie Virtuelle Maschinen hochladen, herunterladen, bearbeiten und löschen."; - public ImageListWindowLayout() { super(new BorderLayout()); @@ -69,7 +65,7 @@ public abstract class ImageListWindowLayout extends CompositePage { add(infoPanel, BorderLayout.NORTH); // -------------------------------------- - // List panel with the list of the images + // LEFT: List panel with the list of the images JPanel listPanel = new JPanel(new BorderLayout()); // the search field searchTextField = new JTextField(); @@ -91,7 +87,7 @@ public abstract class ImageListWindowLayout extends CompositePage { listPanel.add(buttonPanel, BorderLayout.PAGE_END); // -------------------------------------- - // Details panel on the right side + // RIGHT: Details panel for the selected image final JPanel detailsPane = new JPanel(); detailsPane.setLayout(new GridBagLayout()); detailsPane.setBorder(new TitledBorder(vmInfoGroupLabel)); @@ -110,35 +106,16 @@ public abstract class ImageListWindowLayout extends CompositePage { // For some reason without this the controls above are centered vertically detailsPane.add(new JPanel(), GridPos.get(0, row++, 2, 1, true, true)); // the actual layout of the whole window - JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, listPanel, detailsPane); + JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); + splitPane.setLeftComponent(listPanel); + splitPane.setRightComponent(detailsPane); + // make the left panel grab the excess space + splitPane.setResizeWeight(1); GridBagLayout bag = new GridBagLayout(); GridBagConstraints con = new GridBagConstraints(); con.fill = GridBagConstraints.BOTH; bag.setConstraints(splitPane, con); add(splitPane); - - - } - public JPanel newLabelToTextField(final String labelName, JTextField textField, GridBagConstraints con) { - JPanel newPanel = new JPanel(); - con.gridwidth = 1; - con.gridx = 0; - con.weightx = 0.1; - con.anchor = GridBagConstraints.WEST; - con.fill = GridBagConstraints.BOTH; - newPanel.add(new JLabel(labelName), con); - con.gridx = 1; - con.weightx = 1.; - con.anchor = GridBagConstraints.EAST; - con.fill = GridBagConstraints.HORIZONTAL; - if (textField == null) { - textField = new JTextField(); - } - newPanel.add(textField, con); - - // finally update "row number" - con.gridy++; - return newPanel; } public JTextField createCaptionAndTextfield(String captionString, JPanel group, int row) { JLabel caption = new JLabel(captionString); |