Browse Source

timeControl instead of format

master
GAM 4 years ago
parent
commit
e0e2089190
6 changed files with 94 additions and 81 deletions
  1. +60
    -60
      db/db_init.sql
  2. +8
    -8
      src/main/java/com/example/application/data/entity/GameInfo.java
  3. +1
    -1
      src/main/java/com/example/application/data/service/ChessComService.java
  4. +14
    -3
      src/main/java/com/example/application/views/results/MatchView.java
  5. +1
    -1
      src/main/java/com/example/application/views/results/MatchdayView.java
  6. +10
    -8
      src/main/java/com/example/application/views/results/ResultsView.java

+ 60
- 60
db/db_init.sql View File

@ -41,7 +41,7 @@ CREATE TABLE "game" (
CREATE TABLE "game_info" (
"id" SERIAL PRIMARY KEY,
"format" int,
"time_control" varchar,
"url" varchar
);
@ -357,136 +357,136 @@ INSERT INTO "match" ("player1", "player2", "matchday") VALUES ( 9, 5, 26);
INSERT INTO "match" ("player1", "player2", "matchday") VALUES ( 7, 13, 26);
INSERT INTO "match" ("player1", "player2", "matchday") VALUES (14, 2, 26);
INSERT INTO "game_info" (format, url) VALUES (10, 'https://www.chess.com/live/game/8722014513');
INSERT INTO "game_info" (time_control, url)VALUES ('600', 'https://www.chess.com/live/game/8722014513');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=2 AND player2=9 AND matchday=1), TRUE, 1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8722014513'));
INSERT INTO "game_info" (format, url) VALUES (10, 'https://www.chess.com/live/game/8723231941');
INSERT INTO "game_info" (time_control, url)VALUES ('600', 'https://www.chess.com/live/game/8723231941');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=2 AND player2=9 AND matchday=1), FALSE, 1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8723231941'));
INSERT INTO "game_info" (format, url) VALUES (5, 'https://www.chess.com/live/game/8724907847');
INSERT INTO "game_info" (time_control, url)VALUES ('300', 'https://www.chess.com/live/game/8724907847');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=2 AND player2=9 AND matchday=1), TRUE, -1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8724907847'));
INSERT INTO "game_info" (format, url) VALUES (5, 'https://www.chess.com/live/game/8725036665');
INSERT INTO "game_info" (time_control, url)VALUES ('300', 'https://www.chess.com/live/game/8725036665');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=2 AND player2=9 AND matchday=1), FALSE, 1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8725036665'));
INSERT INTO "game_info" (format, url) VALUES (3, 'https://www.chess.com/live/game/8725614379');
INSERT INTO "game_info" (time_control, url)VALUES ('180', 'https://www.chess.com/live/game/8725614379');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=2 AND player2=9 AND matchday=1), TRUE, 1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8725614379'));
INSERT INTO "game_info" (format, url) VALUES (3, 'https://www.chess.com/live/game/8726184583');
INSERT INTO "game_info" (time_control, url)VALUES ('180', 'https://www.chess.com/live/game/8726184583');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=2 AND player2=9 AND matchday=1), FALSE, 1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8726184583'));
INSERT INTO "game_info" (format, url) VALUES (10, 'https://www.chess.com/live/game/8616485043');
INSERT INTO "game_info" (time_control, url)VALUES ('600', 'https://www.chess.com/live/game/8616485043');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=14 AND player2=7 AND matchday=1), TRUE, 1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8616485043'));
INSERT INTO "game_info" (format, url) VALUES (10, 'https://www.chess.com/live/game/8618149677');
INSERT INTO "game_info" (time_control, url)VALUES ('600', 'https://www.chess.com/live/game/8618149677');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=14 AND player2=7 AND matchday=1), FALSE, -1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8618149677'));
INSERT INTO "game_info" (format, url) VALUES (5, 'https://www.chess.com/live/game/8702757001');
INSERT INTO "game_info" (time_control, url)VALUES ('300', 'https://www.chess.com/live/game/8702757001');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=14 AND player2=7 AND matchday=1), FALSE, -1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8702757001'));
INSERT INTO "game_info" (format, url) VALUES (5, 'https://www.chess.com/live/game/8705204521');
INSERT INTO "game_info" (time_control, url)VALUES ('300', 'https://www.chess.com/live/game/8705204521');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=14 AND player2=7 AND matchday=1), TRUE, 1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8705204521'));
INSERT INTO "game_info" (format, url) VALUES (3, 'https://www.chess.com/live/game/8705796221');
INSERT INTO "game_info" (time_control, url)VALUES ('180', 'https://www.chess.com/live/game/8705796221');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=14 AND player2=7 AND matchday=1), FALSE, -1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8705796221'));
INSERT INTO "game_info" (format, url) VALUES (3, 'https://www.chess.com/live/game/8706438057');
INSERT INTO "game_info" (time_control, url)VALUES ('180', 'https://www.chess.com/live/game/8706438057');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=14 AND player2=7 AND matchday=1), TRUE, 1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8706438057'));
INSERT INTO "game_info" (format, url) VALUES (10, 'https://www.chess.com/live/game/8617630129');
INSERT INTO "game_info" (time_control, url)VALUES ('600', 'https://www.chess.com/live/game/8617630129');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=10 AND player2=4 AND matchday=1), TRUE, 1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8617630129'));
INSERT INTO "game_info" (format, url) VALUES (10, 'https://www.chess.com/live/game/8618225533');
INSERT INTO "game_info" (time_control, url)VALUES ('600', 'https://www.chess.com/live/game/8618225533');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=10 AND player2=4 AND matchday=1), FALSE, 1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8618225533'));
INSERT INTO "game_info" (format, url) VALUES (5, 'https://www.chess.com/live/game/8619306585');
INSERT INTO "game_info" (time_control, url)VALUES ('300', 'https://www.chess.com/live/game/8619306585');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=10 AND player2=4 AND matchday=1), TRUE, -1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8619306585'));
INSERT INTO "game_info" (format, url) VALUES (5, 'https://www.chess.com/live/game/8619471075');
INSERT INTO "game_info" (time_control, url)VALUES ('300', 'https://www.chess.com/live/game/8619471075');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=10 AND player2=4 AND matchday=1), FALSE, 1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8619471075'));
INSERT INTO "game_info" (format, url) VALUES (3, 'https://www.chess.com/live/game/8620078695');
INSERT INTO "game_info" (time_control, url)VALUES ('180', 'https://www.chess.com/live/game/8620078695');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=10 AND player2=4 AND matchday=1), TRUE, -1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8620078695'));
INSERT INTO "game_info" (format, url) VALUES (3, 'https://www.chess.com/live/game/8620568591');
INSERT INTO "game_info" (time_control, url)VALUES ('180', 'https://www.chess.com/live/game/8620568591');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=10 AND player2=4 AND matchday=1), FALSE, 1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8620568591'));
INSERT INTO "game_info" (format, url) VALUES (10, 'https://www.chess.com/live/game/8504667551');
INSERT INTO "game_info" (time_control, url)VALUES ('600', 'https://www.chess.com/live/game/8504667551');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=13 AND player2=6 AND matchday=1), TRUE, 0, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8504667551'));
INSERT INTO "game_info" (format, url) VALUES (10, 'https://www.chess.com/live/game/8505882389');
INSERT INTO "game_info" (time_control, url)VALUES ('600', 'https://www.chess.com/live/game/8505882389');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=13 AND player2=6 AND matchday=1), FALSE, -1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8505882389'));
INSERT INTO "game_info" (format, url) VALUES (5, 'https://www.chess.com/live/game/8507004247');
INSERT INTO "game_info" (time_control, url)VALUES ('300', 'https://www.chess.com/live/game/8507004247');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=13 AND player2=6 AND matchday=1), TRUE, -1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8507004247'));
INSERT INTO "game_info" (format, url) VALUES (5, 'https://www.chess.com/live/game/8507617133');
INSERT INTO "game_info" (time_control, url)VALUES ('300', 'https://www.chess.com/live/game/8507617133');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=13 AND player2=6 AND matchday=1), FALSE, -1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8507617133'));
INSERT INTO "game_info" (format, url) VALUES (3, 'https://www.chess.com/live/game/8508203475');
INSERT INTO "game_info" (time_control, url)VALUES ('180', 'https://www.chess.com/live/game/8508203475');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=13 AND player2=6 AND matchday=1), TRUE, 1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8508203475'));
INSERT INTO "game_info" (format, url) VALUES (3, 'https://www.chess.com/live/game/8508297031');
INSERT INTO "game_info" (time_control, url)VALUES ('180', 'https://www.chess.com/live/game/8508297031');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=13 AND player2=6 AND matchday=1), FALSE, -1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8508297031'));
INSERT INTO "game_info" (format, url) VALUES (10, 'https://www.chess.com/live/game/8624735639');
INSERT INTO "game_info" (time_control, url)VALUES ('600', 'https://www.chess.com/live/game/8624735639');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=11 AND player2=8 AND matchday=1), FALSE, 1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8624735639'));
INSERT INTO "game_info" (format, url) VALUES (10, 'https://www.chess.com/live/game/8625353555');
INSERT INTO "game_info" (time_control, url)VALUES ('600', 'https://www.chess.com/live/game/8625353555');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=11 AND player2=8 AND matchday=1), TRUE, -1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8625353555'));
INSERT INTO "game_info" (format, url) VALUES (5, 'https://www.chess.com/live/game/8625963087');
INSERT INTO "game_info" (time_control, url)VALUES ('300', 'https://www.chess.com/live/game/8625963087');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=11 AND player2=8 AND matchday=1), FALSE, 1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8625963087'));
INSERT INTO "game_info" (format, url) VALUES (5, 'https://www.chess.com/live/game/8853361491');
INSERT INTO "game_info" (time_control, url)VALUES ('300', 'https://www.chess.com/live/game/8853361491');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=11 AND player2=8 AND matchday=1), TRUE, -1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8853361491'));
INSERT INTO "game_info" (format, url) VALUES (3, 'https://www.chess.com/live/game/8853455035');
INSERT INTO "game_info" (time_control, url)VALUES ('180', 'https://www.chess.com/live/game/8853455035');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=11 AND player2=8 AND matchday=1), FALSE, 1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8853455035'));
INSERT INTO "game_info" (format, url) VALUES (3, 'https://www.chess.com/live/game/8854002505');
INSERT INTO "game_info" (time_control, url)VALUES ('180', 'https://www.chess.com/live/game/8854002505');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=11 AND player2=8 AND matchday=1), TRUE, -1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8854002505'));
INSERT INTO "game_info" (format, url) VALUES (10, 'https://www.chess.com/live/game/8858219835');
INSERT INTO "game_info" (time_control, url)VALUES ('600', 'https://www.chess.com/live/game/8858219835');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=12 AND player2=1 AND matchday=1), FALSE, -1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8858219835'));
INSERT INTO "game_info" (format, url) VALUES (10, 'https://www.chess.com/live/game/8859375675');
INSERT INTO "game_info" (time_control, url)VALUES ('600', 'https://www.chess.com/live/game/8859375675');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=12 AND player2=1 AND matchday=1), TRUE, 1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8859375675'));
INSERT INTO "game_info" (format, url) VALUES (5, 'https://www.chess.com/live/game/8859976305');
INSERT INTO "game_info" (time_control, url)VALUES ('300', 'https://www.chess.com/live/game/8859976305');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=12 AND player2=1 AND matchday=1), FALSE, 1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8859976305'));
INSERT INTO "game_info" (format, url) VALUES (5, 'https://www.chess.com/live/game/8860591347');
INSERT INTO "game_info" (time_control, url)VALUES ('300', 'https://www.chess.com/live/game/8860591347');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=12 AND player2=1 AND matchday=1), TRUE, 1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8860591347'));
INSERT INTO "game_info" (format, url) VALUES (3, 'https://www.chess.com/live/game/8860675419');
INSERT INTO "game_info" (time_control, url)VALUES ('180', 'https://www.chess.com/live/game/8860675419');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=12 AND player2=1 AND matchday=1), FALSE, -1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8860675419'));
INSERT INTO "game_info" (format, url) VALUES (3, 'https://www.chess.com/live/game/8861228997');
INSERT INTO "game_info" (time_control, url)VALUES ('180', 'https://www.chess.com/live/game/8861228997');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=12 AND player2=1 AND matchday=1), TRUE, 1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8861228997'));
INSERT INTO "game_info" (format, url) VALUES (10, 'https://www.chess.com/live/game/8877523129');
INSERT INTO "game_info" (time_control, url)VALUES ('600', 'https://www.chess.com/live/game/8877523129');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=5 AND player2=3 AND matchday=1), FALSE, 1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8877523129'));
INSERT INTO "game_info" (format, url) VALUES (10, 'https://www.chess.com/live/game/8878652939');
INSERT INTO "game_info" (time_control, url)VALUES ('600', 'https://www.chess.com/live/game/8878652939');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=5 AND player2=3 AND matchday=1), TRUE, 1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8878652939'));
INSERT INTO "game_info" (format, url) VALUES (5, 'https://www.chess.com/live/game/8879853665');
INSERT INTO "game_info" (time_control, url)VALUES ('300', 'https://www.chess.com/live/game/8879853665');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=5 AND player2=3 AND matchday=1), FALSE, 1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8879853665'));
INSERT INTO "game_info" (format, url) VALUES (5, 'https://www.chess.com/live/game/8880469509');
INSERT INTO "game_info" (time_control, url)VALUES ('300', 'https://www.chess.com/live/game/8880469509');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=5 AND player2=3 AND matchday=1), TRUE, 1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8880469509'));
INSERT INTO "game_info" (format, url) VALUES (3, 'https://www.chess.com/live/game/8881562307');
INSERT INTO "game_info" (time_control, url)VALUES ('180', 'https://www.chess.com/live/game/8881562307');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=5 AND player2=3 AND matchday=1), FALSE, -1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8881562307'));
INSERT INTO "game_info" (format, url) VALUES (3, 'https://www.chess.com/live/game/8881610243');
INSERT INTO "game_info" (time_control, url)VALUES ('180', 'https://www.chess.com/live/game/8881610243');
INSERT INTO "game" (match, player1_is_white, result, info) VALUES ((SELECT id from match WHERE player1=5 AND player2=3 AND matchday=1), TRUE, -1, (SELECT id from game_info WHERE url='https://www.chess.com/live/game/8881610243'));


+ 8
- 8
src/main/java/com/example/application/data/entity/GameInfo.java View File

@ -9,7 +9,7 @@ public class GameInfo {
private Integer id;
private String url;
private Game game;
private Integer format;
private String timeControl;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ -33,13 +33,13 @@ public class GameInfo {
}
@Basic
@Column(name = "format", nullable = false)
public Integer getFormat() {
return format;
@Column(name = "time_control", nullable = false)
public String getTimeControl() {
return timeControl;
}
public void setFormat(Integer format) {
this.format = format;
public void setTimeControl(String format) {
this.timeControl = format;
}
@Override
@ -47,12 +47,12 @@ public class GameInfo {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
GameInfo that = (GameInfo) o;
return Objects.equals(id, that.id) && Objects.equals(url, that.url) && Objects.equals(format, that.format);
return Objects.equals(id, that.id) && Objects.equals(url, that.url) && Objects.equals(timeControl, that.timeControl);
}
@Override
public int hashCode() {
return Objects.hash(id, url, format);
return Objects.hash(id, url, timeControl);
}
@OneToOne(mappedBy = "gameInfo")


+ 1
- 1
src/main/java/com/example/application/data/service/ChessComService.java View File

@ -72,7 +72,7 @@ public class ChessComService {
game.setGameInfo(gameInfo);
gameInfo.setUrl(chessComGame.getUrl());
gameInfo.setFormat(Integer.parseInt(chessComGame.getTimeControl())/60); // TODO: change gameinfo.format in database to reflect this!
gameInfo.setTimeControl(chessComGame.getTimeControl());
gameInfo.setGame(game);
return game; // important: match is not set here!


+ 14
- 3
src/main/java/com/example/application/views/results/MatchView.java View File

@ -6,19 +6,30 @@ import com.vaadin.flow.component.html.Label;
public class MatchView extends Div {
private final ResultsView parent;
private final Navigation navigation;
private final Label label = new Label();
// private final ChessComService chessComService;
// private final PlayerService playerService;
// public ResultsViewRight(@Autowired ChessComService chessComService, @Autowired PlayerService playerService) {
public MatchView(Navigation navigation) {
// public ResultsViewRight(@Autowired ChessComService chessComService, @Autowired PlayerService playerService) {
public MatchView(Navigation navigation, ResultsView resultsView) {
this.parent = resultsView;
this.navigation = navigation;
navigation.addRunnableToBeRunAfterMatchSelection(()-> label.setText(navigation.getSelectedMatch().toString()));
navigation.addRunnableToBeRunAfterMatchSelection(() -> label.setText(navigation.getSelectedMatch().toString()));
navigation.addRunnableToBeRunAfterMatchSelection(this::configureSplit);
add(label);
// this.chessComService = chessComService;
// this.playerService = playerService;
}
private void configureSplit() {
navigation.getSelectedMatch().ifPresentOrElse(
match -> parent.enableSplit(),
parent::disableSplit
);
}
}

+ 1
- 1
src/main/java/com/example/application/views/results/MatchdayView.java View File

@ -50,7 +50,7 @@ public class MatchdayView extends VerticalLayout {
// LAYOUT //
////////////
protected void configureContentLayout() {
private void configureContentLayout() {
setWidthFull();
setHeightFull();
setAlignItems(FlexComponent.Alignment.CENTER);


+ 10
- 8
src/main/java/com/example/application/views/results/ResultsView.java View File

@ -31,33 +31,35 @@ public class ResultsView extends Div implements HasUrlParameter<String> {
this.navigation.setAutoselectSeason(true);
this.navigation.setAutoselectMatchday(true);
this.matchdayView = new MatchdayView(navigation, matchService);
this.matchView = new MatchView(navigation);
this.matchView = new MatchView(navigation, this);
addClassName("results-view");
configureLayout();
// disableSplit();
enableSplit();
disableSplit();
// enableSplit();
}
public void enableSplit() {
removeAll();
add(splitLayout);
splitLayout.addToPrimary(matchdayView);
splitLayout.addToSecondary(matchView);
splitLayout.setWidthFull();
splitLayout.setHeightFull();
splitLayout.setSplitterPosition(50);
}
public void disableSplit() {
removeAll();
add(matchdayView);
matchdayView.setWidthFull();
matchdayView.setHeightFull();
}
private void configureLayout() {
setWidthFull();
setHeightFull();
splitLayout.addToPrimary(matchdayView);
splitLayout.addToSecondary(matchView);
splitLayout.setWidthFull();
splitLayout.setHeightFull();
}
@Override


Loading…
Cancel
Save