summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/util/GuiOrganizer.java
diff options
context:
space:
mode:
authorJonathan Bauer2015-03-03 19:02:48 +0100
committerJonathan Bauer2015-03-03 19:02:48 +0100
commit0447841f3a08890bf746625d0f17976adada6ac8 (patch)
treef63bd9f2ac8d77f4732b70cac8e5c0497f4d3a45 /dozentenmodul/src/main/java/util/GuiOrganizer.java
parentwarnings fix (diff)
downloadtutor-module-0447841f3a08890bf746625d0f17976adada6ac8.tar.gz
tutor-module-0447841f3a08890bf746625d0f17976adada6ac8.tar.xz
tutor-module-0447841f3a08890bf746625d0f17976adada6ac8.zip
bwIDM - Shibboleth login working for Freiburg's SP - more to come
rework GUI classes to work with GuiManager: use GuiManager.show(<GUI to show>) and GuiManager.openPopup(<popup like About_GUI or ListAllOtherUsers_GUI>) only! static openlinks class (models/links.java deleted). There are keywords to open links, e.g. OpenLinks.openWebpage("faq"). Please see the class.
Diffstat (limited to 'dozentenmodul/src/main/java/util/GuiOrganizer.java')
-rw-r--r--dozentenmodul/src/main/java/util/GuiOrganizer.java66
1 files changed, 0 insertions, 66 deletions
diff --git a/dozentenmodul/src/main/java/util/GuiOrganizer.java b/dozentenmodul/src/main/java/util/GuiOrganizer.java
deleted file mode 100644
index 55cc2030..00000000
--- a/dozentenmodul/src/main/java/util/GuiOrganizer.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package util;
-
-import java.awt.GraphicsConfiguration;
-import java.awt.GraphicsDevice;
-import java.awt.GraphicsEnvironment;
-import java.awt.HeadlessException;
-import java.awt.Rectangle;
-import java.awt.Window;
-
-
-import javax.swing.JOptionPane;
-
-/**
- * An abstract class to organize the GUI.
- * Currently only provide a method for centering Window-objects.
- */
-public abstract class GuiOrganizer {
-
- /**
- * The rectangle representing the bounds of the primary display
- */
- private static Rectangle rect = null;
-
- /**
- * Gets the bounds of the primary display using
- * AWT's GraphicsEnvironment class.
- */
- private static boolean getDisplayBounds() {
- GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
- GraphicsDevice gd = null;
- try {
- gd = ge.getDefaultScreenDevice();
- } catch (HeadlessException he) {
- he.printStackTrace();
- JOptionPane.showMessageDialog(null, "Konnte kein Display ermittelt werden.",
- "Fehler", JOptionPane.ERROR_MESSAGE);
- return false;
- }
-
- GraphicsConfiguration gc = gd.getDefaultConfiguration();
- rect = gc.getBounds();
-
- if (rect == null) {
- JOptionPane.showMessageDialog(null, "Konnte die Resolution des Bildschirms nicht ermitteln!",
- "Fehler", JOptionPane.ERROR_MESSAGE);
- return false;
- } else {
- return true;
- }
- }
-
- /**
- * Centers the given Window within the bounds of the display
- * @param gui The Window object to be centered.
- */
- public static void centerGUI(Window gui) {
-
- if (rect == null) getDisplayBounds();
-
- double width = rect.getWidth();
- double height = rect.getHeight();
- double xPosition = (width / 2 - gui.getWidth() / 2);
- double yPosition = (height / 2 - gui.getHeight() / 2);
- gui.setLocation((int) xPosition, (int) yPosition);
- }
-}