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

@ -97,7 +97,7 @@ public class GamePage extends Page {
public void showGameIsReadyAlert(){
//Mostra pannello di conferma che le lettere sono tutte arrivate
new TTDialog("success", "GameService is ready. Press OK to start!",
new TTDialog("success", "<html>Game is ready. <br/>Press OK to start!</html>",
new Callable() {
@Override
public Object call() throws Exception {
@ -133,12 +133,12 @@ public class GamePage extends Page {
timer = addTimer(
footer,
new Font(Palette.inputBox_font.getFontName(), Font.BOLD, 40),
new Font(Palette.numberFont.getFontName(), Font.BOLD, 35),
gameController.timeIsOver(new SwingWorker() {
@Override
protected Object doInBackground() throws Exception {
new HighscoresPage(window,true);
return null;
new HighscoresPage(window,true);
return null;
}
}),
Config.timeoutGame

View file

@ -58,10 +58,10 @@ public class HighscoresPage extends Page{
);
new TTLabel(
this.isPartialScore ? new Point(150,0) : new Point(200,0),
this.isPartialScore ? new Point(120,0) : new Point(200,0),
new Dimension(350,50),
this.isPartialScore ? "Scores of the match" : "Highscores",
new Font(Palette.inputBox_font.getFontName(), Font.ITALIC, 38),
new Font(Palette.textFont.getFontName(), Font.ITALIC, 34),
null,
highscoreContainer
);

View file

@ -78,7 +78,7 @@ public class HomePage extends Page {
new Point(70,200),
new Dimension(350,50),
"Don't have an account?",
new Font(Palette.inputBox_font.getFontName(), Font.ITALIC, 24),
new Font(Palette.textFont.getFontName(), Font.ITALIC, 26),
null,
loginDataContainer
);
@ -87,7 +87,7 @@ public class HomePage extends Page {
new Point(360, 200),
new Dimension(210, 50),
"Register!",
new Font(Palette.inputBox_font.getFontName(), Font.BOLD, 34),
new Font(Palette.textFont.getFontName(), Font.BOLD, 30),
null,
new Callable<Object>() {
@Override

View file

@ -40,7 +40,7 @@ public class MatchRequestsPage extends Page{
new Point(150,0),
new Dimension(350,50),
"Pending matches",
new Font(Palette.inputBox_font.getFontName(), Font.ITALIC, 38),
new Font(Palette.textFont.getFontName(), Font.ITALIC, 34),
null,
matchsContainer
);

View file

@ -35,10 +35,10 @@ public class MatchSetupPage extends Page{
);
new TTLabel(
new Point(170,0),
new Point(160,0),
new Dimension(350,50),
"Invite players",
new Font(Palette.inputBox_font.getFontName(), Font.ITALIC, 38),
new Font(Palette.textFont.getFontName(), Font.ITALIC, 38),
null,
matchSetupContainer
);

View file

@ -39,7 +39,7 @@ public class MenuPage extends Page{
new Point(25,15),
new Dimension(350,20),
"Welcome back, " + menuController.getSession().account.userName + "!",
new Font(Palette.inputBox_font.getFontName(), Font.ITALIC, 24),
new Font(Palette.textFont.getFontName(), Font.ITALIC, 24),
null,
menuBar
);
@ -47,7 +47,7 @@ public class MenuPage extends Page{
new TTButton(
new Point(25,70),
new Dimension(250,75),
"New GameService!",
"New Game!",
new Callable<Object>() {
@Override
public Object call() throws Exception {

View file

@ -83,8 +83,7 @@ public class Page {
new TTLabelBtn(
new Point(500, 0),
new Dimension(150, 50),
caption,
null,
caption, new Font(Palette.textFont.getFontName(), Font.ITALIC, 34),
null,
clickHandler,
parent);

View file

@ -37,7 +37,7 @@ public class RegisterPage extends Page {
new Point(70,35),
new Dimension(400,40),
"Insert your datas and press Register!",
new Font(Palette.inputBox_font.getFontName(), Font.ITALIC, 12),
new Font(Palette.textFont.getFontName(), Font.ITALIC, 20),
null,
registerDataContainer
);

View file

@ -22,7 +22,7 @@ public class TTContainer extends JPanel{
}
setBackground(backgroundColor != null ? backgroundColor : new Color(0,0,0,0));
setFont(Palette.inputBox_font);
setFont(Palette.textFont);
setMaximumSize(dimension);
if(innerPadding != null) {
setLocation(innerPadding);

View file

@ -34,7 +34,6 @@ public class TTDialog extends JFrame {
switch (type){
case "alert":{
root.setBorder(BorderFactory.createLineBorder(Palette.dialog_alert));
}
case "success": {
root.setBorder(BorderFactory.createLineBorder(Palette.dialog_success));
@ -46,7 +45,7 @@ public class TTDialog extends JFrame {
new Point(60,20),
new Dimension(350,50),
message,
new Font(Palette.inputBox_font.getFontName(), Font.ITALIC, 38),
new Font(Palette.textFont.getFontName(), Font.ITALIC, 24),
null,
root);

View file

@ -21,7 +21,7 @@ public class TTGameBox extends TTInputField{
super(position, dimension, placeholder, parent);
setBackground(Palette.scrollPanel_backgroundColor);
setFont(Palette.inputBox_font);
setFont(Palette.inputboxFont);
setBounds(position.x, position.y, dimension.width, dimension.height);
setPreferredSize(dimension);
setForeground(Palette.fontColor);
@ -39,7 +39,6 @@ public class TTGameBox extends TTInputField{
e1.printStackTrace();
}
}
//Every time i press a key, execute a search of users
}
});

View file

@ -14,7 +14,7 @@ public class TTInputField extends TTInputBox{
super();
setBackground(Palette.inputBox_backgroundColor);
setFont(Palette.inputBox_font);
setFont(Palette.textFont);
setBounds(position.x, position.y, dimension.width, dimension.height);
setPreferredSize(dimension);
setForeground(Palette.fontColor);

View file

@ -16,7 +16,7 @@ public class TTLabel extends JLabel{
setBackground(Palette.inputBox_backgroundColor);
if(font == null) {
setFont(Palette.inputBox_font);
setFont(Palette.textFont);
} else {
setFont(font);
}

View file

@ -14,7 +14,7 @@ public class TTLetter extends TTLabel{
super(position,
new Dimension(50,50),
caption,
new Font(Palette.inputBox_font.getFontName(), Font.ITALIC, 20),
new Font(Palette.textFont.getFontName(), Font.ITALIC, 30),
Palette.fontColor,
parent);
parent.add(this);

View file

@ -17,7 +17,7 @@ public class TTPasswordField extends JPasswordField{
super();
setBackground(Palette.inputBox_backgroundColor);
setFont(Palette.inputBox_font);
setFont(Palette.textFont);
setBounds(position.x, position.y, dimension.width, dimension.height);
setPreferredSize(dimension);
setForeground(Palette.fontColor);

View file

@ -13,7 +13,7 @@ public class TTScrollList extends JList {
public TTScrollList(Point position, Dimension dimension, ListModel listModel, JPanel parent){
super(listModel);
setBackground(Palette.scrollPanel_backgroundColor);
setFont(Palette.inputBox_font);
setFont(Palette.numberFont);
setBounds(position.x, position.y, dimension.width, dimension.height);
setForeground(Palette.fontColor);

View file

@ -40,7 +40,7 @@ public class TTSearchBar extends TTContainer{
super(position, dimension, Palette.inputBox_backgroundColor, -1, parent);
setBackground(Palette.scrollPanel_backgroundColor);
setFont(Palette.inputBox_font);
setFont(Palette.textFont);
setBounds(position.x, position.y, dimension.width, dimension.height);
setPreferredSize(dimension);
setForeground(Palette.fontColor);
@ -49,7 +49,7 @@ public class TTSearchBar extends TTContainer{
new Point(20,40),
new Dimension(350,50),
"Add player",
new Font(Palette.inputBox_font.getFontName(), Font.ITALIC, 18),
new Font(Palette.textFont.getFontName(), Font.ITALIC, 18),
null,
parent);
@ -70,7 +70,7 @@ public class TTSearchBar extends TTContainer{
new Point(305,40),
new Dimension(350,50),
"Double-Click on item for remove",
new Font(Palette.inputBox_font.getFontName(), Font.ITALIC, 18),
new Font(Palette.textFont.getFontName(), Font.ITALIC, 18),
null,
parent);