From 0447841f3a08890bf746625d0f17976adada6ac8 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Tue, 3 Mar 2015 19:02:48 +0100 Subject: bwIDM - Shibboleth login working for Freiburg's SP - more to come rework GUI classes to work with GuiManager: use GuiManager.show() and GuiManager.openPopup() only! static openlinks class (models/links.java deleted). There are keywords to open links, e.g. OpenLinks.openWebpage("faq"). Please see the class. --- .../main/java/gui/lecture/SearchLecture_GUI.java | 114 +++------------------ 1 file changed, 13 insertions(+), 101 deletions(-) (limited to 'dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java') diff --git a/dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java b/dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java index fbb24849..2263fe59 100644 --- a/dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java @@ -1,6 +1,5 @@ package gui.lecture; -import gui.intro.About_GUI; import gui.intro.MainMenue_GUI; import java.awt.Color; @@ -14,10 +13,6 @@ import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.net.URI; -import java.net.URISyntaxException; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; @@ -26,11 +21,8 @@ import java.util.List; import java.util.Map; import javax.swing.JButton; -import javax.swing.JFrame; +import javax.swing.JInternalFrame; import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; import javax.swing.JPanel; import javax.swing.JRadioButton; import javax.swing.JScrollPane; @@ -48,13 +40,14 @@ import javax.swing.border.EmptyBorder; import javax.swing.border.TitledBorder; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import javax.swing.event.InternalFrameAdapter; +import javax.swing.event.InternalFrameEvent; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableModel; import javax.swing.table.TableRowSorter; -import models.Links; import models.SessionData; import models.person; @@ -62,10 +55,10 @@ import org.apache.thrift.TException; import org.openslx.sat.thrift.iface.Lecture; import thrift.ThriftManager; -import util.OpenLinks; +import util.GuiManager; @SuppressWarnings("serial") -public class SearchLecture_GUI extends JFrame { +public class SearchLecture_GUI extends JInternalFrame { private final JPanel contentPanel = new JPanel(); String[] result; @@ -113,27 +106,15 @@ public class SearchLecture_GUI extends JFrame { /** * Create the dialog. */ - public SearchLecture_GUI(Component formerGUI) { + public SearchLecture_GUI() { filters.add(RowFilter.regexFilter(".", 0)); rf = RowFilter.orFilter(filters); - - - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent arg0) { - // Beendet die Anwendung nach klick auf X - try { - ThriftManager.getSatClient().setSessionInvalid(SessionData.session.getAuthToken()); - } catch (TException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - System.exit(0); - } + + addInternalFrameListener(new InternalFrameAdapter() { @Override - public void windowOpened(WindowEvent arg0) { + public void internalFrameActivated(InternalFrameEvent arg0) { try { initTableModel(modelMyLectures); initTableModelAll(modelAll); @@ -205,6 +186,7 @@ public class SearchLecture_GUI extends JFrame { }); } }); + // Verhindert das Vergroessern Des Fensters setResizable(false); @@ -220,7 +202,7 @@ public class SearchLecture_GUI extends JFrame { setTitle("bwLehrpool Suite - Veranstaltung suchen - "+person.verantwortlicher.getUserID()); // Zentriert das Fenster in die Bildmitte 2; setBounds(0, 0, 842, 722); - setLocationRelativeTo(formerGUI); + getContentPane().setLayout(null); { @@ -305,10 +287,7 @@ public class SearchLecture_GUI extends JFrame { @Override public void mouseClicked(MouseEvent arg0) { // oeffnet das Hauptmenue - - SearchLecture_GUI.this.setVisible(false); - MainMenue_GUI main = new MainMenue_GUI(c); - main.setVisible(true); + GuiManager.show(new MainMenue_GUI()); } }); lblHauptmen.setForeground(Color.BLUE); @@ -438,10 +417,7 @@ public class SearchLecture_GUI extends JFrame { btnBack.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // oeffnet das Hauptmenue - - MainMenue_GUI main = new MainMenue_GUI(c); - main.setVisible(true); - dispose(); + GuiManager.show(new MainMenue_GUI()); } }); btnBack.setActionCommand("OK"); @@ -548,71 +524,7 @@ public class SearchLecture_GUI extends JFrame { JScrollPane scrollPaneName = new JScrollPane(labelName); scrollPaneName.setBounds(10, 40, 218, 55); panel.add(scrollPaneName); - //panel.add(labelName); - //panel.add(labelimage); - - JMenuBar menuBar = new JMenuBar(); - setJMenuBar(menuBar); - - JMenu mnNewMenu_1 = new JMenu("Hilfe"); - menuBar.add(mnNewMenu_1); - - JMenuItem mntmFaq = new JMenuItem("FAQ"); - mntmFaq.addMouseListener(new MouseAdapter() { - @SuppressWarnings("static-access") - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getFAQ()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - - e.printStackTrace(); - } - } - }); - mnNewMenu_1.add(mntmFaq); - - - JMenuItem mntmOtrs = new JMenuItem("OTRS"); - mntmOtrs.addMouseListener(new MouseAdapter() { - @SuppressWarnings("static-access") - @Override - public void mousePressed(MouseEvent arg0) { - - OpenLinks open = new OpenLinks(); - - URI windows; - try { - windows = new URI(Links.getOTRS()); - - open.openWebpage(windows); - - } catch (URISyntaxException e) { - - e.printStackTrace(); - } - - } - }); - mnNewMenu_1.add(mntmOtrs); - - JMenuItem mntmAbout = new JMenuItem("About"); - mntmAbout.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - About_GUI ab = new About_GUI(); - ab.setVisible(true); - } - }); - mnNewMenu_1.add(mntmAbout); - c = this; } -- cgit v1.2.3-55-g7522