|
@ -6,6 +6,7 @@ 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; |
|
|
import com.example.application.utils.StringUtils; |
|
|
import com.example.application.utils.StringUtils; |
|
|
|
|
|
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.*; |
|
@ -19,6 +20,7 @@ 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.*; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
@ -99,7 +101,7 @@ public class ResultsView extends SeasonAndMatchdayNavigationView { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void configureMatchdayLayout() { |
|
|
private void configureMatchdayLayout() { |
|
|
getMatchdayHeader().addClassName("big_header"); |
|
|
|
|
|
|
|
|
// getMatchdayHeader().addClassName("big_header"); // add dates |
|
|
|
|
|
|
|
|
getMatchdayLayout().setPadding(false); |
|
|
getMatchdayLayout().setPadding(false); |
|
|
getMatchdayLayout().add(getMatchdayHeader(), getGrid()); |
|
|
getMatchdayLayout().add(getMatchdayHeader(), getGrid()); |
|
@ -111,7 +113,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((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"); |
|
@ -121,7 +123,7 @@ public class ResultsView extends SeasonAndMatchdayNavigationView { |
|
|
.setTextAlign(ColumnTextAlign.CENTER) |
|
|
.setTextAlign(ColumnTextAlign.CENTER) |
|
|
.setWidth("6em"); |
|
|
.setWidth("6em"); |
|
|
|
|
|
|
|
|
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"); |
|
@ -136,6 +138,7 @@ public class ResultsView extends SeasonAndMatchdayNavigationView { |
|
|
return StringUtils.getResultString(match.getScore1(), match.getScore2()); |
|
|
return StringUtils.getResultString(match.getScore1(), match.getScore2()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///////////// |
|
|
///////////// |
|
|
// CONTENT // |
|
|
// CONTENT // |
|
|
///////////// |
|
|
///////////// |
|
|