From 2be9e59d6919f20e681cfb5fc3a69f29d192f01f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 11 Apr 2014 13:58:54 +0200 Subject: Ping gegen Masterserver eingeführt zum gucken ob das Teil überhaupt erreichbar ist --- Dozentenmodul/src/gui/intro/Login_GUI.java | 238 ++++++++++++++++++----------- 1 file changed, 146 insertions(+), 92 deletions(-) (limited to 'Dozentenmodul/src/gui/intro/Login_GUI.java') diff --git a/Dozentenmodul/src/gui/intro/Login_GUI.java b/Dozentenmodul/src/gui/intro/Login_GUI.java index e2db747e..3ff5edfd 100644 --- a/Dozentenmodul/src/gui/intro/Login_GUI.java +++ b/Dozentenmodul/src/gui/intro/Login_GUI.java @@ -1,6 +1,6 @@ package gui.intro; - +import java.awt.Color; import java.awt.Dimension; import java.awt.EventQueue; import java.awt.Image; @@ -12,8 +12,8 @@ import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.File; import java.io.IOException; -import java.nio.channels.SeekableByteChannel; - +import java.net.InetAddress; +import java.net.UnknownHostException; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; @@ -25,7 +25,6 @@ import javax.swing.JTextField; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; import javax.swing.border.EmptyBorder; - import models.SessionData; import models.person; import org.apache.thrift.TException; @@ -33,15 +32,19 @@ import org.ini4j.Wini; import thrift.MasterThriftConnection; import thrift.ImageServer.Client; import thrift.UserInfo; - import config.config_file; +import javax.swing.SwingConstants; @SuppressWarnings("serial") public class Login_GUI extends JFrame { private JPanel contentPane; - private JTextField username; - private JPasswordField pass; + private JTextField lblusername; + private JPasswordField lblpass; + JLabel lblConnectionInfo = new JLabel(""); + boolean isConnectionToServerOK = false; + boolean login; + String masterServerIP = "132.230.4.16"; /** * Launch the application. @@ -129,16 +132,16 @@ public class Login_GUI extends JFrame { contentPane.add(LabelUser); // Erzeugen und Hinzufügen des Textfeldes - username = new JTextField(); - username.setToolTipText("Bitte geben Sie Ihren bwIDM-Benutzernamen ein."); - username.addActionListener(new ActionListener() { + lblusername = new JTextField(); + lblusername.setToolTipText("Bitte geben Sie Ihren bwIDM-Benutzernamen ein."); + lblusername.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { performLogin(); } }); - username.setBounds(304, 164, 196, 20); - contentPane.add(username); - username.setColumns(10); + lblusername.setBounds(304, 164, 196, 20); + contentPane.add(lblusername); + lblusername.setColumns(10); // Erzeugen und Hinzufügen des Labels JLabel LabelPass = new JLabel("bwIDM-Passwort:"); @@ -157,105 +160,156 @@ public class Login_GUI extends JFrame { contentPane.add(BtnLogin); // Erzeugen und Hinzufügen des Passwortfeldes - pass = new JPasswordField(); - pass.setToolTipText("Bitte geben Sie Ihr bwIDM-Passwort ein."); - pass.addActionListener(new ActionListener() { + lblpass = new JPasswordField(); + lblpass.setToolTipText("Bitte geben Sie Ihr bwIDM-Passwort ein."); + lblpass.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { performLogin(); } }); - pass.setBounds(304, 195, 196, 20); - contentPane.add(pass); + lblpass.setBounds(304, 195, 196, 20); + contentPane.add(lblpass); + + lblConnectionInfo.setHorizontalAlignment(SwingConstants.LEFT); + lblConnectionInfo.setBounds(304, 290, 196, 20); + contentPane.add(lblConnectionInfo); }// end LoginGUI() - //Versuche den Benutzer einzuloggen + // Versuche den Benutzer einzuloggen public void performLogin() { - // Aufruf der Ldap Klasse, welche die Ldap überprüfung vornimmt - // Ldap check=new Ldap(); - boolean login = true; - // boolean login=check.LdapAuth(username.getText(), new - // String(pass.getPassword())); + // show user, the client is doing something.. + lblConnectionInfo.setForeground(Color.red); + lblConnectionInfo.setText("Error: Server nicht erreichbar."); + + login = false; MasterThriftConnection thrift = new MasterThriftConnection(); Client client = thrift.getMasterThriftConnection(); String token = null; - final thrift.SessionData result; + thrift.SessionData result = null; try { - String passText = new String(pass.getPassword()); - System.out.println("Benutzer:" +username.getText() + "\nPasswort" + passText); - result = client.authenticate(username.getText(), passText); - SessionData.session.setAuthToken(result.authToken); - SessionData.session.setSessionID(result.sessionId); - SessionData.session.setServerAdress(result.serverAddress); - System.out.println("Server Adresse: "+result.serverAddress); - - } catch (thrift.AuthenticationException e) { - System.out.println("Authentifizierung fehlgeschlagen: " + e.message); - JOptionPane.showMessageDialog(null, - "Benutzeranmeldung fehlgeschlagen: Bitte Benutzername und Passwort überprüfen.", - "Anmeldung fehlgeschlagen", - JOptionPane.ERROR_MESSAGE); + login = true; + String passText = new String(lblpass.getPassword()); + System.out.println("Benutzer: " + lblusername.getText() + + "\nPasswort: " + passText); + + // check if server can be pinged, true if server reachable + if (checkServerConnection() == true) { + //server is reachable by ping + lblConnectionInfo.setForeground(Color.black); + lblConnectionInfo.setText("Verbindung wird aufgebaut..."); + + result = client.authenticate(lblusername.getText(), passText); + SessionData.session.setAuthToken(result.authToken); + SessionData.session.setSessionID(result.sessionId); + SessionData.session.setServerAdress(result.serverAddress); + System.out.println("Server Adresse: " + result.serverAddress); + + System.out + .println("Konnte mich beim MasterServer authentifizieren. Meine Session-ID ist " + + result.sessionId + + ", mein Token für den Satelliten " + + result.authToken); + token = result.authToken; + + if (login == true) { + + try { + Wini ini = new Wini( + new File( + "C:\\Users\\" + + System.getProperty("user.name") + + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); + // Prüfe ob Bills Of Rights schon akzeptiert wurden, wenn nicht zeige diese an + if (ini.get("main", "BillOfRights", boolean.class) == false) { + // Erstellen einer Instanz der Aktionsauswahl + BillOfRights_GUI re = new BillOfRights_GUI(); + re.setVisible(true); + // Schließen des Fensters nach erfolgreichen Login + setVisible(false); + } else { + // Prüfe ob die Links zu vmware angezeigt werden + // sollen + if (ini.get("main", "vmware", boolean.class) == false) { + VmWareLink_GUI vm = new VmWareLink_GUI(); + vm.setVisible(true); + setVisible(false); + } else { + UserInfo user = client.getUserFromToken(token); + + String hochschule = user.eMail.substring( + user.eMail.indexOf("@") + 1, + user.eMail.indexOf(".", + user.eMail.indexOf("@"))); + // System.out.println("hochschule="+hochschule); + + person.verantwortlicher.setUsername(lblusername + .getText()); + person.verantwortlicher.setName(user.lastName); + person.verantwortlicher + .setVorname(user.firstName); + person.verantwortlicher.setEMail(user.eMail); + person.verantwortlicher + .setHochschule(hochschule); + + // Öffne das Hauprmenü + MainMenue_GUI main = new MainMenue_GUI(); + main.setVisible(true); + setVisible(false); + } + } + } catch (IOException | TException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } else { + JOptionPane.showMessageDialog(null, "Login denied!", + "Message", JOptionPane.INFORMATION_MESSAGE); + } + } else { + // server not reachable by ping + login = false; + lblConnectionInfo.setForeground(Color.red); + lblConnectionInfo.setText("Error: Server nicht erreichbar."); + + } + + } catch (thrift.AuthenticationException e) { + System.out + .println("Authentifizierung fehlgeschlagen: " + e.message); + JOptionPane + .showMessageDialog( + null, + "Benutzeranmeldung fehlgeschlagen: Bitte Benutzername und Passwort überprüfen.", + "Anmeldung fehlgeschlagen", + JOptionPane.ERROR_MESSAGE); return; } catch (TException e) { // TODO Auto-generated catch block e.printStackTrace(); return; } - System.out - .println("Konnte mich beim MasterServer authentifizieren. Meine Session-ID ist " - + result.sessionId - + ", mein Token für den Satelliten " - + result.authToken); - token = result.authToken; - if (login == true) { + }// end performLogin - try { - Wini ini = new Wini(new File("C:\\Users\\" - + System.getProperty("user.name") - + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); - // Prüfe ob Bills Of Rights schon akzeptiert wurden, wenn nicht - // zeige diese an - if (ini.get("main", "BillOfRights", boolean.class) == false) { - // Erstellen einer Instanz der Aktionsauswahl - BillOfRights_GUI re = new BillOfRights_GUI(); - re.setVisible(true); - // Schließen des Fensters nach erfolgreichen Login - setVisible(false); - } else { - // Prüfe ob die Links zu vmware angezeigt werden sollen - if (ini.get("main", "vmware", boolean.class) == false) { - VmWareLink_GUI vm = new VmWareLink_GUI(); - vm.setVisible(true); - setVisible(false); - } else { - UserInfo user = client.getUserFromToken(token); - - String hochschule = user.eMail.substring(user.eMail - .indexOf("@") + 1, user.eMail.indexOf(".", - user.eMail.indexOf("@"))); - // System.out.println("hochschule="+hochschule); - - person.verantwortlicher.setUsername(username.getText()); - person.verantwortlicher.setName(user.lastName); - person.verantwortlicher.setVorname(user.firstName); - person.verantwortlicher.setEMail(user.eMail); - person.verantwortlicher.setHochschule(hochschule); - - // Öffne das Hauprmenü - MainMenue_GUI main = new MainMenue_GUI(); - main.setVisible(true); - setVisible(false); - } - } - } catch (IOException | TException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + public boolean checkServerConnection() { + try { + if (InetAddress.getByName(masterServerIP).isReachable(1000) == true) { + isConnectionToServerOK = true; + System.out.println("Server " +masterServerIP +" ist erreichbar."); + } else { + login = false; + isConnectionToServerOK = false; + System.out.println("Fehler: Server "+masterServerIP +" ist nicht erreicht"); } - - } else { - JOptionPane.showMessageDialog(null, "Login denied!", "Message", - JOptionPane.INFORMATION_MESSAGE); + } catch (UnknownHostException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); } - }// end performLogin + return isConnectionToServerOK; + }// end checkServerConnection() }// end class -- cgit v1.2.3-55-g7522 From 940ea0f1e9ad5de9e95e84dc51ac1ac6d3207fe9 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 14 Apr 2014 11:22:07 +0200 Subject: Fehlerhafte Abfrage behoben --- Dozentenmodul/bin/gui/intro/Login_GUI.class | Bin 9306 -> 9230 bytes Dozentenmodul/src/gui/intro/Login_GUI.java | 13 ++++++------- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'Dozentenmodul/src/gui/intro/Login_GUI.java') diff --git a/Dozentenmodul/bin/gui/intro/Login_GUI.class b/Dozentenmodul/bin/gui/intro/Login_GUI.class index 39a6adb3..02ba200d 100644 Binary files a/Dozentenmodul/bin/gui/intro/Login_GUI.class and b/Dozentenmodul/bin/gui/intro/Login_GUI.class differ diff --git a/Dozentenmodul/src/gui/intro/Login_GUI.java b/Dozentenmodul/src/gui/intro/Login_GUI.java index 3ff5edfd..91516fe5 100644 --- a/Dozentenmodul/src/gui/intro/Login_GUI.java +++ b/Dozentenmodul/src/gui/intro/Login_GUI.java @@ -193,7 +193,7 @@ public class Login_GUI extends JFrame { + "\nPasswort: " + passText); // check if server can be pinged, true if server reachable - if (checkServerConnection() == true) { + //if (checkServerConnection() == true) { //server is reachable by ping lblConnectionInfo.setForeground(Color.black); lblConnectionInfo.setText("Verbindung wird aufgebaut..."); @@ -267,13 +267,13 @@ public class Login_GUI extends JFrame { "Message", JOptionPane.INFORMATION_MESSAGE); } - } else { + //} else { // server not reachable by ping - login = false; - lblConnectionInfo.setForeground(Color.red); - lblConnectionInfo.setText("Error: Server nicht erreichbar."); + // login = false; + // lblConnectionInfo.setForeground(Color.red); + // lblConnectionInfo.setText("Error: Server nicht erreichbar."); - } + //} } catch (thrift.AuthenticationException e) { System.out @@ -298,7 +298,6 @@ public class Login_GUI extends JFrame { isConnectionToServerOK = true; System.out.println("Server " +masterServerIP +" ist erreichbar."); } else { - login = false; isConnectionToServerOK = false; System.out.println("Fehler: Server "+masterServerIP +" ist nicht erreicht"); } -- cgit v1.2.3-55-g7522 From dc547b8c3f743e7a2f4323cc5be996a5c806e0d5 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 14 Apr 2014 14:54:18 +0200 Subject: Check eingebaut, ob Verbindungsdaten vom Server empfangen werden --- Dozentenmodul/bin/gui/intro/Login_GUI$1.class | Bin 1106 -> 1106 bytes Dozentenmodul/bin/gui/intro/Login_GUI$2.class | Bin 665 -> 665 bytes Dozentenmodul/bin/gui/intro/Login_GUI$4.class | Bin 677 -> 677 bytes Dozentenmodul/bin/gui/intro/Login_GUI.class | Bin 9230 -> 9119 bytes .../bin/thrift/MasterThriftConnection.class | Bin 1576 -> 1647 bytes Dozentenmodul/src/gui/intro/Login_GUI.java | 74 +++++++++++---------- .../src/thrift/MasterThriftConnection.java | 7 +- 7 files changed, 45 insertions(+), 36 deletions(-) (limited to 'Dozentenmodul/src/gui/intro/Login_GUI.java') diff --git a/Dozentenmodul/bin/gui/intro/Login_GUI$1.class b/Dozentenmodul/bin/gui/intro/Login_GUI$1.class index 38603fa8..cbc73803 100644 Binary files a/Dozentenmodul/bin/gui/intro/Login_GUI$1.class and b/Dozentenmodul/bin/gui/intro/Login_GUI$1.class differ diff --git a/Dozentenmodul/bin/gui/intro/Login_GUI$2.class b/Dozentenmodul/bin/gui/intro/Login_GUI$2.class index 889fe1e3..6ecad17e 100644 Binary files a/Dozentenmodul/bin/gui/intro/Login_GUI$2.class and b/Dozentenmodul/bin/gui/intro/Login_GUI$2.class differ diff --git a/Dozentenmodul/bin/gui/intro/Login_GUI$4.class b/Dozentenmodul/bin/gui/intro/Login_GUI$4.class index 695118c3..50bfcef4 100644 Binary files a/Dozentenmodul/bin/gui/intro/Login_GUI$4.class and b/Dozentenmodul/bin/gui/intro/Login_GUI$4.class differ diff --git a/Dozentenmodul/bin/gui/intro/Login_GUI.class b/Dozentenmodul/bin/gui/intro/Login_GUI.class index 02ba200d..5beded4d 100644 Binary files a/Dozentenmodul/bin/gui/intro/Login_GUI.class and b/Dozentenmodul/bin/gui/intro/Login_GUI.class differ diff --git a/Dozentenmodul/bin/thrift/MasterThriftConnection.class b/Dozentenmodul/bin/thrift/MasterThriftConnection.class index dd76a766..fd712cf8 100644 Binary files a/Dozentenmodul/bin/thrift/MasterThriftConnection.class and b/Dozentenmodul/bin/thrift/MasterThriftConnection.class differ diff --git a/Dozentenmodul/src/gui/intro/Login_GUI.java b/Dozentenmodul/src/gui/intro/Login_GUI.java index 91516fe5..81fb223b 100644 --- a/Dozentenmodul/src/gui/intro/Login_GUI.java +++ b/Dozentenmodul/src/gui/intro/Login_GUI.java @@ -42,9 +42,12 @@ public class Login_GUI extends JFrame { private JTextField lblusername; private JPasswordField lblpass; JLabel lblConnectionInfo = new JLabel(""); - boolean isConnectionToServerOK = false; + boolean isClientReturnedCorrectly = false; boolean login; String masterServerIP = "132.230.4.16"; + MasterThriftConnection thrift; + Client client; + String token; /** * Launch the application. @@ -133,7 +136,8 @@ public class Login_GUI extends JFrame { // Erzeugen und Hinzufügen des Textfeldes lblusername = new JTextField(); - lblusername.setToolTipText("Bitte geben Sie Ihren bwIDM-Benutzernamen ein."); + lblusername + .setToolTipText("Bitte geben Sie Ihren bwIDM-Benutzernamen ein."); lblusername.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { performLogin(); @@ -180,29 +184,31 @@ public class Login_GUI extends JFrame { // show user, the client is doing something.. lblConnectionInfo.setForeground(Color.red); lblConnectionInfo.setText("Error: Server nicht erreichbar."); - + login = false; - MasterThriftConnection thrift = new MasterThriftConnection(); - Client client = thrift.getMasterThriftConnection(); - String token = null; + thrift = new MasterThriftConnection(); + client = thrift.getMasterThriftConnection(); + token = null; thrift.SessionData result = null; + try { login = true; String passText = new String(lblpass.getPassword()); System.out.println("Benutzer: " + lblusername.getText() + "\nPasswort: " + passText); - // check if server can be pinged, true if server reachable - //if (checkServerConnection() == true) { - //server is reachable by ping + // check if client has received a connection with information or a + // null package + if (checkClientPackage() == true) { + // package has information lblConnectionInfo.setForeground(Color.black); lblConnectionInfo.setText("Verbindung wird aufgebaut..."); - + result = client.authenticate(lblusername.getText(), passText); SessionData.session.setAuthToken(result.authToken); SessionData.session.setSessionID(result.sessionId); SessionData.session.setServerAdress(result.serverAddress); - System.out.println("Server Adresse: " + result.serverAddress); + System.out.println("Satellit-Adresse: " + result.serverAddress); System.out .println("Konnte mich beim MasterServer authentifizieren. Meine Session-ID ist " @@ -219,7 +225,9 @@ public class Login_GUI extends JFrame { "C:\\Users\\" + System.getProperty("user.name") + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); - // Prüfe ob Bills Of Rights schon akzeptiert wurden, wenn nicht zeige diese an + // Prüfe ob Bills Of Rights schon akzeptiert wurden, + // wenn + // nicht zeige diese an if (ini.get("main", "BillOfRights", boolean.class) == false) { // Erstellen einer Instanz der Aktionsauswahl BillOfRights_GUI re = new BillOfRights_GUI(); @@ -267,13 +275,13 @@ public class Login_GUI extends JFrame { "Message", JOptionPane.INFORMATION_MESSAGE); } - //} else { - // server not reachable by ping - // login = false; - // lblConnectionInfo.setForeground(Color.red); - // lblConnectionInfo.setText("Error: Server nicht erreichbar."); + } else { + // package from server is null + login = false; + lblConnectionInfo.setForeground(Color.red); + lblConnectionInfo.setText("Fehler: Verbindung nicht möglich."); - //} + } } catch (thrift.AuthenticationException e) { System.out @@ -292,23 +300,21 @@ public class Login_GUI extends JFrame { } }// end performLogin - public boolean checkServerConnection() { - try { - if (InetAddress.getByName(masterServerIP).isReachable(1000) == true) { - isConnectionToServerOK = true; - System.out.println("Server " +masterServerIP +" ist erreichbar."); - } else { - isConnectionToServerOK = false; - System.out.println("Fehler: Server "+masterServerIP +" ist nicht erreicht"); - } - } catch (UnknownHostException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + public boolean checkClientPackage() { + // check if client is null or has been returned with information + if (client != null) { + // client contains information + isClientReturnedCorrectly = true; + System.out.println("Server " + masterServerIP + + " ist erreichbar, Verbindungsinformationen erhalten"); + } else { + // client has returned with error + isClientReturnedCorrectly = false; + System.out.println("Fehler: Client " + masterServerIP + + " hat keine korrekten Verbindungsdaten erhalten."); } - return isConnectionToServerOK; + + return isClientReturnedCorrectly; }// end checkServerConnection() }// end class diff --git a/Dozentenmodul/src/thrift/MasterThriftConnection.java b/Dozentenmodul/src/thrift/MasterThriftConnection.java index ecbc689c..7ddbd1a5 100644 --- a/Dozentenmodul/src/thrift/MasterThriftConnection.java +++ b/Dozentenmodul/src/thrift/MasterThriftConnection.java @@ -11,7 +11,10 @@ import thrift.ImageServer.Client; public class MasterThriftConnection { - final TTransport transport = new TSocket("132.230.4.16", 9090); + + public static final String MASTERSERVERIP="132.230.4.16"; + final TTransport transport = new TSocket(MASTERSERVERIP, 9090); + public Client getMasterThriftConnection() { @@ -26,7 +29,7 @@ public class MasterThriftConnection { final Client client = new Client(protocol); - System.out.println("Der Server läuft!"); + System.out.println("\nDer Server läuft!"); return client; } -- cgit v1.2.3-55-g7522 From ba7a3b300ee0fae2ce8d294adea3d1b06b007e42 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 14 Apr 2014 15:03:16 +0200 Subject: Größe Eingabefelder geändert, Fehlermeldung präzisiert --- Dozentenmodul/bin/gui/intro/Login_GUI.class | Bin 9119 -> 9013 bytes Dozentenmodul/src/gui/intro/Login_GUI.java | 26 ++++++++++---------------- 2 files changed, 10 insertions(+), 16 deletions(-) (limited to 'Dozentenmodul/src/gui/intro/Login_GUI.java') diff --git a/Dozentenmodul/bin/gui/intro/Login_GUI.class b/Dozentenmodul/bin/gui/intro/Login_GUI.class index 5beded4d..d707d899 100644 Binary files a/Dozentenmodul/bin/gui/intro/Login_GUI.class and b/Dozentenmodul/bin/gui/intro/Login_GUI.class differ diff --git a/Dozentenmodul/src/gui/intro/Login_GUI.java b/Dozentenmodul/src/gui/intro/Login_GUI.java index 81fb223b..27b3cd18 100644 --- a/Dozentenmodul/src/gui/intro/Login_GUI.java +++ b/Dozentenmodul/src/gui/intro/Login_GUI.java @@ -44,7 +44,7 @@ public class Login_GUI extends JFrame { JLabel lblConnectionInfo = new JLabel(""); boolean isClientReturnedCorrectly = false; boolean login; - String masterServerIP = "132.230.4.16"; + String masterServerIP = MasterThriftConnection.MASTERSERVERIP; MasterThriftConnection thrift; Client client; String token; @@ -143,7 +143,7 @@ public class Login_GUI extends JFrame { performLogin(); } }); - lblusername.setBounds(304, 164, 196, 20); + lblusername.setBounds(292, 164, 237, 20); contentPane.add(lblusername); lblusername.setColumns(10); @@ -160,7 +160,7 @@ public class Login_GUI extends JFrame { }// end actionPerformed }); - BtnLogin.setBounds(304, 244, 196, 23); + BtnLogin.setBounds(292, 244, 237, 23); contentPane.add(BtnLogin); // Erzeugen und Hinzufügen des Passwortfeldes @@ -171,19 +171,16 @@ public class Login_GUI extends JFrame { performLogin(); } }); - lblpass.setBounds(304, 195, 196, 20); + lblpass.setBounds(292, 195, 237, 20); contentPane.add(lblpass); lblConnectionInfo.setHorizontalAlignment(SwingConstants.LEFT); - lblConnectionInfo.setBounds(304, 290, 196, 20); + lblConnectionInfo.setBounds(292, 290, 237, 20); contentPane.add(lblConnectionInfo); }// end LoginGUI() // Versuche den Benutzer einzuloggen public void performLogin() { - // show user, the client is doing something.. - lblConnectionInfo.setForeground(Color.red); - lblConnectionInfo.setText("Error: Server nicht erreichbar."); login = false; thrift = new MasterThriftConnection(); @@ -201,9 +198,6 @@ public class Login_GUI extends JFrame { // null package if (checkClientPackage() == true) { // package has information - lblConnectionInfo.setForeground(Color.black); - lblConnectionInfo.setText("Verbindung wird aufgebaut..."); - result = client.authenticate(lblusername.getText(), passText); SessionData.session.setAuthToken(result.authToken); SessionData.session.setSessionID(result.sessionId); @@ -279,7 +273,7 @@ public class Login_GUI extends JFrame { // package from server is null login = false; lblConnectionInfo.setForeground(Color.red); - lblConnectionInfo.setText("Fehler: Verbindung nicht möglich."); + lblConnectionInfo.setText("Fehler: Client nicht mit Server verbunden."); } @@ -305,13 +299,13 @@ public class Login_GUI extends JFrame { if (client != null) { // client contains information isClientReturnedCorrectly = true; - System.out.println("Server " + masterServerIP - + " ist erreichbar, Verbindungsinformationen erhalten"); + System.out.println("Masterserver (" + masterServerIP + + ") ist erreichbar, Verbindungsinformationen erhalten"); } else { // client has returned with error isClientReturnedCorrectly = false; - System.out.println("Fehler: Client " + masterServerIP - + " hat keine korrekten Verbindungsdaten erhalten."); + System.out.println("Fehler: Client hat von Masterserver (" + masterServerIP + + ") hat keine korrekten Verbindungsdaten erhalten."); } return isClientReturnedCorrectly; -- cgit v1.2.3-55-g7522 From a751709ab1ca2e35a5e2ab6996d00604bbe07f6d Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 14 Apr 2014 16:02:29 +0200 Subject: GUI-Texte angepasst --- .../bin/gui/image/CreateImageAllgemein_GUI.class | Bin 7800 -> 7817 bytes .../bin/gui/image/CreateImageTechnisch_GUI.class | Bin 8788 -> 8784 bytes .../bin/gui/image/EditImageAllgemein_GUI.class | Bin 9112 -> 9131 bytes .../bin/gui/image/EditImageTechnisch_GUI.class | Bin 8511 -> 8510 bytes .../bin/gui/image/FTPCreateUploader_GUI.class | Bin 12312 -> 12329 bytes .../bin/gui/image/FTPDownloader_GUI.class | Bin 9974 -> 10017 bytes .../bin/gui/image/FTPEditUploader_GUI.class | Bin 11868 -> 11887 bytes .../bin/gui/image/SearchEditImage_GUI$1.class | Bin 1094 -> 1094 bytes .../bin/gui/image/SearchEditImage_GUI$2.class | Bin 1301 -> 1301 bytes .../bin/gui/image/SearchEditImage_GUI$3.class | Bin 951 -> 951 bytes .../bin/gui/image/SearchEditImage_GUI$4.class | Bin 1298 -> 1298 bytes .../bin/gui/image/SearchEditImage_GUI$5.class | Bin 938 -> 938 bytes .../bin/gui/image/SearchEditImage_GUI$6.class | Bin 1771 -> 1771 bytes .../bin/gui/image/SearchEditImage_GUI$7.class | Bin 1941 -> 1941 bytes .../bin/gui/image/SearchEditImage_GUI$8.class | Bin 980 -> 980 bytes .../bin/gui/image/SearchEditImage_GUI$9.class | Bin 2177 -> 2177 bytes .../bin/gui/image/SearchEditImage_GUI.class | Bin 11743 -> 11762 bytes .../bin/gui/image/SearchImage_GUI$1.class | Bin 704 -> 1066 bytes .../bin/gui/image/SearchImage_GUI$2.class | Bin 1273 -> 1273 bytes .../bin/gui/image/SearchImage_GUI$3.class | Bin 806 -> 927 bytes .../bin/gui/image/SearchImage_GUI$4.class | Bin 1274 -> 1274 bytes .../bin/gui/image/SearchImage_GUI$5.class | Bin 793 -> 914 bytes .../bin/gui/image/SearchImage_GUI$6.class | Bin 1354 -> 1747 bytes .../bin/gui/image/SearchImage_GUI$7.class | Bin 832 -> 1917 bytes .../bin/gui/image/SearchImage_GUI$8.class | Bin 835 -> 956 bytes .../bin/gui/image/SearchImage_GUI$9.class | Bin 972 -> 0 bytes Dozentenmodul/bin/gui/image/SearchImage_GUI.class | Bin 11812 -> 11552 bytes Dozentenmodul/bin/gui/intro/Login_GUI$1.class | Bin 1106 -> 1106 bytes Dozentenmodul/bin/gui/intro/Login_GUI$2.class | Bin 665 -> 665 bytes Dozentenmodul/bin/gui/intro/Login_GUI$4.class | Bin 677 -> 677 bytes Dozentenmodul/bin/gui/intro/Login_GUI.class | Bin 9013 -> 9013 bytes Dozentenmodul/bin/gui/intro/MainMenue_GUI$1.class | Bin 692 -> 692 bytes Dozentenmodul/bin/gui/intro/MainMenue_GUI$10.class | Bin 1928 -> 1967 bytes Dozentenmodul/bin/gui/intro/MainMenue_GUI.class | Bin 10296 -> 10297 bytes .../gui/lecture/CreateLectureAllgemein_GUI.class | Bin 10794 -> 10819 bytes .../bin/gui/lecture/EditLectureAllgemein_GUI.class | Bin 9977 -> 10004 bytes .../gui/lecture/ExtendedSearchForImages_GUI.class | Bin 6486 -> 6505 bytes .../gui/lecture/SearchMethodLecture_GUI$1.class | Bin 762 -> 0 bytes .../gui/lecture/SearchMethodLecture_GUI$2.class | Bin 851 -> 0 bytes .../gui/lecture/SearchMethodLecture_GUI$3.class | Bin 891 -> 0 bytes .../gui/lecture/SearchMethodLecture_GUI$4.class | Bin 1059 -> 0 bytes .../bin/gui/lecture/SearchMethodLecture_GUI.class | Bin 7022 -> 0 bytes .../src/gui/image/CreateImageAllgemein_GUI.java | 2 +- .../src/gui/image/CreateImageTechnisch_GUI.java | 6 +- .../src/gui/image/EditImageAllgemein_GUI.java | 2 +- .../src/gui/image/EditImageTechnisch_GUI.java | 6 +- .../src/gui/image/FTPCreateUploader_GUI.java | 2 +- Dozentenmodul/src/gui/image/FTPDownloader_GUI.java | 24 +- .../src/gui/image/FTPEditUploader_GUI.java | 2 +- .../src/gui/image/SearchEditImage_GUI.java | 3 +- Dozentenmodul/src/gui/image/SearchImage_GUI.java | 121 +++--- .../src/gui/image/SearchImage_GUI_alt.java | 459 +++++++++++++++++++++ .../src/gui/image/SearchMethodLecture_GUI.java | 251 +++++++++++ Dozentenmodul/src/gui/intro/Login_GUI.java | 2 - Dozentenmodul/src/gui/intro/MainMenue_GUI.java | 97 +++-- .../gui/lecture/CreateLectureAllgemein_GUI.java | 2 +- .../src/gui/lecture/CreateLectureLink_GUI.java | 4 +- .../src/gui/lecture/EditLectureAllgemein_GUI.java | 2 +- .../src/gui/lecture/EditLectureLink_GUI.java | 4 +- .../src/gui/lecture/EditLectureSearch_GUI.java | 3 +- .../gui/lecture/ExtendedSearchForImages_GUI.java | 2 +- .../src/gui/lecture/SearchLecture_GUI.java | 405 ++++++++++++++++++ .../src/gui/lecture/SearchMethodLecture_GUI.java | 246 ----------- 63 files changed, 1268 insertions(+), 377 deletions(-) delete mode 100644 Dozentenmodul/bin/gui/image/SearchImage_GUI$9.class delete mode 100644 Dozentenmodul/bin/gui/lecture/SearchMethodLecture_GUI$1.class delete mode 100644 Dozentenmodul/bin/gui/lecture/SearchMethodLecture_GUI$2.class delete mode 100644 Dozentenmodul/bin/gui/lecture/SearchMethodLecture_GUI$3.class delete mode 100644 Dozentenmodul/bin/gui/lecture/SearchMethodLecture_GUI$4.class delete mode 100644 Dozentenmodul/bin/gui/lecture/SearchMethodLecture_GUI.class create mode 100644 Dozentenmodul/src/gui/image/SearchImage_GUI_alt.java create mode 100644 Dozentenmodul/src/gui/image/SearchMethodLecture_GUI.java create mode 100644 Dozentenmodul/src/gui/lecture/SearchLecture_GUI.java delete mode 100644 Dozentenmodul/src/gui/lecture/SearchMethodLecture_GUI.java (limited to 'Dozentenmodul/src/gui/intro/Login_GUI.java') diff --git a/Dozentenmodul/bin/gui/image/CreateImageAllgemein_GUI.class b/Dozentenmodul/bin/gui/image/CreateImageAllgemein_GUI.class index c14c26e5..60d254b9 100644 Binary files a/Dozentenmodul/bin/gui/image/CreateImageAllgemein_GUI.class and b/Dozentenmodul/bin/gui/image/CreateImageAllgemein_GUI.class differ diff --git a/Dozentenmodul/bin/gui/image/CreateImageTechnisch_GUI.class b/Dozentenmodul/bin/gui/image/CreateImageTechnisch_GUI.class index 2e49913b..6fa84ba9 100644 Binary files a/Dozentenmodul/bin/gui/image/CreateImageTechnisch_GUI.class and b/Dozentenmodul/bin/gui/image/CreateImageTechnisch_GUI.class differ diff --git a/Dozentenmodul/bin/gui/image/EditImageAllgemein_GUI.class b/Dozentenmodul/bin/gui/image/EditImageAllgemein_GUI.class index c0b072cf..75dbaaf3 100644 Binary files a/Dozentenmodul/bin/gui/image/EditImageAllgemein_GUI.class and b/Dozentenmodul/bin/gui/image/EditImageAllgemein_GUI.class differ diff --git a/Dozentenmodul/bin/gui/image/EditImageTechnisch_GUI.class b/Dozentenmodul/bin/gui/image/EditImageTechnisch_GUI.class index edcd12d8..7b09a9c7 100644 Binary files a/Dozentenmodul/bin/gui/image/EditImageTechnisch_GUI.class and b/Dozentenmodul/bin/gui/image/EditImageTechnisch_GUI.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class index 785ecb6b..e933f11b 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class and b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI.class b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI.class index dca740f2..b93f9f90 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI.class and b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI.class b/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI.class index d3571c94..4a557c2e 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI.class and b/Dozentenmodul/bin/gui/image/FTPEditUploader_GUI.class differ diff --git a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$1.class b/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$1.class index 9e30be11..56f4b278 100644 Binary files a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$1.class and b/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$1.class differ diff --git a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$2.class b/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$2.class index ff02ba32..7b7a41f8 100644 Binary files a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$2.class and b/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$2.class differ diff --git a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$3.class b/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$3.class index 5b3e93a0..0715d19e 100644 Binary files a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$3.class and b/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$3.class differ diff --git a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$4.class b/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$4.class index e0ebd234..6514ae56 100644 Binary files a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$4.class and b/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$4.class differ diff --git a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$5.class b/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$5.class index f0cfc5da..12325d18 100644 Binary files a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$5.class and b/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$5.class differ diff --git a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$6.class b/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$6.class index b6600cc8..0f16c43d 100644 Binary files a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$6.class and b/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$6.class differ diff --git a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$7.class b/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$7.class index 772ed400..70809568 100644 Binary files a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$7.class and b/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$7.class differ diff --git a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$8.class b/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$8.class index ffde361f..f8ac881a 100644 Binary files a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$8.class and b/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$8.class differ diff --git a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$9.class b/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$9.class index e2b34c9a..2357c0ec 100644 Binary files a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$9.class and b/Dozentenmodul/bin/gui/image/SearchEditImage_GUI$9.class differ diff --git a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI.class b/Dozentenmodul/bin/gui/image/SearchEditImage_GUI.class index 264f9d4a..2725d84c 100644 Binary files a/Dozentenmodul/bin/gui/image/SearchEditImage_GUI.class and b/Dozentenmodul/bin/gui/image/SearchEditImage_GUI.class differ diff --git a/Dozentenmodul/bin/gui/image/SearchImage_GUI$1.class b/Dozentenmodul/bin/gui/image/SearchImage_GUI$1.class index 8dbd7362..18f964fe 100644 Binary files a/Dozentenmodul/bin/gui/image/SearchImage_GUI$1.class and b/Dozentenmodul/bin/gui/image/SearchImage_GUI$1.class differ diff --git a/Dozentenmodul/bin/gui/image/SearchImage_GUI$2.class b/Dozentenmodul/bin/gui/image/SearchImage_GUI$2.class index 7c32f943..2aff1b68 100644 Binary files a/Dozentenmodul/bin/gui/image/SearchImage_GUI$2.class and b/Dozentenmodul/bin/gui/image/SearchImage_GUI$2.class differ diff --git a/Dozentenmodul/bin/gui/image/SearchImage_GUI$3.class b/Dozentenmodul/bin/gui/image/SearchImage_GUI$3.class index 5b8f3f8b..8c3cee86 100644 Binary files a/Dozentenmodul/bin/gui/image/SearchImage_GUI$3.class and b/Dozentenmodul/bin/gui/image/SearchImage_GUI$3.class differ diff --git a/Dozentenmodul/bin/gui/image/SearchImage_GUI$4.class b/Dozentenmodul/bin/gui/image/SearchImage_GUI$4.class index f842a022..5d5e2cfd 100644 Binary files a/Dozentenmodul/bin/gui/image/SearchImage_GUI$4.class and b/Dozentenmodul/bin/gui/image/SearchImage_GUI$4.class differ diff --git a/Dozentenmodul/bin/gui/image/SearchImage_GUI$5.class b/Dozentenmodul/bin/gui/image/SearchImage_GUI$5.class index 2452046f..7e564db6 100644 Binary files a/Dozentenmodul/bin/gui/image/SearchImage_GUI$5.class and b/Dozentenmodul/bin/gui/image/SearchImage_GUI$5.class differ diff --git a/Dozentenmodul/bin/gui/image/SearchImage_GUI$6.class b/Dozentenmodul/bin/gui/image/SearchImage_GUI$6.class index eff43b91..1138b2dc 100644 Binary files a/Dozentenmodul/bin/gui/image/SearchImage_GUI$6.class and b/Dozentenmodul/bin/gui/image/SearchImage_GUI$6.class differ diff --git a/Dozentenmodul/bin/gui/image/SearchImage_GUI$7.class b/Dozentenmodul/bin/gui/image/SearchImage_GUI$7.class index 8b9f3286..6618191d 100644 Binary files a/Dozentenmodul/bin/gui/image/SearchImage_GUI$7.class and b/Dozentenmodul/bin/gui/image/SearchImage_GUI$7.class differ diff --git a/Dozentenmodul/bin/gui/image/SearchImage_GUI$8.class b/Dozentenmodul/bin/gui/image/SearchImage_GUI$8.class index a5ff7a18..9096233b 100644 Binary files a/Dozentenmodul/bin/gui/image/SearchImage_GUI$8.class and b/Dozentenmodul/bin/gui/image/SearchImage_GUI$8.class differ diff --git a/Dozentenmodul/bin/gui/image/SearchImage_GUI$9.class b/Dozentenmodul/bin/gui/image/SearchImage_GUI$9.class deleted file mode 100644 index e5ad916e..00000000 Binary files a/Dozentenmodul/bin/gui/image/SearchImage_GUI$9.class and /dev/null differ diff --git a/Dozentenmodul/bin/gui/image/SearchImage_GUI.class b/Dozentenmodul/bin/gui/image/SearchImage_GUI.class index fdefc8b5..6244e1eb 100644 Binary files a/Dozentenmodul/bin/gui/image/SearchImage_GUI.class and b/Dozentenmodul/bin/gui/image/SearchImage_GUI.class differ diff --git a/Dozentenmodul/bin/gui/intro/Login_GUI$1.class b/Dozentenmodul/bin/gui/intro/Login_GUI$1.class index cbc73803..b06e1848 100644 Binary files a/Dozentenmodul/bin/gui/intro/Login_GUI$1.class and b/Dozentenmodul/bin/gui/intro/Login_GUI$1.class differ diff --git a/Dozentenmodul/bin/gui/intro/Login_GUI$2.class b/Dozentenmodul/bin/gui/intro/Login_GUI$2.class index 6ecad17e..beaa50e5 100644 Binary files a/Dozentenmodul/bin/gui/intro/Login_GUI$2.class and b/Dozentenmodul/bin/gui/intro/Login_GUI$2.class differ diff --git a/Dozentenmodul/bin/gui/intro/Login_GUI$4.class b/Dozentenmodul/bin/gui/intro/Login_GUI$4.class index 50bfcef4..75e8282e 100644 Binary files a/Dozentenmodul/bin/gui/intro/Login_GUI$4.class and b/Dozentenmodul/bin/gui/intro/Login_GUI$4.class differ diff --git a/Dozentenmodul/bin/gui/intro/Login_GUI.class b/Dozentenmodul/bin/gui/intro/Login_GUI.class index d707d899..0d712499 100644 Binary files a/Dozentenmodul/bin/gui/intro/Login_GUI.class and b/Dozentenmodul/bin/gui/intro/Login_GUI.class differ diff --git a/Dozentenmodul/bin/gui/intro/MainMenue_GUI$1.class b/Dozentenmodul/bin/gui/intro/MainMenue_GUI$1.class index 59f25618..a6abdea4 100644 Binary files a/Dozentenmodul/bin/gui/intro/MainMenue_GUI$1.class and b/Dozentenmodul/bin/gui/intro/MainMenue_GUI$1.class differ diff --git a/Dozentenmodul/bin/gui/intro/MainMenue_GUI$10.class b/Dozentenmodul/bin/gui/intro/MainMenue_GUI$10.class index 76da6ffd..f5dd77e7 100644 Binary files a/Dozentenmodul/bin/gui/intro/MainMenue_GUI$10.class and b/Dozentenmodul/bin/gui/intro/MainMenue_GUI$10.class differ diff --git a/Dozentenmodul/bin/gui/intro/MainMenue_GUI.class b/Dozentenmodul/bin/gui/intro/MainMenue_GUI.class index d9838839..44b3e14d 100644 Binary files a/Dozentenmodul/bin/gui/intro/MainMenue_GUI.class and b/Dozentenmodul/bin/gui/intro/MainMenue_GUI.class differ diff --git a/Dozentenmodul/bin/gui/lecture/CreateLectureAllgemein_GUI.class b/Dozentenmodul/bin/gui/lecture/CreateLectureAllgemein_GUI.class index 031b69b7..58677633 100644 Binary files a/Dozentenmodul/bin/gui/lecture/CreateLectureAllgemein_GUI.class and b/Dozentenmodul/bin/gui/lecture/CreateLectureAllgemein_GUI.class differ diff --git a/Dozentenmodul/bin/gui/lecture/EditLectureAllgemein_GUI.class b/Dozentenmodul/bin/gui/lecture/EditLectureAllgemein_GUI.class index 83d7cf3e..81bbec82 100644 Binary files a/Dozentenmodul/bin/gui/lecture/EditLectureAllgemein_GUI.class and b/Dozentenmodul/bin/gui/lecture/EditLectureAllgemein_GUI.class differ diff --git a/Dozentenmodul/bin/gui/lecture/ExtendedSearchForImages_GUI.class b/Dozentenmodul/bin/gui/lecture/ExtendedSearchForImages_GUI.class index 665f51d1..14d5f97e 100644 Binary files a/Dozentenmodul/bin/gui/lecture/ExtendedSearchForImages_GUI.class and b/Dozentenmodul/bin/gui/lecture/ExtendedSearchForImages_GUI.class differ diff --git a/Dozentenmodul/bin/gui/lecture/SearchMethodLecture_GUI$1.class b/Dozentenmodul/bin/gui/lecture/SearchMethodLecture_GUI$1.class deleted file mode 100644 index b8590387..00000000 Binary files a/Dozentenmodul/bin/gui/lecture/SearchMethodLecture_GUI$1.class and /dev/null differ diff --git a/Dozentenmodul/bin/gui/lecture/SearchMethodLecture_GUI$2.class b/Dozentenmodul/bin/gui/lecture/SearchMethodLecture_GUI$2.class deleted file mode 100644 index 975fb7c1..00000000 Binary files a/Dozentenmodul/bin/gui/lecture/SearchMethodLecture_GUI$2.class and /dev/null differ diff --git a/Dozentenmodul/bin/gui/lecture/SearchMethodLecture_GUI$3.class b/Dozentenmodul/bin/gui/lecture/SearchMethodLecture_GUI$3.class deleted file mode 100644 index 9d4fc780..00000000 Binary files a/Dozentenmodul/bin/gui/lecture/SearchMethodLecture_GUI$3.class and /dev/null differ diff --git a/Dozentenmodul/bin/gui/lecture/SearchMethodLecture_GUI$4.class b/Dozentenmodul/bin/gui/lecture/SearchMethodLecture_GUI$4.class deleted file mode 100644 index 46f15114..00000000 Binary files a/Dozentenmodul/bin/gui/lecture/SearchMethodLecture_GUI$4.class and /dev/null differ diff --git a/Dozentenmodul/bin/gui/lecture/SearchMethodLecture_GUI.class b/Dozentenmodul/bin/gui/lecture/SearchMethodLecture_GUI.class deleted file mode 100644 index 92a6a519..00000000 Binary files a/Dozentenmodul/bin/gui/lecture/SearchMethodLecture_GUI.class and /dev/null differ diff --git a/Dozentenmodul/src/gui/image/CreateImageAllgemein_GUI.java b/Dozentenmodul/src/gui/image/CreateImageAllgemein_GUI.java index bf1d0230..63483e3d 100644 --- a/Dozentenmodul/src/gui/image/CreateImageAllgemein_GUI.java +++ b/Dozentenmodul/src/gui/image/CreateImageAllgemein_GUI.java @@ -75,7 +75,7 @@ public class CreateImageAllgemein_GUI extends JFrame { e.printStackTrace(); } //Setzt den Titel - setTitle("bwLehrpool Suite *Prototyp*"); + setTitle("bwLehrpool Suite *Prototyp* - Image erzeugen"); //Zentriert das Fenster Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); int top=(screenSize.height - 722) / 2; diff --git a/Dozentenmodul/src/gui/image/CreateImageTechnisch_GUI.java b/Dozentenmodul/src/gui/image/CreateImageTechnisch_GUI.java index e9d2d91a..cf71082c 100644 --- a/Dozentenmodul/src/gui/image/CreateImageTechnisch_GUI.java +++ b/Dozentenmodul/src/gui/image/CreateImageTechnisch_GUI.java @@ -82,7 +82,7 @@ public class CreateImageTechnisch_GUI extends JFrame { // TODO Auto-generated catch block e.printStackTrace(); } - setTitle("bwLehrpool Suite *Prototyp*"); + setTitle("bwLehrpool Suite *Prototyp* - Image erzeugen"); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); int top=(screenSize.height - 722) / 2; int left=(screenSize.width - 603) / 2; @@ -96,7 +96,7 @@ public class CreateImageTechnisch_GUI extends JFrame { getContentPane().add(panel); panel.setLayout(null); { - JLabel lblNewLabel = new JLabel("Eingabe Ihrer Daten"); + JLabel lblNewLabel = new JLabel("Eingabe technischer Daten"); lblNewLabel.setBounds(10, 11, 509, 22); panel.add(lblNewLabel); lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); @@ -105,7 +105,7 @@ public class CreateImageTechnisch_GUI extends JFrame { JTextPane txtpnBitteWhlenSie = new JTextPane(); txtpnBitteWhlenSie.setEditable(false); txtpnBitteWhlenSie.setBackground(SystemColor.menu); - txtpnBitteWhlenSie.setText("Geben Sie hier bitte einen sprechenden Imagename sowie Ihre Kontaktdaten an"); + txtpnBitteWhlenSie.setText("Geben Sie hier bitte einige technische Daten ein"); txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); panel.add(txtpnBitteWhlenSie); } diff --git a/Dozentenmodul/src/gui/image/EditImageAllgemein_GUI.java b/Dozentenmodul/src/gui/image/EditImageAllgemein_GUI.java index b80e4953..e5dc45c7 100644 --- a/Dozentenmodul/src/gui/image/EditImageAllgemein_GUI.java +++ b/Dozentenmodul/src/gui/image/EditImageAllgemein_GUI.java @@ -79,7 +79,7 @@ public class EditImageAllgemein_GUI extends JFrame { e.printStackTrace(); } //Setzt den Fenstertitel - setTitle("bwLehrpool Suite *Prototyp*"); + setTitle("bwLehrpool Suite *Prototyp* - Image bearbeiten"); //Zentriert das Fenster in der Bildmitte Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); diff --git a/Dozentenmodul/src/gui/image/EditImageTechnisch_GUI.java b/Dozentenmodul/src/gui/image/EditImageTechnisch_GUI.java index 7d9de383..631e3c2d 100644 --- a/Dozentenmodul/src/gui/image/EditImageTechnisch_GUI.java +++ b/Dozentenmodul/src/gui/image/EditImageTechnisch_GUI.java @@ -73,7 +73,7 @@ public class EditImageTechnisch_GUI extends JFrame { e.printStackTrace(); } // Setzt den Titel des Fensters - setTitle("bwLehrpool Suite *Prototyp*"); + setTitle("bwLehrpool Suite *Prototyp* - Image bearbeiten"); // Zentriert das Fenster Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); int top = (screenSize.height - 722) / 2; @@ -88,7 +88,7 @@ public class EditImageTechnisch_GUI extends JFrame { getContentPane().add(panel); panel.setLayout(null); { - JLabel lblNewLabel = new JLabel("Eingabe Ihrer Daten"); + JLabel lblNewLabel = new JLabel("Eingabe technischer Daten"); lblNewLabel.setBounds(10, 11, 509, 22); panel.add(lblNewLabel); lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); @@ -98,7 +98,7 @@ public class EditImageTechnisch_GUI extends JFrame { txtpnBitteWhlenSie.setEditable(false); txtpnBitteWhlenSie.setBackground(SystemColor.menu); txtpnBitteWhlenSie - .setText("Geben Sie hier bitte einen sprechenden Imagename sowie Ihre Kontaktdaten an"); + .setText("Geben Sie hier bitte einige technische Daten ein."); txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); panel.add(txtpnBitteWhlenSie); } diff --git a/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java b/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java index 1bf8cc3a..1777e27d 100644 --- a/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java +++ b/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java @@ -121,7 +121,7 @@ public class FTPCreateUploader_GUI extends JFrame implements // filename=name; setBackground(Color.WHITE); - setTitle("Dozentenmodul *Prototyp*"); + setTitle("Dozentenmodul *Prototyp* - Image erzeugen"); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); int top = (screenSize.height - 722) / 2; int left = (screenSize.width - 603) / 2; diff --git a/Dozentenmodul/src/gui/image/FTPDownloader_GUI.java b/Dozentenmodul/src/gui/image/FTPDownloader_GUI.java index d0f789f4..9c6b2892 100644 --- a/Dozentenmodul/src/gui/image/FTPDownloader_GUI.java +++ b/Dozentenmodul/src/gui/image/FTPDownloader_GUI.java @@ -100,7 +100,7 @@ public class FTPDownloader_GUI extends JFrame implements PropertyChangeListener } setBackground(Color.WHITE); - setTitle("Dozentenmodul *Prototyp*"); + setTitle("Dozentenmodul *Prototyp* - Image herunterladen"); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); int top = (screenSize.height - 722) / 2; int left = (screenSize.width - 603) / 2; @@ -217,17 +217,17 @@ public class FTPDownloader_GUI extends JFrame implements PropertyChangeListener panel.setBounds(10, 11, 577, 57); contentPanel.add(panel); - JLabel label = new JLabel("Eingabe Ihrer Daten"); - label.setFont(new Font("Tahoma", Font.BOLD, 18)); - label.setBounds(10, 11, 509, 22); - panel.add(label); - - JTextPane textPane = new JTextPane(); - textPane.setText("Geben Sie hier bitte einen sprechenden Imagename sowie Ihre Kontaktdaten an"); - textPane.setEditable(false); - textPane.setBackground(SystemColor.menu); - textPane.setBounds(10, 36, 509, 32); - panel.add(textPane); + JLabel lblImageDownloader = new JLabel("Image Downloader"); + lblImageDownloader.setFont(new Font("Tahoma", Font.BOLD, 18)); + lblImageDownloader.setBounds(10, 11, 509, 22); + panel.add(lblImageDownloader); + + JTextPane txtpnWhlenSieEinen = new JTextPane(); + txtpnWhlenSieEinen.setText("W\u00E4hlen Sie einen Ort aus, um das von Ihnen gw\u00E4hlte Image erunter zu laden."); + txtpnWhlenSieEinen.setEditable(false); + txtpnWhlenSieEinen.setBackground(SystemColor.menu); + txtpnWhlenSieEinen.setBounds(10, 36, 509, 32); + panel.add(txtpnWhlenSieEinen); JSeparator separator = new JSeparator(); separator.setBounds(0, 79, 597, 2); diff --git a/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java b/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java index b184c96c..b1415ef9 100644 --- a/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java +++ b/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java @@ -124,7 +124,7 @@ public class FTPEditUploader_GUI extends JFrame implements // filename=name; setBackground(Color.WHITE); - setTitle("Dozentenmodul *Prototyp*"); + setTitle("Dozentenmodul *Prototyp* - Image bearbeiten"); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); int top = (screenSize.height - 722) / 2; int left = (screenSize.width - 603) / 2; diff --git a/Dozentenmodul/src/gui/image/SearchEditImage_GUI.java b/Dozentenmodul/src/gui/image/SearchEditImage_GUI.java index e6bb055e..c54e0b66 100644 --- a/Dozentenmodul/src/gui/image/SearchEditImage_GUI.java +++ b/Dozentenmodul/src/gui/image/SearchEditImage_GUI.java @@ -2,7 +2,6 @@ package gui.image; import gui.intro.MainMenue_GUI; import gui.lecture.ExtendedSearchForImages_GUI; - import java.awt.Color; import java.awt.Dimension; import java.awt.FlowLayout; @@ -115,7 +114,7 @@ public class SearchEditImage_GUI extends JFrame { e.printStackTrace(); } // Setzt den Fenstertitel - setTitle("bwLehrpool Suite *Prototyp*"); + setTitle("bwLehrpool Suite *Prototyp* - Image bearbeiten"); // Zentriert das Fenster in die Bildmitte Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); int top = (screenSize.height - 722) / 2; diff --git a/Dozentenmodul/src/gui/image/SearchImage_GUI.java b/Dozentenmodul/src/gui/image/SearchImage_GUI.java index 493230d3..03b0f136 100644 --- a/Dozentenmodul/src/gui/image/SearchImage_GUI.java +++ b/Dozentenmodul/src/gui/image/SearchImage_GUI.java @@ -20,12 +20,12 @@ import java.util.Iterator; import java.util.List; import javax.swing.JButton; import javax.swing.JComboBox; -import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; +import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JRadioButton; import javax.swing.JScrollPane; @@ -44,6 +44,9 @@ import javax.swing.event.ChangeListener; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableModel; import javax.swing.table.TableRowSorter; +import models.Image; +import models.person; +//import models.person; import org.apache.thrift.TException; @@ -63,7 +66,7 @@ public class SearchImage_GUI extends JFrame { private JTextField textFieldName; JTabbedPane tabbedPane; String[] titles = { "Image-Name", "Lizenzpflichtig", "OS", "Veranstaltung", - "Verantwortlicher", "Letztes Update", "Schlagwort" }; + "Verantwortlicher", "Letztes Update", "Schlagwort", "ID", "Version" }; ThriftConnection con = new ThriftConnection(); Client client = con.getThriftConnection(); final DefaultTableModel modelAll = new DefaultTableModel(titles, 0); @@ -75,16 +78,12 @@ public class SearchImage_GUI extends JFrame { /** * Launch the application. + * + * public static void main(String[] args) { try { SearchEditImage_GUI dialog + * = new SearchEditImage_GUI(); + * dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + * dialog.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } */ - public static void main(String[] args) { - try { - SearchImage_GUI dialog = new SearchImage_GUI(); - dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); - dialog.setVisible(true); - } catch (Exception e) { - e.printStackTrace(); - } - } /** * Create the dialog. @@ -94,8 +93,14 @@ public class SearchImage_GUI extends JFrame { @Override public void windowClosing(WindowEvent arg0) { // Beendet die Anwendung nach klick auf X + con.closeThriftConnection(); System.exit(0); } + + @Override + public void windowOpened(WindowEvent arg0) { + textFieldName.requestFocusInWindow(); + } }); // Verhindert das Vergrößern Des Fensters setResizable(false); @@ -109,7 +114,7 @@ public class SearchImage_GUI extends JFrame { e.printStackTrace(); } // Setzt den Fenstertitel - setTitle("bwLehrpool Suite *Prototyp*"); + setTitle("bwLehrpool Suite *Prototyp* - Suche VL-Image"); // Zentriert das Fenster in die Bildmitte Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); int top = (screenSize.height - 722) / 2; @@ -192,6 +197,7 @@ public class SearchImage_GUI extends JFrame { @Override public void mouseClicked(MouseEvent arg0) { // Öffnet das Fenster Extended GUI + con.closeThriftConnection(); ExtendedSearchForImages_GUI es = new ExtendedSearchForImages_GUI(); es.setVisible(true); } @@ -237,6 +243,7 @@ public class SearchImage_GUI extends JFrame { @Override public void mouseClicked(MouseEvent arg0) { // Öffnet das Hauütmenü + con.closeThriftConnection(); SearchImage_GUI.this.setVisible(false); MainMenue_GUI main = new MainMenue_GUI(); main.setVisible(true); @@ -269,11 +276,13 @@ public class SearchImage_GUI extends JFrame { System.out.println(tabbedPane.getSelectedIndex()); if (tabbedPane.getSelectedIndex() == 0) { - } else if (tabbedPane.getSelectedIndex() == 1) { - String username = "Spitzer Tobias"; + String username = person.verantwortlicher.getName() + " " + + person.verantwortlicher.getVorname(); + // String username="Spitzer Tobias"; rowSorterMyImages.setRowFilter(RowFilter.regexFilter( username, 4)); - // rowSorterMyImages.toggleSortOrder(0); + } else if (tabbedPane.getSelectedIndex() == 1) { + } } @@ -281,17 +290,7 @@ public class SearchImage_GUI extends JFrame { tabbedPane.setBounds(10, 197, 557, 300); contentPanel.add(tabbedPane); - - JScrollPane scrollPaneMyImage = new JScrollPane(); - tablemyImages = new JTable(); - tablemyImages.setModel(modelMyImages); - tablemyImages.getColumnModel().getColumn(1).sizeWidthToFit(); - tablemyImages.getColumnModel().getColumn(2).sizeWidthToFit(); - tablemyImages.getColumnModel().getColumn(3).sizeWidthToFit(); - tablemyImages.getColumnModel().getColumn(4).sizeWidthToFit(); - tablemyImages.getColumnModel().getColumn(5).sizeWidthToFit(); initTableModel(modelMyImages); - tablemyImages.setRowSorter(rowSorterMyImages); JScrollPane scrollPaneAllImages = new JScrollPane(); tableAllImages = new JTable(); @@ -302,13 +301,23 @@ public class SearchImage_GUI extends JFrame { tableAllImages.getColumnModel().getColumn(4).sizeWidthToFit(); tableAllImages.getColumnModel().getColumn(5).sizeWidthToFit(); initTableModel(modelAll); - tableAllImages.setRowSorter(rowSorterAll); - scrollPaneAllImages.setViewportView(tableAllImages); - tabbedPane.addTab("Alle", null, scrollPaneAllImages, null); + JScrollPane scrollPaneMyImage = new JScrollPane(); + tablemyImages = new JTable(); + tablemyImages.setModel(modelMyImages); + tablemyImages.getColumnModel().getColumn(1).sizeWidthToFit(); + tablemyImages.getColumnModel().getColumn(2).sizeWidthToFit(); + tablemyImages.getColumnModel().getColumn(3).sizeWidthToFit(); + tablemyImages.getColumnModel().getColumn(4).sizeWidthToFit(); + tablemyImages.getColumnModel().getColumn(5).sizeWidthToFit(); + tablemyImages.setRowSorter(rowSorterMyImages); scrollPaneMyImage.setViewportView(tablemyImages); tabbedPane.addTab("Meine Images", null, scrollPaneMyImage, null); + tableAllImages.setRowSorter(rowSorterAll); + + scrollPaneAllImages.setViewportView(tableAllImages); + tabbedPane.addTab("Alle", null, scrollPaneAllImages, null); JScrollPane scrollPaneCoopImages = new JScrollPane(); JTable tableCoopImages = new JTable(); @@ -356,9 +365,28 @@ public class SearchImage_GUI extends JFrame { btnDownload.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { // Öffnet den Downloader - FTPDownloader_GUI down = new FTPDownloader_GUI(); - down.setVisible(true); - SearchImage_GUI.this.setVisible(false); + + if (tablemyImages.getSelectedRow() != -1) { + String imageid = modelMyImages.getValueAt( + tablemyImages.convertRowIndexToModel(tablemyImages + .getSelectedRow()), 7).toString(); + + Image.image.setImageId(imageid); + String imageversion = modelMyImages.getValueAt( + tablemyImages.convertRowIndexToModel(tablemyImages + .getSelectedRow()), 8).toString(); + + Image.image.setVersion(imageversion); + SearchImage_GUI.this.setVisible(false); + FTPDownloader_GUI down = new FTPDownloader_GUI(); + down.setVisible(true); + con.closeThriftConnection(); + + } else { + JOptionPane.showMessageDialog(null, + "Bitte wählen Sie ein Image für den Download aus", + "Message", JOptionPane.INFORMATION_MESSAGE); + } } }); btnDownload.setBounds(449, 508, 118, 23); @@ -370,33 +398,19 @@ public class SearchImage_GUI extends JFrame { buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); getContentPane().add(buttonPane); { - JButton cancelButton = new JButton("Zur\u00FCck"); - cancelButton.addActionListener(new ActionListener() { + JButton okButton = new JButton("Zur\u00FCck"); + okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // Öffnet das Hauptmenü + con.closeThriftConnection(); MainMenue_GUI main = new MainMenue_GUI(); main.setVisible(true); dispose(); } }); - cancelButton.setActionCommand("OK"); - buttonPane.add(cancelButton); - getRootPane().setDefaultButton(cancelButton); - } - { - JButton continueButton = new JButton("Weiter"); - continueButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - - con.closeThriftConnection(); - EditImageAllgemein_GUI ea = new EditImageAllgemein_GUI(); - ea.setVisible(true); - dispose(); - - } - }); - continueButton.setActionCommand("Cancel"); - buttonPane.add(continueButton); + okButton.setActionCommand("OK"); + buttonPane.add(okButton); + getRootPane().setDefaultButton(okButton); } } @@ -427,8 +441,8 @@ public class SearchImage_GUI extends JFrame { List images; try { // Hole eine Liste der Images - images = client.getImageList(); + Iterator i = images.iterator(); int x = 0; @@ -440,7 +454,8 @@ public class SearchImage_GUI extends JFrame { images.get(x).getOsName(), images.get(x).getLectureName(), images.get(x).getUserData(), - images.get(x).getUpdateTime() }; + images.get(x).getUpdateTime(), "", images.get(x).id, + images.get(x).getVersion() }; // Füge diese Objekte der Tabelle hinzu model.addRow(obj); x++; diff --git a/Dozentenmodul/src/gui/image/SearchImage_GUI_alt.java b/Dozentenmodul/src/gui/image/SearchImage_GUI_alt.java new file mode 100644 index 00000000..85e8da21 --- /dev/null +++ b/Dozentenmodul/src/gui/image/SearchImage_GUI_alt.java @@ -0,0 +1,459 @@ +package gui.image; + +import gui.intro.MainMenue_GUI; +import gui.lecture.ExtendedSearchForImages_GUI; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +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.util.Iterator; +import java.util.List; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JDialog; +import javax.swing.JFrame; +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; +import javax.swing.JSeparator; +import javax.swing.JTabbedPane; +import javax.swing.JTable; +import javax.swing.JTextField; +import javax.swing.JTextPane; +import javax.swing.RowFilter; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import javax.swing.table.DefaultTableModel; +import javax.swing.table.TableModel; +import javax.swing.table.TableRowSorter; + +import org.apache.thrift.TException; + +import server.Server.Client; +import thrift.ThriftConnection; + +@SuppressWarnings("serial") +public class SearchImage_GUI_alt extends JFrame { + + private final JPanel contentPanel = new JPanel(); + String[] result; + JRadioButton rdbtnInternetJa; + JRadioButton rdbtnInternetNein; + JComboBox comboBox; + JTable tableAllImages; + JTable tablemyImages; + private JTextField textFieldName; + JTabbedPane tabbedPane; + String[] titles = { "Image-Name", "Lizenzpflichtig", "OS", "Veranstaltung", + "Verantwortlicher", "Letztes Update", "Schlagwort" }; + ThriftConnection con = new ThriftConnection(); + Client client = con.getThriftConnection(); + final DefaultTableModel modelAll = new DefaultTableModel(titles, 0); + final DefaultTableModel modelMyImages = new DefaultTableModel(titles, 0); + final TableRowSorter rowSorterAll = new TableRowSorter( + modelAll); + final TableRowSorter rowSorterMyImages = new TableRowSorter( + modelMyImages); + + /** + * Launch the application. + */ + public static void main(String[] args) { + try { + SearchImage_GUI_alt dialog = new SearchImage_GUI_alt(); + dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + dialog.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Create the dialog. + */ + public SearchImage_GUI_alt() { + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent arg0) { + // Beendet die Anwendung nach klick auf X + System.exit(0); + } + }); + // Verhindert das Vergrößern Des Fensters + setResizable(false); + + try { + // Setzt das Look & Feel auf System + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + // Setzt den Fenstertitel + setTitle("bwLehrpool Suite *Prototyp*"); + // Zentriert das Fenster in die Bildmitte + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + int top = (screenSize.height - 722) / 2; + int left = (screenSize.width - 603) / 2; + setBounds(left, top, 603, 722); + + final DefaultTableModel model = new DefaultTableModel(titles, 0); + + getContentPane().setLayout(null); + { + JPanel panel = new JPanel(); + panel.setBackground(SystemColor.menu); + panel.setBounds(10, 11, 577, 57); + getContentPane().add(panel); + panel.setLayout(null); + { + JLabel lblNewLabel = new JLabel("Suche nach VL-Image"); + lblNewLabel.setBounds(10, 11, 509, 22); + panel.add(lblNewLabel); + lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); + } + + JTextPane txtpnBitteWhlenSie = new JTextPane(); + txtpnBitteWhlenSie.setEditable(false); + txtpnBitteWhlenSie.setBackground(SystemColor.menu); + txtpnBitteWhlenSie + .setText("Hier k\u00F6nnen Sie nach Ihrem gew\u00FCnschten VL-Image suchen und dieses f\u00FCr weitere Schritte ausw\u00E4hlen"); + txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); + panel.add(txtpnBitteWhlenSie); + } + contentPanel.setBounds(10, 85, 577, 531); + contentPanel.setBackground(SystemColor.menu); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel); + contentPanel.setLayout(null); + + JPanel panel_1 = new JPanel(); + panel_1.setBackground(SystemColor.menu); + panel_1.setBorder(new TitledBorder(null, "Filterfunktionen", + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel_1.setBounds(10, 49, 557, 131); + contentPanel.add(panel_1); + panel_1.setLayout(null); + + JLabel lblNewLabel_2 = new JLabel("Anzeigename:"); + lblNewLabel_2.setBounds(10, 30, 250, 20); + panel_1.add(lblNewLabel_2); + + JLabel lblInternetIstInnerhalb = new JLabel("Betriebssystem:"); + lblInternetIstInnerhalb.setBounds(10, 58, 250, 20); + panel_1.add(lblInternetIstInnerhalb); + + textFieldName = new JTextField(); + // Key Listener der Tastatureingabe registriert + textFieldName.addKeyListener(new KeyAdapter() { + @Override + public void keyReleased(KeyEvent e) { + // Textfield eingabe auslesen + String stext = textFieldName.getText(); + + // Wenn Textfield nicht leer + if (stext != "") { + // Filtere nach der Eingabe + rowSorterAll.setRowFilter(RowFilter.regexFilter( + textFieldName.getText(), 0)); + rowSorterMyImages.setRowFilter(RowFilter.regexFilter( + textFieldName.getText(), 0)); + + } + } + }); + + textFieldName.setBounds(270, 30, 250, 20); + panel_1.add(textFieldName); + textFieldName.setColumns(10); + + JLabel lblErweiterteSuche = new JLabel( + "Erweiterte Suche"); + lblErweiterteSuche.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + // Öffnet das Fenster Extended GUI + ExtendedSearchForImages_GUI es = new ExtendedSearchForImages_GUI(); + es.setVisible(true); + } + }); + lblErweiterteSuche.setForeground(Color.BLUE); + + lblErweiterteSuche.setBounds(431, 106, 89, 14); + panel_1.add(lblErweiterteSuche); + + comboBox = new JComboBox(); + try { + // Holt sich eine Liste aller verfügbaren Betriebssysteme vom Server + List list = client.getAllOS(); + // Leeres Item hinzufügen + comboBox.addItem(""); + for (int i = 0; i < list.size(); i++) { + // Hinzufügen der verfügbaren Betriebssysteme + comboBox.addItem(list.get(i)); + } + } catch (TException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } + // Registriert Auswahländerungen der Box + comboBox.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + // Prüft das die Auswahl nicht leer ist + if (comboBox.getSelectedItem().toString() != "") { + // Filtert nach dem ausgewählten Betriebssystem + rowSorterAll.setRowFilter(RowFilter.regexFilter(comboBox + .getSelectedItem().toString(), 2)); + rowSorterMyImages.setRowFilter(RowFilter.regexFilter( + comboBox.getSelectedItem().toString(), 2)); + } + } + + }); + comboBox.setBounds(270, 58, 250, 20); + panel_1.add(comboBox); + + JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); + lblHauptmen.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + // Öffnet das Hauütmenü + SearchImage_GUI_alt.this.setVisible(false); + MainMenue_GUI main = new MainMenue_GUI(); + main.setVisible(true); + } + }); + lblHauptmen.setForeground(Color.BLUE); + lblHauptmen.setBounds(10, 11, 61, 14); + contentPanel.add(lblHauptmen); + + JLabel label_1 = new JLabel(">"); + label_1.setBounds(69, 11, 13, 14); + contentPanel.add(label_1); + + JLabel lblVlimage = new JLabel("VL-Image"); + lblVlimage.setForeground(Color.BLUE); + lblVlimage.setBounds(81, 11, 45, 14); + contentPanel.add(lblVlimage); + + JLabel label_2 = new JLabel(">"); + label_2.setBounds(133, 11, 13, 14); + contentPanel.add(label_2); + + JLabel lblNewLabel_1 = new JLabel("Imageauswahl"); + lblNewLabel_1.setBounds(146, 11, 85, 14); + contentPanel.add(lblNewLabel_1); + + tabbedPane = new JTabbedPane(JTabbedPane.TOP); + tabbedPane.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent arg0) { + System.out.println(tabbedPane.getSelectedIndex()); + if (tabbedPane.getSelectedIndex() == 0) { + + } else if (tabbedPane.getSelectedIndex() == 1) { + String username = "Spitzer Tobias"; + rowSorterMyImages.setRowFilter(RowFilter.regexFilter( + username, 4)); + // rowSorterMyImages.toggleSortOrder(0); + } + + } + }); + + tabbedPane.setBounds(10, 197, 557, 300); + contentPanel.add(tabbedPane); + + JScrollPane scrollPaneMyImage = new JScrollPane(); + tablemyImages = new JTable(); + tablemyImages.setModel(modelMyImages); + tablemyImages.getColumnModel().getColumn(1).sizeWidthToFit(); + tablemyImages.getColumnModel().getColumn(2).sizeWidthToFit(); + tablemyImages.getColumnModel().getColumn(3).sizeWidthToFit(); + tablemyImages.getColumnModel().getColumn(4).sizeWidthToFit(); + tablemyImages.getColumnModel().getColumn(5).sizeWidthToFit(); + initTableModel(modelMyImages); + tablemyImages.setRowSorter(rowSorterMyImages); + + JScrollPane scrollPaneAllImages = new JScrollPane(); + tableAllImages = new JTable(); + tableAllImages.setModel(modelAll); + tableAllImages.getColumnModel().getColumn(1).sizeWidthToFit(); + tableAllImages.getColumnModel().getColumn(2).sizeWidthToFit(); + tableAllImages.getColumnModel().getColumn(3).sizeWidthToFit(); + tableAllImages.getColumnModel().getColumn(4).sizeWidthToFit(); + tableAllImages.getColumnModel().getColumn(5).sizeWidthToFit(); + initTableModel(modelAll); + tableAllImages.setRowSorter(rowSorterAll); + + scrollPaneAllImages.setViewportView(tableAllImages); + tabbedPane.addTab("Alle", null, scrollPaneAllImages, null); + + scrollPaneMyImage.setViewportView(tablemyImages); + tabbedPane.addTab("Meine Images", null, scrollPaneMyImage, null); + + JScrollPane scrollPaneCoopImages = new JScrollPane(); + JTable tableCoopImages = new JTable(); + tableCoopImages.setModel(model); + tableCoopImages.getColumnModel().getColumn(1).sizeWidthToFit(); + tableCoopImages.getColumnModel().getColumn(2).sizeWidthToFit(); + tableCoopImages.getColumnModel().getColumn(3).sizeWidthToFit(); + tableCoopImages.getColumnModel().getColumn(4).sizeWidthToFit(); + tableCoopImages.getColumnModel().getColumn(5).sizeWidthToFit(); + + scrollPaneCoopImages.setViewportView(tableCoopImages); + tabbedPane.addTab("Kooperative Images", null, scrollPaneCoopImages, + null); + tabbedPane.setEnabledAt(2, false); + + JScrollPane scrollPanePublicImages = new JScrollPane(); + JTable tablePublicImages = new JTable(); + tablePublicImages.setModel(model); + tablePublicImages.getColumnModel().getColumn(1).sizeWidthToFit(); + tablePublicImages.getColumnModel().getColumn(2).sizeWidthToFit(); + tablePublicImages.getColumnModel().getColumn(3).sizeWidthToFit(); + tablePublicImages.getColumnModel().getColumn(4).sizeWidthToFit(); + tablePublicImages.getColumnModel().getColumn(5).sizeWidthToFit(); + + scrollPanePublicImages.setViewportView(tablePublicImages); + tabbedPane.addTab("\u00D6ffentliche Images", null, + scrollPanePublicImages, null); + tabbedPane.setEnabledAt(3, false); + + JScrollPane scrollPanePublicVorlagen = new JScrollPane(); + JTable tablePublicVorlagen = new JTable(); + tablePublicVorlagen.setModel(model); + tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit(); + tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit(); + tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit(); + tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit(); + tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit(); + + scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen); + tabbedPane.addTab("\u00D6ffentliche Vorlagen", null, + scrollPanePublicVorlagen, null); + tabbedPane.setEnabledAt(4, false); + + JButton btnDownload = new JButton("Download"); + btnDownload.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + // Öffnet den Downloader + FTPDownloader_GUI down = new FTPDownloader_GUI(); + down.setVisible(true); + SearchImage_GUI_alt.this.setVisible(false); + } + }); + btnDownload.setBounds(449, 508, 118, 23); + contentPanel.add(btnDownload); + { + JPanel buttonPane = new JPanel(); + buttonPane.setBounds(0, 640, 597, 33); + buttonPane.setBackground(SystemColor.menu); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane); + { + JButton cancelButton = new JButton("Zur\u00FCck"); + cancelButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + // Öffnet das Hauptmenü + MainMenue_GUI main = new MainMenue_GUI(); + main.setVisible(true); + dispose(); + } + }); + cancelButton.setActionCommand("OK"); + buttonPane.add(cancelButton); + getRootPane().setDefaultButton(cancelButton); + } + { + JButton continueButton = new JButton("Weiter"); + continueButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + con.closeThriftConnection(); + EditImageAllgemein_GUI ea = new EditImageAllgemein_GUI(); + ea.setVisible(true); + dispose(); + + } + }); + continueButton.setActionCommand("Cancel"); + buttonPane.add(continueButton); + } + } + + JSeparator separator = new JSeparator(); + separator.setBounds(0, 78, 597, 2); + getContentPane().add(separator); + + JSeparator separator_1 = new JSeparator(); + separator_1.setBounds(0, 627, 597, 2); + getContentPane().add(separator_1); + + JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + + JMenu mnNewMenu_1 = new JMenu("Hilfe"); + menuBar.add(mnNewMenu_1); + + JMenuItem mntmFaq = new JMenuItem("FAQ"); + mnNewMenu_1.add(mntmFaq); + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mnNewMenu_1.add(mntmOtrs); + + } + + // Initiale Beffülung eines Table models + public DefaultTableModel initTableModel(DefaultTableModel model) { + List images; + try { + // Hole eine Liste der Images + + images = client.getImageList(); + Iterator i = images.iterator(); + + int x = 0; + + while (i.hasNext()) { + // erzeuge Objekte für die Tabelle + Object[] obj = { images.get(x).getImageName(), + images.get(x).getLicenseRestriction(), + images.get(x).getOsName(), + images.get(x).getLectureName(), + images.get(x).getUserData(), + images.get(x).getUpdateTime() }; + // Füge diese Objekte der Tabelle hinzu + model.addRow(obj); + x++; + i.next(); + + } + + return model; + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + return model; + } + +} diff --git a/Dozentenmodul/src/gui/image/SearchMethodLecture_GUI.java b/Dozentenmodul/src/gui/image/SearchMethodLecture_GUI.java new file mode 100644 index 00000000..49d7810b --- /dev/null +++ b/Dozentenmodul/src/gui/image/SearchMethodLecture_GUI.java @@ -0,0 +1,251 @@ +package gui.image; + +import gui.intro.MainMenue_GUI; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; + +import javax.swing.ButtonGroup; +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JFrame; +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.JSeparator; +import javax.swing.JTextArea; +import javax.swing.JTextPane; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; + +@SuppressWarnings("serial") +public class SearchMethodLecture_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + String[] result; + JRadioButton rdbtnSearchByImage; + JRadioButton rdbtnSearchByLecture; + private final ButtonGroup buttonGroup = new ButtonGroup(); + + /** + * Launch the application. + */ + public static void main(String[] args) { + try { + SearchMethodLecture_GUI dialog = new SearchMethodLecture_GUI(); + dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + dialog.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Create the dialog. + */ + public SearchMethodLecture_GUI() { + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent arg0) { + System.exit(0); + } + }); + setResizable(false); + + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + setTitle("bwLehrpool Suite *Prototyp* - Suchmethode w\u00E4hlen"); + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + int top = (screenSize.height - 603) / 2; + int left = (screenSize.width - 722) / 2; + setBounds(left, top, 603, 722); + // setBounds(100, 100, 603, 722); + getContentPane().setLayout(null); + { + JPanel panel = new JPanel(); + panel.setBackground(SystemColor.menu); + panel.setBounds(10, 11, 577, 57); + getContentPane().add(panel); + panel.setLayout(null); + { + JLabel lblNewLabel = new JLabel("Suchmethode ausw\u00E4hlen"); + lblNewLabel.setBounds(10, 11, 509, 22); + panel.add(lblNewLabel); + lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); + } + + JTextPane txtpnBitteWhlenSie = new JTextPane(); + txtpnBitteWhlenSie.setEditable(false); + txtpnBitteWhlenSie.setBackground(SystemColor.menu); + txtpnBitteWhlenSie + .setText("Geben Sie bitte an, nach welchem Kriterium Sie suchen m\u00F6chten."); + txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); + panel.add(txtpnBitteWhlenSie); + } + contentPanel.setBounds(10, 85, 577, 493); + contentPanel.setBackground(SystemColor.menu); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel); + contentPanel.setLayout(null); + + JPanel panel_1 = new JPanel(); + panel_1.setBackground(SystemColor.menu); + panel_1.setBorder(new TitledBorder(null, + "Wählen Sie bitte die Suchmethode Ihrer Suche", + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel_1.setBounds(10, 36, 557, 369); + contentPanel.add(panel_1); + panel_1.setLayout(null); + + rdbtnSearchByImage = new JRadioButton( + "Nach einem VL-Image oder Vorlagen suchen"); + buttonGroup.add(rdbtnSearchByImage); + rdbtnSearchByImage.setBounds(6, 38, 545, 23); + panel_1.add(rdbtnSearchByImage); + + JTextArea txtrHierKlickenWenn = new JTextArea(); + txtrHierKlickenWenn.setBackground(SystemColor.menu); + txtrHierKlickenWenn.setLineWrap(true); + txtrHierKlickenWenn.setFont(new Font("Tahoma", Font.PLAIN, 11)); + txtrHierKlickenWenn + .setText("Hier klicken, wenn Sie nach einem konkreten Image suchen, von dem Sie exakte Daten kennen. Hierzu geh\u00F6ren z.B. das Betriebssystem oder die installierte Software.\r\nEs werden zudem alle Vorlagen aufgelistet."); + txtrHierKlickenWenn.setBounds(25, 68, 518, 80); + panel_1.add(txtrHierKlickenWenn); + + JTextArea txtrHierKlickenWenn_1 = new JTextArea(); + txtrHierKlickenWenn_1 + .setText("Hier klicken, wenn Sie nur wissen f\u00FCr welche Veranstaltung das gesuchte Image verwendet wird. Hierzu geh\u00F6ren z.B. der Name des Dozenten oder der Name der Veranstaltung."); + txtrHierKlickenWenn_1.setLineWrap(true); + txtrHierKlickenWenn_1.setFont(new Font("Tahoma", Font.PLAIN, 11)); + txtrHierKlickenWenn_1.setBackground(SystemColor.menu); + txtrHierKlickenWenn_1.setBounds(25, 210, 518, 80); + panel_1.add(txtrHierKlickenWenn_1); + + rdbtnSearchByLecture = new JRadioButton( + "Nach einer Veranstaltung suchen"); + buttonGroup.add(rdbtnSearchByLecture); + rdbtnSearchByLecture.setBounds(6, 180, 545, 23); + panel_1.add(rdbtnSearchByLecture); + + JPanel panel = new JPanel(); + panel.setBounds(10, 402, 577, 33); + contentPanel.add(panel); + panel.setLayout(null); + panel.setBorder(new EmptyBorder(5, 5, 5, 5)); + panel.setBackground(SystemColor.menu); + + JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); + lblHauptmen.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + + SearchMethodLecture_GUI.this.setVisible(false); + MainMenue_GUI main = new MainMenue_GUI(); + main.setVisible(true); + } + }); + lblHauptmen.setForeground(Color.BLUE); + lblHauptmen.setBounds(10, 11, 61, 14); + contentPanel.add(lblHauptmen); + + JLabel label_1 = new JLabel(">"); + label_1.setBounds(69, 11, 13, 14); + contentPanel.add(label_1); + + JLabel lblVlimage = new JLabel("VL-Image"); + lblVlimage.setForeground(Color.BLUE); + lblVlimage.setBounds(81, 11, 45, 14); + contentPanel.add(lblVlimage); + + JLabel label_2 = new JLabel(">"); + label_2.setBounds(133, 11, 13, 14); + contentPanel.add(label_2); + + JLabel lblNewLabel_1 = new JLabel("Suchmethode"); + lblNewLabel_1.setBounds(146, 11, 82, 14); + contentPanel.add(lblNewLabel_1); + { + JPanel buttonPane = new JPanel(); + buttonPane.setBounds(0, 640, 597, 33); + buttonPane.setBackground(SystemColor.menu); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane); + { + JButton backButton = new JButton("Zur\u00FCck"); + backButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + MainMenue_GUI sr = new MainMenue_GUI(); + sr.setVisible(true); + dispose(); + } + }); + backButton.setActionCommand("CANCEL"); + buttonPane.add(backButton); + getRootPane().setDefaultButton(backButton); + } + { + JButton continueButton = new JButton("Weiter"); + continueButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + if (rdbtnSearchByImage.isSelected() == true) { + SearchImage_GUI si = new SearchImage_GUI(); + si.setVisible(true); + dispose(); + } + } + + }); + continueButton.setActionCommand("OK"); + buttonPane.add(continueButton); + } + } + + JSeparator separator = new JSeparator(); + separator.setBounds(0, 78, 597, 2); + getContentPane().add(separator); + + JSeparator separator_1 = new JSeparator(); + separator_1.setBounds(0, 627, 597, 2); + getContentPane().add(separator_1); + + JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + + JMenu mnNewMenu = new JMenu("Suchen"); + menuBar.add(mnNewMenu); + + JMenuItem mntmVlSuche = new JMenuItem("VL Suche"); + mnNewMenu.add(mntmVlSuche); + + JMenu mnNewMenu_1 = new JMenu("Hilfe"); + menuBar.add(mnNewMenu_1); + + JMenuItem mntmFaq = new JMenuItem("FAQ"); + mnNewMenu_1.add(mntmFaq); + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mnNewMenu_1.add(mntmOtrs); + + } +} diff --git a/Dozentenmodul/src/gui/intro/Login_GUI.java b/Dozentenmodul/src/gui/intro/Login_GUI.java index 27b3cd18..dcd90969 100644 --- a/Dozentenmodul/src/gui/intro/Login_GUI.java +++ b/Dozentenmodul/src/gui/intro/Login_GUI.java @@ -12,8 +12,6 @@ import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.File; import java.io.IOException; -import java.net.InetAddress; -import java.net.UnknownHostException; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; diff --git a/Dozentenmodul/src/gui/intro/MainMenue_GUI.java b/Dozentenmodul/src/gui/intro/MainMenue_GUI.java index 99c240f3..da76abf6 100644 --- a/Dozentenmodul/src/gui/intro/MainMenue_GUI.java +++ b/Dozentenmodul/src/gui/intro/MainMenue_GUI.java @@ -44,9 +44,11 @@ public class MainMenue_GUI extends JFrame { JRadioButton rdbtnImageNew; JRadioButton rdbtnImageEdit; JRadioButton rdbtnImageSearchDownload; - JRadioButton rdbtnVeranstaltungNew; + JRadioButton rdbtnLectureNew; JRadioButton rdbtnImageDelete; - JRadioButton rdbtnVeranstaltungEdit; + JRadioButton rdbtnLectureEdit; + JRadioButton rdbtnLectureDelete; + JRadioButton rdbtnLectureSearch; private final ButtonGroup buttonGroup = new ButtonGroup(); /** @@ -151,7 +153,6 @@ public class MainMenue_GUI extends JFrame { panelImage.add(rdbtnImageDelete); rdbtnImageSearchDownload = new JRadioButton("Suche und Download"); - rdbtnImageSearchDownload.setEnabled(false); buttonGroup.add(rdbtnImageSearchDownload); rdbtnImageSearchDownload .setToolTipText("Hier k\u00F6nnen Sie ein bestehendes Labor zum ver\u00E4ndern downloaden"); @@ -190,39 +191,38 @@ public class MainMenue_GUI extends JFrame { panelVeranstaltung.setBounds(10, 327, 270, 170); contentPanel.add(panelVeranstaltung); - rdbtnVeranstaltungNew = new JRadioButton("Neu"); - buttonGroup.add(rdbtnVeranstaltungNew); - rdbtnVeranstaltungNew + rdbtnLectureNew = new JRadioButton("Neu"); + buttonGroup.add(rdbtnLectureNew); + rdbtnLectureNew .setToolTipText("Hier k\u00F6nnen Sie Ihre Labordaten eingeben"); - rdbtnVeranstaltungNew.setBounds(6, 24, 185, 23); - panelVeranstaltung.add(rdbtnVeranstaltungNew); - rdbtnVeranstaltungNew.setBackground(SystemColor.menu); + rdbtnLectureNew.setBounds(6, 24, 185, 23); + panelVeranstaltung.add(rdbtnLectureNew); + rdbtnLectureNew.setBackground(SystemColor.menu); - rdbtnVeranstaltungEdit = new JRadioButton("Bearbeiten"); - rdbtnVeranstaltungEdit + rdbtnLectureEdit = new JRadioButton("Bearbeiten"); + rdbtnLectureEdit .setToolTipText("Hier k\u00F6nnen Sie einen Link auf ein bestehendes Labor erzeugen"); - rdbtnVeranstaltungEdit.setBounds(6, 50, 230, 23); - panelVeranstaltung.add(rdbtnVeranstaltungEdit); - buttonGroup.add(rdbtnVeranstaltungEdit); - rdbtnVeranstaltungEdit.setBackground(SystemColor.menu); - - JRadioButton rdbtnVeranstaltungDelete = new JRadioButton("L\u00F6schen"); - rdbtnVeranstaltungDelete.setEnabled(false); - rdbtnVeranstaltungDelete + rdbtnLectureEdit.setBounds(6, 50, 230, 23); + panelVeranstaltung.add(rdbtnLectureEdit); + buttonGroup.add(rdbtnLectureEdit); + rdbtnLectureEdit.setBackground(SystemColor.menu); + + rdbtnLectureDelete = new JRadioButton("L\u00F6schen"); + rdbtnLectureDelete.setEnabled(false); + rdbtnLectureDelete .setToolTipText("Hier k\u00F6nnen Sie ein Labor l\u00F6schen"); - rdbtnVeranstaltungDelete.setBounds(6, 76, 175, 23); - panelVeranstaltung.add(rdbtnVeranstaltungDelete); - buttonGroup.add(rdbtnVeranstaltungDelete); - rdbtnVeranstaltungDelete.setBackground(SystemColor.menu); - - JRadioButton rdbtnVeranstaltungSearch = new JRadioButton("Suche"); - rdbtnVeranstaltungSearch.setEnabled(false); - buttonGroup.add(rdbtnVeranstaltungSearch); - rdbtnVeranstaltungSearch + rdbtnLectureDelete.setBounds(6, 76, 175, 23); + panelVeranstaltung.add(rdbtnLectureDelete); + buttonGroup.add(rdbtnLectureDelete); + rdbtnLectureDelete.setBackground(SystemColor.menu); + + rdbtnLectureSearch = new JRadioButton("Suche"); + buttonGroup.add(rdbtnLectureSearch); + rdbtnLectureSearch .setToolTipText("Hier k\u00F6nnen Sie ein Labor l\u00F6schen"); - rdbtnVeranstaltungSearch.setBackground(SystemColor.menu); - rdbtnVeranstaltungSearch.setBounds(6, 102, 175, 23); - panelVeranstaltung.add(rdbtnVeranstaltungSearch); + rdbtnLectureSearch.setBackground(SystemColor.menu); + rdbtnLectureSearch.setBounds(6, 102, 175, 23); + panelVeranstaltung.add(rdbtnLectureSearch); JPanel panelNews = new JPanel(); panelNews.setLayout(null); @@ -272,24 +272,24 @@ public class MainMenue_GUI extends JFrame { txtDesc.setText(descSearchImage); } }); - rdbtnVeranstaltungNew.addActionListener(new ActionListener() { + rdbtnLectureNew.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { descNewLecture = "Legen Sie eine neue Veranstaltung an und verknüpfen Sie diese mit einem bereits vorhandenem Image. Ihre neue Veranstaltung kann auch auf dem Image eines anderen Dozenten beruhen."; txtDesc.setText(descNewLecture); } }); - rdbtnVeranstaltungEdit.addActionListener(new ActionListener() { + rdbtnLectureEdit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { descEditLecture = "Bearbeiten Sie die hinterlegten Informationen zu einer Veranstaltung."; txtDesc.setText(descEditLecture); } }); - rdbtnVeranstaltungDelete.addActionListener(new ActionListener() { + rdbtnLectureDelete.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { descDeleteLecture = "Suchen und löschen Sie eine Veranstaltung. Das hiermit verbundene Image bleibt erhalten."; } }); - rdbtnVeranstaltungSearch.addActionListener(new ActionListener() { + rdbtnLectureSearch.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { descSearchLecture = "Suchen Sie nach bestimmten Veranstaltungen oder verschaffen Sie sich einen Überblick über alle verfügbaren Veranstaltungen. Eventuell gibt es bereits etwas passendes für Ihre Vorlesung."; txtDesc.setText(descSearchLecture); @@ -343,32 +343,43 @@ public class MainMenue_GUI extends JFrame { continueButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { + //Images if (rdbtnImageNew.isSelected() == true) { CreateImageAllgemein_GUI sr = new CreateImageAllgemein_GUI(); sr.setVisible(true); dispose(); } else if (rdbtnImageEdit.isSelected() == true) { - SearchEditImage_GUI si = new SearchEditImage_GUI(); si.setVisible(true); dispose(); - } else if (rdbtnImageSearchDownload.isSelected() == true) { - SearchMethodLecture_GUI sm = new SearchMethodLecture_GUI(); - sm.setVisible(true); - dispose(); } else if (rdbtnImageDelete.isSelected() == true) { DeleteImage_GUI di = new DeleteImage_GUI(); di.setVisible(true); dispose(); - } else if (rdbtnVeranstaltungNew.isSelected() == true) { + } else if (rdbtnImageSearchDownload.isSelected() == true) { + //SearchMethodLecture_GUI sm = new SearchMethodLecture_GUI(); + //SearchImage_GUI si = new SearchImage_GUI(); + SearchEditImage_GUI si = new SearchEditImage_GUI(); + si.setVisible(true); + dispose(); + //Lectures + } else if (rdbtnLectureNew.isSelected() == true) { CreateLectureAllgemein_GUI av = new CreateLectureAllgemein_GUI(); av.setVisible(true); dispose(); - } else if (rdbtnVeranstaltungEdit.isSelected() == true) { - //SearchEditLecture_GUI sl = new SearchEditLecture_GUI(); + } else if (rdbtnLectureEdit.isSelected() == true) { EditLectureSearch_GUI el = new EditLectureSearch_GUI(); el.setVisible(true); dispose(); + } else if (rdbtnLectureDelete.isSelected() == true) { + //DeleteLecture_GUI dl = new DeleteLecture_GUI(); + //dl.setVisible(true); + //dispose(); + } else if (rdbtnLectureSearch.isSelected() == true) { + //SearchLecture_GUI sl = new SearchLecture_GUI(); + EditLectureSearch_GUI sl = new EditLectureSearch_GUI(); + sl.setVisible(true); + dispose(); } } }); diff --git a/Dozentenmodul/src/gui/lecture/CreateLectureAllgemein_GUI.java b/Dozentenmodul/src/gui/lecture/CreateLectureAllgemein_GUI.java index 026cb7c5..02946571 100644 --- a/Dozentenmodul/src/gui/lecture/CreateLectureAllgemein_GUI.java +++ b/Dozentenmodul/src/gui/lecture/CreateLectureAllgemein_GUI.java @@ -100,7 +100,7 @@ public class CreateLectureAllgemein_GUI extends JFrame { // TODO Auto-generated catch block e.printStackTrace(); } - setTitle("bwLehrpool Suite *Prototyp*"); + setTitle("bwLehrpool Suite *Prototyp* - Veranstaltung erzeugen"); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); int top = (screenSize.height - 722) / 2; int left = (screenSize.width - 603) / 2; diff --git a/Dozentenmodul/src/gui/lecture/CreateLectureLink_GUI.java b/Dozentenmodul/src/gui/lecture/CreateLectureLink_GUI.java index 2243fd43..451ed9b4 100644 --- a/Dozentenmodul/src/gui/lecture/CreateLectureLink_GUI.java +++ b/Dozentenmodul/src/gui/lecture/CreateLectureLink_GUI.java @@ -105,7 +105,7 @@ public class CreateLectureLink_GUI extends JFrame { // TODO Auto-generated catch block e.printStackTrace(); } - setTitle("bwLehrpool Suite *Prototyp*"); + setTitle("bwLehrpool Suite *Prototyp* - Veranstaltung erzeugen"); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); int top = (screenSize.height - 603) / 2; int left = (screenSize.width - 722) / 2; @@ -122,7 +122,7 @@ public class CreateLectureLink_GUI extends JFrame { getContentPane().add(panel); panel.setLayout(null); { - JLabel lblNewLabel = new JLabel("Image zur Verlinkung ausw\u00E4hlen"); + JLabel lblNewLabel = new JLabel("Image verlinken"); lblNewLabel.setBounds(10, 11, 509, 22); panel.add(lblNewLabel); lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); diff --git a/Dozentenmodul/src/gui/lecture/EditLectureAllgemein_GUI.java b/Dozentenmodul/src/gui/lecture/EditLectureAllgemein_GUI.java index 115a9f1f..348b1c77 100644 --- a/Dozentenmodul/src/gui/lecture/EditLectureAllgemein_GUI.java +++ b/Dozentenmodul/src/gui/lecture/EditLectureAllgemein_GUI.java @@ -90,7 +90,7 @@ public class EditLectureAllgemein_GUI extends JFrame { // TODO Auto-generated catch block e.printStackTrace(); } - setTitle("bwLehrpool Suite *Prototyp*"); + setTitle("bwLehrpool Suite *Prototyp* - Veranstaltung bearbeiten"); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); int top=(screenSize.height - 722) / 2; int left=(screenSize.width - 603) / 2; diff --git a/Dozentenmodul/src/gui/lecture/EditLectureLink_GUI.java b/Dozentenmodul/src/gui/lecture/EditLectureLink_GUI.java index c1fdec80..4a4f6051 100644 --- a/Dozentenmodul/src/gui/lecture/EditLectureLink_GUI.java +++ b/Dozentenmodul/src/gui/lecture/EditLectureLink_GUI.java @@ -99,7 +99,7 @@ public class EditLectureLink_GUI extends JFrame { // TODO Auto-generated catch block e.printStackTrace(); } - setTitle("bwLehrpool Suite *Prototyp*"); + setTitle("bwLehrpool Suite *Prototyp* - Veranstaltung bearbeiten"); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); int top = (screenSize.height - 603) / 2; int left = (screenSize.width - 722) / 2; @@ -117,7 +117,7 @@ public class EditLectureLink_GUI extends JFrame { panel.setLayout(null); { JLabel lblNewLabel = new JLabel( - "Image zur Verlinkung ausw\u00E4hlen"); + "Image verlinken"); lblNewLabel.setBounds(10, 11, 509, 22); panel.add(lblNewLabel); lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); diff --git a/Dozentenmodul/src/gui/lecture/EditLectureSearch_GUI.java b/Dozentenmodul/src/gui/lecture/EditLectureSearch_GUI.java index ae50fa22..475f0a5f 100644 --- a/Dozentenmodul/src/gui/lecture/EditLectureSearch_GUI.java +++ b/Dozentenmodul/src/gui/lecture/EditLectureSearch_GUI.java @@ -1,6 +1,5 @@ package gui.lecture; -import gui.image.EditImageAllgemein_GUI; import gui.intro.MainMenue_GUI; import java.awt.Color; import java.awt.Dimension; @@ -116,7 +115,7 @@ public class EditLectureSearch_GUI extends JFrame { e.printStackTrace(); } // Setzt den Fenstertitel - setTitle("bwLehrpool Suite *Prototyp*"); + setTitle("bwLehrpool Suite *Prototyp* - Veranstaltung bearbeiten"); // Zentriert das Fenster in die Bildmitte Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); int top = (screenSize.height - 722) / 2; diff --git a/Dozentenmodul/src/gui/lecture/ExtendedSearchForImages_GUI.java b/Dozentenmodul/src/gui/lecture/ExtendedSearchForImages_GUI.java index 3fc4b7f6..095ca7ef 100644 --- a/Dozentenmodul/src/gui/lecture/ExtendedSearchForImages_GUI.java +++ b/Dozentenmodul/src/gui/lecture/ExtendedSearchForImages_GUI.java @@ -72,7 +72,7 @@ public class ExtendedSearchForImages_GUI extends JFrame { // TODO Auto-generated catch block e.printStackTrace(); } - setTitle("bwLehrpool Suite *Prototyp*"); + setTitle("bwLehrpool Suite *Prototyp* - Erweiterte Suche"); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); int top=(screenSize.height - 722) / 2; int left=(screenSize.width -603) / 2; diff --git a/Dozentenmodul/src/gui/lecture/SearchLecture_GUI.java b/Dozentenmodul/src/gui/lecture/SearchLecture_GUI.java new file mode 100644 index 00000000..a22578e1 --- /dev/null +++ b/Dozentenmodul/src/gui/lecture/SearchLecture_GUI.java @@ -0,0 +1,405 @@ +package gui.lecture; + +import gui.intro.MainMenue_GUI; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.SystemColor; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +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.util.Iterator; +import java.util.List; +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JFrame; +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; +import javax.swing.JSeparator; +import javax.swing.JTabbedPane; +import javax.swing.JTable; +import javax.swing.JTextField; +import javax.swing.JTextPane; +import javax.swing.RowFilter; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import javax.swing.table.DefaultTableModel; +import javax.swing.table.TableModel; +import javax.swing.table.TableRowSorter; +import models.person; +import org.apache.thrift.TException; +import server.Server.Client; +import thrift.ThriftConnection; + +@SuppressWarnings("serial") +public class SearchLecture_GUI extends JFrame { + + private final JPanel contentPanel = new JPanel(); + String[] result; + JRadioButton rdbtnInternetJa; + JRadioButton rdbtnInternetNein; + JTable tableAllLectures; + JTable tablemyLectures; + JTable tableCoopImages; + JTable tablePublicVorlagen; + JTable tablePublicImages; + private JTextField textFieldName; + JTabbedPane tabbedPane; + String[] titles = { "Veranstaltungsname", "Beschreibung", + "Gültigkeitsdatum", "Aktiv", "Letzte Benutzung", + "Verantwortlicher", "Image", "Schlagwort", "ID" }; + ThriftConnection con = new ThriftConnection(); + Client client = con.getThriftConnection(); + final DefaultTableModel modelAll = new DefaultTableModel(titles, 0); + final DefaultTableModel modelMyLectures = new DefaultTableModel(titles, 0); + final TableRowSorter rowSorterAll = new TableRowSorter( + modelAll); + final TableRowSorter rowSorterMyLectures = new TableRowSorter( + modelMyLectures); + + /** + * Launch the application. + */ + public static void main(String[] args) { + try { + EditLectureSearch_GUI dialog = new EditLectureSearch_GUI(); + dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + dialog.setVisible(true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * Create the dialog. + */ + public SearchLecture_GUI() { + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent arg0) { + // Beendet die Anwendung nach klick auf X + con.closeThriftConnection(); + System.exit(0); + } + }); + // Verhindert das Vergrößern Des Fensters + setResizable(false); + + try { + // Setzt das Look & Feel auf System + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException | UnsupportedLookAndFeelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + // Setzt den Fenstertitel + setTitle("bwLehrpool Suite *Prototyp* - Veranstaltung suchen"); + // Zentriert das Fenster in die Bildmitte + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + int top = (screenSize.height - 722) / 2; + int left = (screenSize.width - 603) / 2; + setBounds(left, top, 603, 722); + + final DefaultTableModel model = new DefaultTableModel(titles, 0); + + getContentPane().setLayout(null); + { + JPanel panel = new JPanel(); + panel.setBackground(SystemColor.menu); + panel.setBounds(10, 11, 577, 57); + getContentPane().add(panel); + panel.setLayout(null); + { + JLabel lblNewLabel = new JLabel("Suche nach Veranstaltung"); + lblNewLabel.setBounds(10, 11, 509, 22); + panel.add(lblNewLabel); + lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); + } + + JTextPane txtpnBitteWhlenSie = new JTextPane(); + txtpnBitteWhlenSie.setEditable(false); + txtpnBitteWhlenSie.setBackground(SystemColor.menu); + txtpnBitteWhlenSie + .setText("Hier k\u00F6nnen Sie nach Ihrem gew\u00FCnschten VL-Image suchen und dieses f\u00FCr weitere Schritte ausw\u00E4hlen"); + txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); + panel.add(txtpnBitteWhlenSie); + } + contentPanel.setBounds(10, 85, 577, 531); + contentPanel.setBackground(SystemColor.menu); + contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); + getContentPane().add(contentPanel); + contentPanel.setLayout(null); + + JPanel panel_1 = new JPanel(); + panel_1.setBackground(SystemColor.menu); + panel_1.setBorder(new TitledBorder(null, "Filterfunktionen", + TitledBorder.LEADING, TitledBorder.TOP, null, null)); + panel_1.setBounds(10, 49, 557, 131); + contentPanel.add(panel_1); + panel_1.setLayout(null); + + JLabel lblNewLabel_2 = new JLabel("Anzeigename:"); + lblNewLabel_2.setBounds(10, 30, 250, 20); + panel_1.add(lblNewLabel_2); + + textFieldName = new JTextField(); + // Key Listener der Tastatureingabe registriert + textFieldName.addKeyListener(new KeyAdapter() { + @Override + public void keyReleased(KeyEvent e) { + // Textfield eingabe auslesen + String stext = textFieldName.getText(); + + // Wenn Textfield nicht leer + if (stext != "") { + // Filtere nach der Eingabe + rowSorterAll.setRowFilter(RowFilter.regexFilter( + textFieldName.getText(), 0)); + rowSorterMyLectures.setRowFilter(RowFilter.regexFilter( + textFieldName.getText(), 0)); + + } + } + }); + + textFieldName.setBounds(270, 30, 250, 20); + panel_1.add(textFieldName); + textFieldName.setColumns(10); + + JLabel lblErweiterteSuche = new JLabel( + "Erweiterte Suche"); + lblErweiterteSuche.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + // Öffnet das Fenster Extended GUI + con.closeThriftConnection(); + ExtendedSearchForImages_GUI es = new ExtendedSearchForImages_GUI(); + es.setVisible(true); + } + }); + lblErweiterteSuche.setForeground(Color.BLUE); + + lblErweiterteSuche.setBounds(431, 106, 89, 14); + panel_1.add(lblErweiterteSuche); + + JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); + lblHauptmen.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent arg0) { + // Öffnet das Hauptmenü + con.closeThriftConnection(); + SearchLecture_GUI.this.setVisible(false); + MainMenue_GUI main = new MainMenue_GUI(); + main.setVisible(true); + } + }); + lblHauptmen.setForeground(Color.BLUE); + lblHauptmen.setBounds(10, 11, 61, 14); + contentPanel.add(lblHauptmen); + + JLabel label_1 = new JLabel(">"); + label_1.setBounds(69, 11, 13, 14); + contentPanel.add(label_1); + + JLabel lblVlimage = new JLabel("Veranstaltung"); + lblVlimage.setForeground(Color.BLUE); + lblVlimage.setBounds(81, 11, 75, 14); + contentPanel.add(lblVlimage); + + JLabel label_2 = new JLabel(">"); + label_2.setBounds(152, 11, 13, 14); + contentPanel.add(label_2); + + JLabel lblNewLabel_1 = new JLabel("Veranstaltungsauswahl"); + lblNewLabel_1.setBounds(166, 11, 128, 14); + contentPanel.add(lblNewLabel_1); + + tabbedPane = new JTabbedPane(JTabbedPane.TOP); + tabbedPane.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent arg0) { + System.out.println(tabbedPane.getSelectedIndex()); + if (tabbedPane.getSelectedIndex() == 0) { + + String username = person.verantwortlicher.getName() + " " + + person.verantwortlicher.getVorname(); + rowSorterMyLectures.setRowFilter(RowFilter.regexFilter( + username, 5)); + } else if (tabbedPane.getSelectedIndex() == 1) { + + } + + } + }); + + tabbedPane.setBounds(10, 197, 557, 323); + contentPanel.add(tabbedPane); + initTableModel(modelMyLectures); + + JScrollPane scrollPaneAllImages = new JScrollPane(); + tableAllLectures = new JTable(); + tableAllLectures.setModel(modelAll); + tableAllLectures.getColumnModel().getColumn(1).sizeWidthToFit(); + tableAllLectures.getColumnModel().getColumn(2).sizeWidthToFit(); + tableAllLectures.getColumnModel().getColumn(3).sizeWidthToFit(); + tableAllLectures.getColumnModel().getColumn(4).sizeWidthToFit(); + tableAllLectures.getColumnModel().getColumn(5).sizeWidthToFit(); + initTableModel(modelAll); + + JScrollPane scrollPaneMyImage = new JScrollPane(); + tablemyLectures = new JTable(); + tablemyLectures.setModel(modelMyLectures); + + tablemyLectures.getColumnModel().getColumn(1).sizeWidthToFit(); + tablemyLectures.getColumnModel().getColumn(2).sizeWidthToFit(); + tablemyLectures.getColumnModel().getColumn(3).sizeWidthToFit(); + tablemyLectures.getColumnModel().getColumn(4).sizeWidthToFit(); + tablemyLectures.getColumnModel().getColumn(5).sizeWidthToFit(); + tablemyLectures.setRowSorter(rowSorterMyLectures); + + scrollPaneMyImage.setViewportView(tablemyLectures); + tabbedPane.addTab("Meine Veranstaltungen", null, scrollPaneMyImage, + null); + tableAllLectures.setRowSorter(rowSorterAll); + + scrollPaneAllImages.setViewportView(tableAllLectures); + tabbedPane.addTab("Alle", null, scrollPaneAllImages, null); + + JScrollPane scrollPaneCoopImages = new JScrollPane(); + tableCoopImages = new JTable(); + tableCoopImages.setModel(model); + tableCoopImages.getColumnModel().getColumn(1).sizeWidthToFit(); + tableCoopImages.getColumnModel().getColumn(2).sizeWidthToFit(); + tableCoopImages.getColumnModel().getColumn(3).sizeWidthToFit(); + tableCoopImages.getColumnModel().getColumn(4).sizeWidthToFit(); + tableCoopImages.getColumnModel().getColumn(5).sizeWidthToFit(); + + scrollPaneCoopImages.setViewportView(tableCoopImages); + tabbedPane.addTab("Kooperative Veranstaltungen", null, + scrollPaneCoopImages, null); + tabbedPane.setEnabledAt(2, false); + + JScrollPane scrollPanePublicImages = new JScrollPane(); + tablePublicImages = new JTable(); + tablePublicImages.setModel(model); + tablePublicImages.getColumnModel().getColumn(1).sizeWidthToFit(); + tablePublicImages.getColumnModel().getColumn(2).sizeWidthToFit(); + tablePublicImages.getColumnModel().getColumn(3).sizeWidthToFit(); + tablePublicImages.getColumnModel().getColumn(4).sizeWidthToFit(); + tablePublicImages.getColumnModel().getColumn(5).sizeWidthToFit(); + + scrollPanePublicImages.setViewportView(tablePublicImages); + tabbedPane.addTab("\u00D6ffentliche Images", null, + scrollPanePublicImages, null); + tabbedPane.setEnabledAt(3, false); + + JScrollPane scrollPanePublicVorlagen = new JScrollPane(); + tablePublicVorlagen = new JTable(); + tablePublicVorlagen.setModel(model); + tablePublicVorlagen.getColumnModel().getColumn(1).sizeWidthToFit(); + tablePublicVorlagen.getColumnModel().getColumn(2).sizeWidthToFit(); + tablePublicVorlagen.getColumnModel().getColumn(3).sizeWidthToFit(); + tablePublicVorlagen.getColumnModel().getColumn(4).sizeWidthToFit(); + tablePublicVorlagen.getColumnModel().getColumn(5).sizeWidthToFit(); + + scrollPanePublicVorlagen.setViewportView(tablePublicVorlagen); + tabbedPane.addTab("\u00D6ffentliche Vorlagen", null, + scrollPanePublicVorlagen, null); + tabbedPane.setEnabledAt(4, false); + { + JPanel buttonPane = new JPanel(); + buttonPane.setBounds(0, 640, 597, 33); + buttonPane.setBackground(SystemColor.menu); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + getContentPane().add(buttonPane); + { + JButton btnBack = new JButton("Zur\u00FCck"); + btnBack.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + // Öffnet das Hauptmenü + con.closeThriftConnection(); + MainMenue_GUI main = new MainMenue_GUI(); + main.setVisible(true); + dispose(); + } + }); + btnBack.setActionCommand("OK"); + buttonPane.add(btnBack); + getRootPane().setDefaultButton(btnBack); + } + } + + JSeparator separator = new JSeparator(); + separator.setBounds(0, 78, 597, 2); + getContentPane().add(separator); + + JSeparator separator_1 = new JSeparator(); + separator_1.setBounds(0, 627, 597, 2); + getContentPane().add(separator_1); + + JMenuBar menuBar = new JMenuBar(); + setJMenuBar(menuBar); + + JMenu mnNewMenu_1 = new JMenu("Hilfe"); + menuBar.add(mnNewMenu_1); + + JMenuItem mntmFaq = new JMenuItem("FAQ"); + mnNewMenu_1.add(mntmFaq); + + JMenuItem mntmOtrs = new JMenuItem("OTRS"); + mnNewMenu_1.add(mntmOtrs); + + } + + // Initiale Beffülung eines Table models + public DefaultTableModel initTableModel(DefaultTableModel model) { + List lectures; + try { + // Hole eine Liste der Images + lectures = client.getLectureList(); + Iterator i = lectures.iterator(); + + int x = 0; + + while (i.hasNext()) { + // erzeuge Objekte für die Tabelle + Object[] obj = { + lectures.get(x).lecturename, + lectures.get(x).desc, + lectures.get(x).starttime + " " + + lectures.get(x).endtime, + lectures.get(x).isActive, lectures.get(x).lastused, + lectures.get(x).username, " ", + lectures.get(x).imagename, lectures.get(x).id }; + // Füge diese Objekte der Tabelle hinzu + model.addRow(obj); + x++; + i.next(); + + } + + return model; + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + return model; + } + +} diff --git a/Dozentenmodul/src/gui/lecture/SearchMethodLecture_GUI.java b/Dozentenmodul/src/gui/lecture/SearchMethodLecture_GUI.java deleted file mode 100644 index ae31236a..00000000 --- a/Dozentenmodul/src/gui/lecture/SearchMethodLecture_GUI.java +++ /dev/null @@ -1,246 +0,0 @@ -package gui.lecture; - - -import gui.image.SearchImage_GUI; -import gui.intro.MainMenue_GUI; - -import java.awt.Color; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.SystemColor; -import java.awt.Toolkit; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; - -import javax.swing.ButtonGroup; -import javax.swing.JButton; -import javax.swing.JDialog; -import javax.swing.JFrame; -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.JSeparator; -import javax.swing.JTextArea; -import javax.swing.JTextPane; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.border.EmptyBorder; -import javax.swing.border.TitledBorder; - -@SuppressWarnings("serial") -public class SearchMethodLecture_GUI extends JFrame { - - private final JPanel contentPanel = new JPanel(); - String[] result; - JRadioButton rdbtnNachEinemVlimage; - JRadioButton rdbtnNachEinerVeranstaltung; - private final ButtonGroup buttonGroup = new ButtonGroup(); - /** - * Launch the application. - */ - public static void main(String[] args) { - try { - SearchMethodLecture_GUI dialog = new SearchMethodLecture_GUI(); - dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); - dialog.setVisible(true); - } catch (Exception e) { - e.printStackTrace(); - } - } - - /** - * Create the dialog. - */ - public SearchMethodLecture_GUI() { - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent arg0) { - System.exit(0); - } - }); - setResizable(false); - - try { - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException | InstantiationException - | IllegalAccessException | UnsupportedLookAndFeelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - setTitle("bwLehrpool Suite *Prototyp*"); - Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); - int top=(screenSize.height - 603) / 2; - int left=(screenSize.width - 722) / 2; - setBounds(left, top, 603, 722); - //setBounds(100, 100, 603, 722); - getContentPane().setLayout(null); - { - JPanel panel = new JPanel(); - panel.setBackground(SystemColor.menu); - panel.setBounds(10, 11, 577, 57); - getContentPane().add(panel); - panel.setLayout(null); - { - JLabel lblNewLabel = new JLabel("Eingabe Ihrer Daten"); - lblNewLabel.setBounds(10, 11, 509, 22); - panel.add(lblNewLabel); - lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 18)); - } - - JTextPane txtpnBitteWhlenSie = new JTextPane(); - txtpnBitteWhlenSie.setEditable(false); - txtpnBitteWhlenSie.setBackground(SystemColor.menu); - txtpnBitteWhlenSie.setText("Geben Sie hier bitte einen sprechenden Imagename sowie Ihre Kontaktdaten an"); - txtpnBitteWhlenSie.setBounds(10, 36, 509, 32); - panel.add(txtpnBitteWhlenSie); - } - contentPanel.setBounds(10, 85, 577, 493); - contentPanel.setBackground(SystemColor.menu); - contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); - getContentPane().add(contentPanel); - contentPanel.setLayout(null); - - JPanel panel_1 = new JPanel(); - panel_1.setBackground(SystemColor.menu); - panel_1.setBorder(new TitledBorder(null, "Wählen Sie bitte die Suchmethode Ihrer Suche", TitledBorder.LEADING, TitledBorder.TOP, null, null)); - panel_1.setBounds(10, 36, 557, 369); - contentPanel.add(panel_1); - panel_1.setLayout(null); - - rdbtnNachEinemVlimage = new JRadioButton("Nach einem VL-Image oder Vorlagen suchen"); - buttonGroup.add(rdbtnNachEinemVlimage); - rdbtnNachEinemVlimage.setBounds(6, 38, 545, 23); - panel_1.add(rdbtnNachEinemVlimage); - - JTextArea txtrHierKlickenWenn = new JTextArea(); - txtrHierKlickenWenn.setBackground(SystemColor.menu); - txtrHierKlickenWenn.setLineWrap(true); - txtrHierKlickenWenn.setFont(new Font("Tahoma", Font.PLAIN, 11)); - txtrHierKlickenWenn.setText("Hier klicken, wenn Sie nach einem konkreten Image suchen, von dem Sie exakte Daten kennen. Hierzu geh\u00F6ren z.B. das Betriebssystem oder die installierte Software.\r\nEs werden zudem alle Vorlagen aufgelistet."); - txtrHierKlickenWenn.setBounds(25, 68, 518, 80); - panel_1.add(txtrHierKlickenWenn); - - JTextArea txtrHierKlickenWenn_1 = new JTextArea(); - txtrHierKlickenWenn_1.setText("Hier klicken, wenn Sie nur wissen f\u00FCr welche Veranstaltung das gesuchte Image verwendet wird. Hierzu geh\u00F6ren z.B. der Name des Dozenten oder der Name der Veranstaltung."); - txtrHierKlickenWenn_1.setLineWrap(true); - txtrHierKlickenWenn_1.setFont(new Font("Tahoma", Font.PLAIN, 11)); - txtrHierKlickenWenn_1.setBackground(SystemColor.menu); - txtrHierKlickenWenn_1.setBounds(25, 210, 518, 80); - panel_1.add(txtrHierKlickenWenn_1); - - rdbtnNachEinerVeranstaltung = new JRadioButton("Nach einer Veranstaltung suchen"); - buttonGroup.add(rdbtnNachEinerVeranstaltung); - rdbtnNachEinerVeranstaltung.setBounds(6, 180, 545, 23); - panel_1.add(rdbtnNachEinerVeranstaltung); - - JPanel panel = new JPanel(); - panel.setBounds(10, 402, 577, 33); - contentPanel.add(panel); - panel.setLayout(null); - panel.setBorder(new EmptyBorder(5, 5, 5, 5)); - panel.setBackground(SystemColor.menu); - - JLabel lblHauptmen = new JLabel("Hauptmen\u00FC"); - lblHauptmen.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent arg0) { - - SearchMethodLecture_GUI.this.setVisible(false); - MainMenue_GUI main=new MainMenue_GUI(); - main.setVisible(true); - } - }); - lblHauptmen.setForeground(Color.BLUE); - lblHauptmen.setBounds(10, 11, 61, 14); - contentPanel.add(lblHauptmen); - - JLabel label_1 = new JLabel(">"); - label_1.setBounds(69, 11, 13, 14); - contentPanel.add(label_1); - - JLabel lblVlimage = new JLabel("VL-Image"); - lblVlimage.setForeground(Color.BLUE); - lblVlimage.setBounds(81, 11, 45, 14); - contentPanel.add(lblVlimage); - - JLabel label_2 = new JLabel(">"); - label_2.setBounds(133, 11, 13, 14); - contentPanel.add(label_2); - - JLabel lblNewLabel_1 = new JLabel("Suchmethode"); - lblNewLabel_1.setBounds(146, 11, 82, 14); - contentPanel.add(lblNewLabel_1); - { - JPanel buttonPane = new JPanel(); - buttonPane.setBounds(0, 640, 597, 33); - buttonPane.setBackground(SystemColor.menu); - buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - getContentPane().add(buttonPane); - { - JButton okButton = new JButton("Zur\u00FCck"); - okButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - MainMenue_GUI sr=new MainMenue_GUI(); - sr.setVisible(true); - dispose(); - } - }); - okButton.setActionCommand("OK"); - buttonPane.add(okButton); - getRootPane().setDefaultButton(okButton); - } - { - JButton cancelButton = new JButton("Weiter"); - cancelButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - - if(rdbtnNachEinemVlimage.isSelected()==true) - { - SearchImage_GUI ea=new SearchImage_GUI(); - ea.setVisible(true); - dispose(); - } - } - - }); - cancelButton.setActionCommand("Cancel"); - buttonPane.add(cancelButton); - } - } - - JSeparator separator = new JSeparator(); - separator.setBounds(0, 78, 597, 2); - getContentPane().add(separator); - - JSeparator separator_1 = new JSeparator(); - separator_1.setBounds(0, 627, 597, 2); - getContentPane().add(separator_1); - - JMenuBar menuBar = new JMenuBar(); - setJMenuBar(menuBar); - - JMenu mnNewMenu = new JMenu("Suchen"); - menuBar.add(mnNewMenu); - - JMenuItem mntmVlSuche = new JMenuItem("VL Suche"); - mnNewMenu.add(mntmVlSuche); - - JMenu mnNewMenu_1 = new JMenu("Hilfe"); - menuBar.add(mnNewMenu_1); - - JMenuItem mntmFaq = new JMenuItem("FAQ"); - mnNewMenu_1.add(mntmFaq); - - JMenuItem mntmOtrs = new JMenuItem("OTRS"); - mnNewMenu_1.add(mntmOtrs); - - } -} -- cgit v1.2.3-55-g7522