diff options
author | Simon Rettberg | 2016-02-02 12:38:54 +0100 |
---|---|---|
committer | Simon Rettberg | 2016-02-02 12:38:54 +0100 |
commit | 2b18a8ec42ddc282bb176f25944983493ff37dd7 (patch) | |
tree | a31a29f181ab538c38b9000dc765d67c2b836934 /dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout | |
parent | [client] Sanitize messy button-enabling-code in ImageListWindow (diff) | |
download | tutor-module-2b18a8ec42ddc282bb176f25944983493ff37dd7.tar.gz tutor-module-2b18a8ec42ddc282bb176f25944983493ff37dd7.tar.xz tutor-module-2b18a8ec42ddc282bb176f25944983493ff37dd7.zip |
[client] Add icons to lecture and image list buttons
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout')
4 files changed, 31 insertions, 21 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageDetailsWindowLayout.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageDetailsWindowLayout.java index c572f5ec..de120a81 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageDetailsWindowLayout.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageDetailsWindowLayout.java @@ -35,6 +35,8 @@ import org.openslx.thrifthelper.Comparators; @SuppressWarnings("serial") public abstract class ImageDetailsWindowLayout extends JDialog { + + private static final int ICON_SIZE_Y = 24; protected final JTextField txtTitle; protected final JTextArea txtDescription; @@ -204,7 +206,7 @@ public abstract class ImageDetailsWindowLayout extends JDialog { buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.LINE_AXIS)); btnSaveChanges = new JButton("Speichern"); btnClose = new JButton("Schließen"); - btnUpdateImage = new JButton("Neue Image-Version hochladen"); + btnUpdateImage = new JButton("Neue Image-Version hochladen", Gui.getScaledIconResource("/img/upload-icon.png", "New VM", ICON_SIZE_Y, buttonPanel)); buttonPanel.add(btnUpdateImage); buttonPanel.add(Box.createGlue()); // user feedback slot 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 1fa98797..f401dba9 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 @@ -1,16 +1,19 @@ 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.GroupLayout; import javax.swing.JButton; import javax.swing.JPanel; +import javax.swing.JSeparator; +import javax.swing.SwingConstants; import org.apache.log4j.Logger; +import org.openslx.dozmod.gui.Gui; import org.openslx.dozmod.gui.control.ImageListViewer; import org.openslx.dozmod.gui.control.ImageListViewer.FilterType; import org.openslx.dozmod.gui.control.QLabel; @@ -21,12 +24,14 @@ import org.openslx.dozmod.gui.helper.GridManager; public abstract class ImageListWindowLayout extends CompositePage { private final static Logger LOGGER = Logger.getLogger(ImageListWindowLayout.class); + + private static final int ICON_SIZE_Y = 24; 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 = "Neue VM"; protected final static String newLectureButtonLabel = "Neue Veranstaltung"; - protected final static String editButtonLabel = "Detailansicht"; + protected final static String editButtonLabel = "Detailansicht / Bearbeiten"; protected final static String downloadButtonLabel = "Download"; protected final static String deleteButtonLabel = "Löschen"; protected final static String switchViewButtonLabel = "Zu 'Veranstaltungen' wechseln"; @@ -61,19 +66,19 @@ public abstract class ImageListWindowLayout extends CompositePage { JPanel buttonPanel = new JPanel(); buttonPanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0)); buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.LINE_AXIS)); - btnNewVm = new JButton(newButtonLabel); - btnNewLecture = new JButton(newLectureButtonLabel); - btnDelete = new JButton(deleteButtonLabel); - btnEditDetails = new JButton(editButtonLabel); - btnDownload = new JButton(downloadButtonLabel); - btnSwitchView = new JButton(switchViewButtonLabel); + btnNewVm = new JButton(newButtonLabel, Gui.getScaledIconResource("/img/new-icon.png", "New VM", ICON_SIZE_Y, buttonPanel)); + btnEditDetails = new JButton(editButtonLabel, Gui.getScaledIconResource("/img/edit-icon.png", "Edit VM", ICON_SIZE_Y, buttonPanel)); + btnDelete = new JButton(deleteButtonLabel, Gui.getScaledIconResource("/img/red-cross.png", "Delete VM", ICON_SIZE_Y, buttonPanel)); + btnDownload = new JButton(downloadButtonLabel, Gui.getScaledIconResource("/img/download-icon.png", "New VM", ICON_SIZE_Y, buttonPanel)); + btnNewLecture = new JButton(newLectureButtonLabel, Gui.getScaledIconResource("/img/new-lecture-icon.png", "New Lecture", ICON_SIZE_Y, buttonPanel)); + btnSwitchView = new JButton(switchViewButtonLabel, Gui.getScaledIconResource("/img/switch-icon.png", "Switch", ICON_SIZE_Y, buttonPanel)); buttonPanel.add(btnNewVm); - buttonPanel.add(Box.createRigidArea(new Dimension(5, 0))); - buttonPanel.add(btnNewLecture); buttonPanel.add(btnEditDetails); - buttonPanel.add(btnDownload); - buttonPanel.add(Box.createRigidArea(new Dimension(5, 0))); buttonPanel.add(btnDelete); + buttonPanel.add(Box.createHorizontalStrut(5)); + buttonPanel.add(btnDownload); + buttonPanel.add(Box.createHorizontalStrut(5)); + buttonPanel.add(btnNewLecture); buttonPanel.add(Box.createHorizontalGlue()); buttonPanel.add(btnSwitchView); diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LectureDetailsWindowLayout.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LectureDetailsWindowLayout.java index 8d751a31..913a26e6 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LectureDetailsWindowLayout.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LectureDetailsWindowLayout.java @@ -5,6 +5,7 @@ import java.awt.Color; import java.awt.Font; import java.awt.Frame; import java.awt.GridBagConstraints; +import java.awt.Insets; import java.util.Calendar; import java.util.Date; import java.util.Properties; @@ -95,7 +96,7 @@ public abstract class LectureDetailsWindowLayout extends JDialog { // then we will set the panel in BorderLayout.CENTER JPanel infoPanel = new JPanel(); infoPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); - GridManager grid = new GridManager(infoPanel, 3); + GridManager grid = new GridManager(infoPanel, 3, true, new Insets(2, 2, 2, 2)); // -- name -- txtTitle = new JTextArea(); diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LectureListWindowLayout.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LectureListWindowLayout.java index 7aee0f30..a2c1e46a 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LectureListWindowLayout.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LectureListWindowLayout.java @@ -16,6 +16,7 @@ import javax.swing.JTextField; import javax.swing.UIManager; import javax.swing.border.TitledBorder; +import org.openslx.dozmod.gui.Gui; import org.openslx.dozmod.gui.control.QLabel; import org.openslx.dozmod.gui.control.table.LectureTable; import org.openslx.dozmod.gui.control.table.QScrollPane; @@ -25,10 +26,12 @@ import org.openslx.dozmod.gui.window.LectureListWindow.FilterType; @SuppressWarnings("serial") public abstract class LectureListWindowLayout extends CompositePage { + + private static final int ICON_SIZE_Y = 24; private static final String infoTitleString = "Übersicht Veranstaltungen"; private static final String newButtonLabel = "Neue Veranstaltung"; - private static final String editButtonLabel = "Detailansicht"; + private static final String editButtonLabel = "Detailansicht / Bearbeiten"; private static final String deleteButtonLabel = "Löschen"; private static final String switchViewButtonLabel = "Zu 'Images' wechseln"; private static final String filterPanelLabel = "Suchen"; @@ -102,16 +105,15 @@ public abstract class LectureListWindowLayout extends CompositePage { buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.LINE_AXIS)); buttonPanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0)); - btnNewLecture = new JButton(newButtonLabel); + btnNewLecture = new JButton(newButtonLabel, Gui.getScaledIconResource("/img/new-lecture-icon.png", "New Lecture", ICON_SIZE_Y, buttonPanel)); + btnEditLecture = new JButton(editButtonLabel, Gui.getScaledIconResource("/img/edit-icon.png", "Edit Lecture", ICON_SIZE_Y, buttonPanel)); + btnDeleteLecture = new JButton(deleteButtonLabel, Gui.getScaledIconResource("/img/red-cross.png", "Delete Lecture", ICON_SIZE_Y, buttonPanel)); + btnSwitchView = new JButton(switchViewButtonLabel, Gui.getScaledIconResource("/img/switch-icon.png", "Switch", ICON_SIZE_Y, buttonPanel)); buttonPanel.add(btnNewLecture); - buttonPanel.add(Box.createRigidArea(new Dimension(5, 0))); - btnEditLecture = new JButton(editButtonLabel); buttonPanel.add(btnEditLecture); - buttonPanel.add(Box.createRigidArea(new Dimension(5, 0))); - btnDeleteLecture = new JButton(deleteButtonLabel); + buttonPanel.add(Box.createHorizontalStrut(5)); buttonPanel.add(btnDeleteLecture); buttonPanel.add(Box.createHorizontalGlue()); - btnSwitchView = new JButton(switchViewButtonLabel); buttonPanel.add(btnSwitchView); // ----------------- end group for table ------------------------- |