summaryrefslogtreecommitdiffstats
path: root/Dozentenmodul/src/gui/intro/Login_GUI.java
diff options
context:
space:
mode:
authorMichael Wilson2014-08-22 10:09:24 +0200
committerMichael Wilson2014-08-22 10:09:24 +0200
commitcc780d2ed729bd5ad183a5b79071125482e517e2 (patch)
treeaa1b395308a3f04a0cf73ea233256f26c9af1c47 /Dozentenmodul/src/gui/intro/Login_GUI.java
parentZahlen sind im Imagenamen erlaubt (diff)
downloadtutor-module-cc780d2ed729bd5ad183a5b79071125482e517e2.tar.gz
tutor-module-cc780d2ed729bd5ad183a5b79071125482e517e2.tar.xz
tutor-module-cc780d2ed729bd5ad183a5b79071125482e517e2.zip
Ausgaben im Loginbereich verbessert
Diffstat (limited to 'Dozentenmodul/src/gui/intro/Login_GUI.java')
-rw-r--r--Dozentenmodul/src/gui/intro/Login_GUI.java40
1 files changed, 25 insertions, 15 deletions
diff --git a/Dozentenmodul/src/gui/intro/Login_GUI.java b/Dozentenmodul/src/gui/intro/Login_GUI.java
index a26b80c9..e0458cae 100644
--- a/Dozentenmodul/src/gui/intro/Login_GUI.java
+++ b/Dozentenmodul/src/gui/intro/Login_GUI.java
@@ -104,9 +104,6 @@ public class Login_GUI extends JFrame {
| IllegalAccessException | UnsupportedLookAndFeelException e) {
// TODO Auto-generated catch block
e.printStackTrace();
- JOptionPane.showMessageDialog(null,
- e.getCause() + "\n" + e.getStackTrace(), "Debug-Message",
- JOptionPane.ERROR_MESSAGE);
}
// Titel des Fensters setzen
setTitle("bwLehrpool Suite");
@@ -219,7 +216,7 @@ public class Login_GUI extends JFrame {
lblConnectionInfo.setHorizontalAlignment(SwingConstants.LEFT);
- lblConnectionInfo.setBounds(292, 290, 237, 20);
+ lblConnectionInfo.setBounds(111, 290, 418, 20);
contentPane.add(lblConnectionInfo);
@@ -242,21 +239,39 @@ public class Login_GUI extends JFrame {
// check if client has received a connection with information or a
// null package
if (checkClientPackage() == true) {
- // package has information
+
+ // package has information
+ //User-Info
System.out.println("Authentifiziere - warte auf Masterserver");
+ lblConnectionInfo.setForeground(Color.black);
+ lblConnectionInfo.setText("Authentifiziere - warte auf Antwort von Server...");
result = client.authenticate(lblusername.getText(), passText);
+
+ //User-Info
System.out.println("Authentifizierung erfolgreich");
+ lblConnectionInfo.setForeground(Color.green);
+ lblConnectionInfo.setText("Authentifizierung erfolgreich");
+
+ //set Information
SessionData.session.setAuthToken(result.authToken);
SessionData.session.setSessionID(result.sessionId);
SessionData.session.setServerAdress(result.serverAddress);
+
+ //User-Info
+ lblConnectionInfo.setForeground(Color.black);
+ lblConnectionInfo.setText("Hole Verbindungsdaten von Server...");
System.out.println("warte auf Masterserver");
// set connection to bwLehrpoolSuiteServer
ThriftConnection bwthrift = new ThriftConnection();
server.Server.Client bwClient = bwthrift.getThriftConnection();
models.Client.clientcon.setClient(bwClient);
+
+ //User-Info
System.out.println("Client macht weiter");
System.out.println("Session-ID: " + result.sessionId
+ "\nToken: " + result.authToken);
+ lblConnectionInfo.setForeground(Color.green);
+ lblConnectionInfo.setText("Daten erhalten.");
if (login == true) {
//Daten speichern
@@ -325,9 +340,7 @@ public class Login_GUI extends JFrame {
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
- JOptionPane.showMessageDialog(null, e.getCause() + "\n"
- + e.getStackTrace(), "Debug-Message",
- JOptionPane.ERROR_MESSAGE);
+
}
} else {
@@ -345,6 +358,9 @@ public class Login_GUI extends JFrame {
}
} catch (thrift.AuthenticationException e) {
+ lblConnectionInfo.setForeground(Color.red);
+ lblConnectionInfo
+ .setText("Fehler: Falscher Benutzername oder Passwort.");
System.out
.println("Authentifizierung fehlgeschlagen: " + e.message);
JOptionPane
@@ -354,17 +370,11 @@ public class Login_GUI extends JFrame {
"Anmeldung fehlgeschlagen",
JOptionPane.ERROR_MESSAGE);
e.printStackTrace();
- //JOptionPane.showMessageDialog(null,
- // e.getCause() + "\n" + e.getStackTrace(), "Message",
- // JOptionPane.ERROR_MESSAGE);
return;
} catch (TException e) {
// TODO Auto-generated catch block
e.printStackTrace();
- JOptionPane.showMessageDialog(null,
- e.getCause() + "\n" + e.getStackTrace(), "Debug-Message",
- JOptionPane.ERROR_MESSAGE);
- return;
+
}
}// end performLogin