diff options
author | Simon Rettberg | 2016-04-25 14:16:04 +0200 |
---|---|---|
committer | Simon Rettberg | 2016-04-25 14:16:04 +0200 |
commit | 342fdf1aa19c3a4eeba70350558f4398f3bee4dc (patch) | |
tree | a91d22d4f2c0e3c141a343575000e73c8229bc23 /dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageListWindowLayout.java | |
parent | [server] Add update query to make email field longer (diff) | |
download | tutor-module-342fdf1aa19c3a4eeba70350558f4398f3bee4dc.tar.gz tutor-module-342fdf1aa19c3a4eeba70350558f4398f3bee4dc.tar.xz tutor-module-342fdf1aa19c3a4eeba70350558f4398f3bee4dc.zip |
[client] Add handling for master<->sat transfers
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, 41 insertions, 10 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 53bfc2f1..fb83e911 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 @@ -2,29 +2,33 @@ package org.openslx.dozmod.gui.window.layout; import java.awt.BorderLayout; import java.awt.Font; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; 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.apache.thrift.TException; import org.openslx.dozmod.gui.Gui; +import org.openslx.dozmod.gui.MainWindow; import org.openslx.dozmod.gui.control.ImageListViewer; import org.openslx.dozmod.gui.control.ImageListViewer.FilterType; import org.openslx.dozmod.gui.control.QLabel; import org.openslx.dozmod.gui.helper.CompositePage; import org.openslx.dozmod.gui.helper.GridManager; +import org.openslx.dozmod.thrift.Session; +import org.openslx.dozmod.thrift.ThriftError; +import org.openslx.thrifthelper.ThriftManager; @SuppressWarnings("serial") 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."; @@ -66,12 +70,18 @@ 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, 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)); + 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(btnEditDetails); buttonPanel.add(btnDelete); @@ -82,6 +92,27 @@ public abstract class ImageListWindowLayout extends CompositePage { buttonPanel.add(Box.createHorizontalGlue()); buttonPanel.add(btnSwitchView); + /* + * WARNING: Test crap + */ + JButton butt = new JButton("LOL"); + butt.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + try { + String token = ThriftManager.getSatClient().requestImageReplication(Session.getSatelliteToken(), + "e9de1941-b673-4711-b033-d8c37d1e2d3e"); + MainWindow.addPassiveTransfer(token, "POO POO VM", false); + } catch (TException e1) { + ThriftError.showMessage(ImageListWindowLayout.this, null, e1, "BOO BOO"); + } + } + }); + buttonPanel.add(butt); + /* + * END TEST + */ + // put everything together GridManager grid = new GridManager(this, 1); grid.add(infoPanel).fill(true, false).expand(true, false); |