Refactoring frontend + commons + aggiunta tempi corretti

This commit is contained in:
Lorenzo Iovino 2017-07-13 03:31:54 +02:00
parent 10595f5bab
commit 4760152e90
32 changed files with 676 additions and 558 deletions

View file

@ -1,7 +1,8 @@
package constants;
/**
* Created by loke on 15/06/2017.
* Author: Lorenzo Iovino on 15/06/2017.
* Description: Config
*/
public class Config {
@ -16,25 +17,13 @@ public class Config {
public static String ScoreMulticastServerURI = "226.226.226.226";
public static String NotificationServerURI = "localhost";
public static Integer NotificationServerPort = 20000;
public static Integer NotificationServerStubPort = 5000;
public static String NotificationServerName ="notification";
public static int timeoutGame = 10;
public static String getNotificationServerURI(){
return "rmi://".concat(NotificationServerURI).concat(":").concat(NotificationServerPort.toString());
}
public static int timeoutGame = 120;
public static String getAuthServerURI(){
return "rmi://".concat(AuthServerURI).concat(":").concat(AuthServerPort.toString());
}
public static String getGameServerURI(){
return "tcp://".concat(GameServerURI).concat(":").concat(GameServerPort.toString());
}
}

View file

@ -3,14 +3,17 @@ package constants;
import java.awt.*;
/**
* Created by loke on 13/06/2017.
* Author: Lorenzo Iovino on 13/06/2017.
* Description: Palette and Styles
*/
public class Palette {
public static Color root_backgroundColor = new Color(145,181,88);
public static Color inputBox_backgroundColor = new Color(250,250,250); //"#FAFAFA;
public static Color button_backgroundColor = new Color(105,130,63); //#69823f
public static Font inputBox_font = new Font("Arial Black", Font.BOLD, 20);
public static Font password_font = new Font("Arial Black", Font.BOLD, 26);
public static Font textFont = new Font("DK Trained Monkey", Font.BOLD, 20);
public static Font inputboxFont = new Font("DK Trained Monkey", Font.BOLD, 18);
public static Font numberFont = new Font("Arial Black", Font.BOLD, 20);
public static Color fontColor = new Color(95,0,0);
public static Color registerLblBtn_color = new Color(95,0,0);
public static Color registerLblBtn_onmouseover_color = new Color(95,0,0, 127);
@ -18,11 +21,5 @@ public class Palette {
public static Color scrollPanel_backgroundColor = new Color(220,229,207);
public static Color dialog_alert = Color.red;
public static Color dialog_success = new Color(53,66,32);
public static Font button_font = new Font("DK Trained Monkey", Font.BOLD, 25);
public Palette() {
//TODO fetchare dal server questi dati
}
}

View file

@ -1,15 +1,15 @@
package interfaces;
import models.Response;
import models.Response;
import java.rmi.Remote;
import java.rmi.RemoteException;
/**
* Created by loke on 15/06/2017.
* Author: Lorenzo Iovino on 15/06/2017.
* Description: IAuth
*/
public interface IAuth extends Remote {
Response login(String userName, String password) throws RemoteException;
Response register(String userName, String password) throws RemoteException;
Response logout(String userName, String token, INotificationClient stub) throws RemoteException;
}

View file

@ -5,7 +5,8 @@ import java.rmi.Remote;
import java.rmi.RemoteException;
/**
* Created by loke on 19/06/2017.
* Author: Lorenzo Iovino on 19/06/2017.
* Description: INotificationClient
*/
public interface INotificationClient extends Remote{
void sendInvite(String userName, DefaultListModel<String> users) throws RemoteException;

View file

@ -4,13 +4,10 @@ import java.rmi.Remote;
import java.rmi.RemoteException;
/**
* Created by loke on 19/06/2017.
* Author: Lorenzo Iovino on 19/06/2017.
* Description: Main
*/
public interface INotificationServer extends Remote {
/* registrazione per la callback */
public void registerForCallback (INotificationClient ClientInterface) throws RemoteException;
/* cancella registrazione per la callback */
public void unregisterForCallback (INotificationClient ClientInterface) throws RemoteException;
void registerForCallback (INotificationClient ClientInterface) throws RemoteException;
void unregisterForCallback (INotificationClient ClientInterface) throws RemoteException;
}

View file

@ -2,11 +2,11 @@ package models;
import javax.swing.*;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.regex.Pattern;
/**
* Created by loke on 18/06/2017.
* Author: Lorenzo Iovino on 18/06/2017.
* Description: Main
*/
public class Message implements Serializable {
public String sender;

View file

@ -1,9 +1,11 @@
package models;
import org.json.simple.JsonObject;
import java.io.Serializable;
/**
* Created by loke on 15/06/2017.
* Author: Lorenzo Iovino on 15/06/2017.
* Description: Response
*/
public class Response implements Serializable{
public String message;

View file

@ -1,7 +1,8 @@
package models;
/**
* Created by loke on 17/06/2017.
* Author: Lorenzo Iovino on 17/06/2017.
* Description: Main
*/
public class Session {
@ -12,5 +13,4 @@ public class Session {
this.token = token;
this.account = account;
}
}

View file

@ -3,7 +3,8 @@ package models;
import java.io.Serializable;
/**
* Created by loke on 18/06/2017.
* Author: Lorenzo Iovino on 18/06/2017.
* Description: Main
*/
public class User implements Serializable{
@ -20,6 +21,4 @@ public class User implements Serializable{
public void addScore(Integer score){
this.score += score;
}
}

View file

@ -3,6 +3,7 @@ package utilities;
import javafx.util.Pair;
import javax.swing.*;
/**
* Author: Lorenzo Iovino on 12/07/2017.
* Description: This is a module of parse utilities for different purposes