summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java
diff options
context:
space:
mode:
authorNino Breuer2014-10-09 14:52:01 +0200
committerNino Breuer2014-10-09 14:52:01 +0200
commit39833fd5db8f92dcc4a34a623b6e4f59cde2e74f (patch)
treee4db6866847c11ac27a339a58f2f220bf836490c /dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java
parentMerge branch 'master' of ssh://git.openslx.org/openslx-ng/tutor-module (diff)
downloadtutor-module-39833fd5db8f92dcc4a34a623b6e4f59cde2e74f.tar.gz
tutor-module-39833fd5db8f92dcc4a34a623b6e4f59cde2e74f.tar.xz
tutor-module-39833fd5db8f92dcc4a34a623b6e4f59cde2e74f.zip
• added possibility to change location of application
• set all JOptionPane positions relative to their parent • known bug: relative position does not work when clicking "back" in ftpcreateimage
Diffstat (limited to 'dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java')
-rw-r--r--dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java22
1 files changed, 12 insertions, 10 deletions
diff --git a/dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java b/dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java
index 49098677..17981c0e 100644
--- a/dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java
+++ b/dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java
@@ -2,6 +2,7 @@ package gui.image;
import java.awt.BorderLayout;
import java.awt.Color;
+import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.SystemColor;
@@ -90,6 +91,7 @@ public class FTPSearchDownloader_GUI extends JFrame implements
JButton btnMainMenu = new JButton("Hauptmenü");
JButton btnDownloadStoppen = new JButton("Download abbrechen");
private JLabel lblAnleitung;
+ Component c = null;
private boolean isCurrentlyLoading = false; // currently up or downloading
// file
private boolean isAborted = false; // down- or upload was manually aborted
@@ -101,7 +103,7 @@ public class FTPSearchDownloader_GUI extends JFrame implements
/**
* Create the frame.
*/
- public FTPSearchDownloader_GUI() {
+ public FTPSearchDownloader_GUI(Component formerGUI) {
final Object[] options = { "Beenden", "Abbrechen" };
@@ -112,7 +114,7 @@ public class FTPSearchDownloader_GUI extends JFrame implements
// check if user wants to quit.
int choice = JOptionPane
.showOptionDialog(
- null,
+ c,
"Aktuell ist ein Download aktiv. Wollen Sie diesen Abbrechen und das Programm beenden?",
"Upload aktiv",
JOptionPane.YES_NO_CANCEL_OPTION,
@@ -153,7 +155,7 @@ public class FTPSearchDownloader_GUI extends JFrame implements
// Aktion die beim Schliessen durchgefuehrt werden soll
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
setBounds(0, 0, 603, 722);
- GuiOrganizer.centerGUI(this);
+ setLocationRelativeTo(formerGUI);
getContentPane().setLayout(new BorderLayout());
contentPanel.setBackground(SystemColor.menu);
@@ -450,7 +452,7 @@ public class FTPSearchDownloader_GUI extends JFrame implements
if (isCurrentlyLoading() == true) {
int choice = JOptionPane
.showOptionDialog(
- null,
+ c,
"Nicht abgeschlossene Uploads werden beendet. Trotzdem zurück gehen?",
"Warnung",
JOptionPane.YES_NO_CANCEL_OPTION,
@@ -466,14 +468,14 @@ public class FTPSearchDownloader_GUI extends JFrame implements
e1.printStackTrace();
}
// go back one page
- SearchImage_GUI si = new SearchImage_GUI();
+ SearchImage_GUI si = new SearchImage_GUI(c);
si.setVisible(true);
dispose();
}// end choice
} else {
// go back one page
- SearchImage_GUI si = new SearchImage_GUI();
+ SearchImage_GUI si = new SearchImage_GUI(c);
si.setVisible(true);
dispose();
}// end else
@@ -491,7 +493,7 @@ public class FTPSearchDownloader_GUI extends JFrame implements
Config.setLastDownloadPath(lblPath.getText());
Config.store();
- MainMenue_GUI mm = new MainMenue_GUI();
+ MainMenue_GUI mm = new MainMenue_GUI(c);
mm.setVisible(true);
dispose();
}
@@ -504,11 +506,11 @@ public class FTPSearchDownloader_GUI extends JFrame implements
mnNewMenu_Info.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent arg0) {
- JOptionPane.showMessageDialog(null, HELP_MESSAGE, "Hilfe zu dieser Oberfläche", JOptionPane.INFORMATION_MESSAGE);
+ JOptionPane.showMessageDialog(c, HELP_MESSAGE, "Hilfe zu dieser Oberfläche", JOptionPane.INFORMATION_MESSAGE);
}
});
menuBar.add(mnNewMenu_Info);
-
+ c = this;
setVisible(true);
}
@@ -531,7 +533,7 @@ public class FTPSearchDownloader_GUI extends JFrame implements
} catch (TException e) {
// TODO Auto-generated catch block
e.printStackTrace();
- JOptionPane.showMessageDialog(null,
+ JOptionPane.showMessageDialog(c,
e.getCause() + "\n" + e.getStackTrace(), "Debug-Message",
JOptionPane.ERROR_MESSAGE);
}