Refactoring frontend + commons + aggiunta tempi corretti
This commit is contained in:
parent
10595f5bab
commit
4760152e90
32 changed files with 676 additions and 558 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
);
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue