|
@ -1,7 +1,6 @@ |
|
|
package com.example.application.views.results; |
|
|
package com.example.application.views.results; |
|
|
|
|
|
|
|
|
import com.example.application.data.bean.CalculatedMatch; |
|
|
import com.example.application.data.bean.CalculatedMatch; |
|
|
import com.example.application.data.entity.Player; |
|
|
|
|
|
import com.example.application.data.service.MatchService; |
|
|
import com.example.application.data.service.MatchService; |
|
|
import com.example.application.data.service.MatchdayService; |
|
|
import com.example.application.data.service.MatchdayService; |
|
|
import com.example.application.data.service.SeasonService; |
|
|
import com.example.application.data.service.SeasonService; |
|
@ -9,7 +8,8 @@ import com.example.application.utils.StringUtils; |
|
|
import com.example.application.utils.VaadinUtils; |
|
|
import com.example.application.utils.VaadinUtils; |
|
|
import com.example.application.views.abstractnavigation.SeasonAndMatchdayNavigationView; |
|
|
import com.example.application.views.abstractnavigation.SeasonAndMatchdayNavigationView; |
|
|
import com.example.application.views.main.MainView; |
|
|
import com.example.application.views.main.MainView; |
|
|
import com.vaadin.flow.component.*; |
|
|
|
|
|
|
|
|
import com.vaadin.flow.component.ClickEvent; |
|
|
|
|
|
import com.vaadin.flow.component.ComponentEventListener; |
|
|
import com.vaadin.flow.component.button.Button; |
|
|
import com.vaadin.flow.component.button.Button; |
|
|
import com.vaadin.flow.component.dependency.CssImport; |
|
|
import com.vaadin.flow.component.dependency.CssImport; |
|
|
import com.vaadin.flow.component.grid.ColumnTextAlign; |
|
|
import com.vaadin.flow.component.grid.ColumnTextAlign; |
|
@ -21,9 +21,9 @@ import com.vaadin.flow.component.icon.VaadinIcon; |
|
|
import com.vaadin.flow.component.orderedlayout.FlexComponent; |
|
|
import com.vaadin.flow.component.orderedlayout.FlexComponent; |
|
|
import com.vaadin.flow.component.orderedlayout.HorizontalLayout; |
|
|
import com.vaadin.flow.component.orderedlayout.HorizontalLayout; |
|
|
import com.vaadin.flow.component.orderedlayout.VerticalLayout; |
|
|
import com.vaadin.flow.component.orderedlayout.VerticalLayout; |
|
|
import com.vaadin.flow.data.renderer.TemplateRenderer; |
|
|
|
|
|
import com.vaadin.flow.function.ValueProvider; |
|
|
import com.vaadin.flow.function.ValueProvider; |
|
|
import com.vaadin.flow.router.*; |
|
|
|
|
|
|
|
|
import com.vaadin.flow.router.PageTitle; |
|
|
|
|
|
import com.vaadin.flow.router.Route; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
|
|
|
|
@CssImport("./views/results/results-view.css") |
|
|
@CssImport("./views/results/results-view.css") |
|
@ -102,7 +102,7 @@ public class ResultsView extends SeasonAndMatchdayNavigationView { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void configureMatchdayLayout() { |
|
|
private void configureMatchdayLayout() { |
|
|
getMatchdayHeader().addClassName("big_header"); // add dates |
|
|
|
|
|
|
|
|
getMatchdayHeader().addClassName("big_header"); // TODO: add dates |
|
|
|
|
|
|
|
|
getMatchdayLayout().setPadding(false); |
|
|
getMatchdayLayout().setPadding(false); |
|
|
getMatchdayLayout().add(getMatchdayHeader(), getGrid()); |
|
|
getMatchdayLayout().add(getMatchdayHeader(), getGrid()); |
|
@ -114,8 +114,7 @@ public class ResultsView extends SeasonAndMatchdayNavigationView { |
|
|
Label headerPlayer2 = new Label("Player 2"); |
|
|
Label headerPlayer2 = new Label("Player 2"); |
|
|
headerPlayer2.addClassName("column_header"); |
|
|
headerPlayer2.addClassName("column_header"); |
|
|
|
|
|
|
|
|
// getGrid().addColumn(VaadinUtils.getPlayerRenderer(CalculatedMatch::getPlayer1)) |
|
|
|
|
|
getGrid().addColumn((ValueProvider<CalculatedMatch, Player>) CalculatedMatch::getPlayer1) |
|
|
|
|
|
|
|
|
getGrid().addColumn(VaadinUtils.getPlayerRenderer(CalculatedMatch::getPlayer1)) |
|
|
.setHeader(headerPlayer1) |
|
|
.setHeader(headerPlayer1) |
|
|
.setTextAlign(ColumnTextAlign.END) |
|
|
.setTextAlign(ColumnTextAlign.END) |
|
|
.setWidth("13em"); |
|
|
.setWidth("13em"); |
|
@ -125,8 +124,7 @@ public class ResultsView extends SeasonAndMatchdayNavigationView { |
|
|
.setTextAlign(ColumnTextAlign.CENTER) |
|
|
.setTextAlign(ColumnTextAlign.CENTER) |
|
|
.setWidth("6em"); |
|
|
.setWidth("6em"); |
|
|
|
|
|
|
|
|
// getGrid().addColumn(VaadinUtils.getPlayerRenderer(CalculatedMatch::getPlayer2)) |
|
|
|
|
|
getGrid().addColumn((ValueProvider<CalculatedMatch, Player>) CalculatedMatch::getPlayer2) |
|
|
|
|
|
|
|
|
getGrid().addColumn(VaadinUtils.getPlayerRenderer(CalculatedMatch::getPlayer2)) |
|
|
.setHeader(headerPlayer2) |
|
|
.setHeader(headerPlayer2) |
|
|
.setTextAlign(ColumnTextAlign.START) |
|
|
.setTextAlign(ColumnTextAlign.START) |
|
|
.setWidth("13em"); |
|
|
.setWidth("13em"); |
|
@ -134,7 +132,6 @@ public class ResultsView extends SeasonAndMatchdayNavigationView { |
|
|
getGrid().setWidth("32em"); |
|
|
getGrid().setWidth("32em"); |
|
|
getGrid().setHeightByRows(true); |
|
|
getGrid().setHeightByRows(true); |
|
|
|
|
|
|
|
|
// getGrid().addClassName("my_grid"); |
|
|
|
|
|
getGrid().addThemeVariants(GridVariant.LUMO_NO_BORDER, |
|
|
getGrid().addThemeVariants(GridVariant.LUMO_NO_BORDER, |
|
|
GridVariant.LUMO_NO_ROW_BORDERS, GridVariant.LUMO_ROW_STRIPES); |
|
|
GridVariant.LUMO_NO_ROW_BORDERS, GridVariant.LUMO_ROW_STRIPES); |
|
|
} |
|
|
} |
|
|