use of de.symeda.sormas.api.dashboard.EpiCurveGrouping in project SORMAS-Project by hzi-braunschweig.
the class AbstractEpiCurveComponent method createFooter.
private HorizontalLayout createFooter() {
HorizontalLayout epiCurveFooterLayout = new HorizontalLayout();
epiCurveFooterLayout.setWidth(100, Unit.PERCENTAGE);
epiCurveFooterLayout.setSpacing(true);
CssStyles.style(epiCurveFooterLayout, CssStyles.VSPACE_4);
// Grouping
VerticalLayout groupingLayout = new VerticalLayout();
{
groupingLayout.setMargin(true);
groupingLayout.setSizeUndefined();
// Grouping option group
OptionGroup groupingSelect = new OptionGroup();
groupingSelect.setWidth(100, Unit.PERCENTAGE);
groupingSelect.addItems((Object[]) EpiCurveGrouping.values());
groupingSelect.setValue(epiCurveGrouping);
groupingSelect.addValueChangeListener(e -> {
epiCurveGrouping = (EpiCurveGrouping) e.getProperty().getValue();
clearAndFillEpiCurveChart();
});
groupingLayout.addComponent(groupingSelect);
// "Always show at least 7 entries" checkbox
CheckBox minimumEntriesCheckbox = new CheckBox(I18nProperties.getCaption(Captions.dashboardShowMinimumEntries));
CssStyles.style(minimumEntriesCheckbox, CssStyles.VSPACE_NONE);
minimumEntriesCheckbox.setValue(showMinimumEntries);
minimumEntriesCheckbox.addValueChangeListener(e -> {
showMinimumEntries = (boolean) e.getProperty().getValue();
clearAndFillEpiCurveChart();
});
groupingLayout.addComponent(minimumEntriesCheckbox);
}
PopupButton groupingDropdown = ButtonHelper.createPopupButton(Captions.dashboardGrouping, groupingLayout, CssStyles.BUTTON_SUBTLE);
epiCurveFooterLayout.addComponent(groupingDropdown);
epiCurveFooterLayout.setComponentAlignment(groupingDropdown, Alignment.MIDDLE_RIGHT);
epiCurveFooterLayout.setExpandRatio(groupingDropdown, 1);
// Epi curve mode
AbstractComponent epiCurveModeSelector = createEpiCurveModeSelector();
epiCurveFooterLayout.addComponent(epiCurveModeSelector);
epiCurveFooterLayout.setComponentAlignment(epiCurveModeSelector, Alignment.MIDDLE_RIGHT);
epiCurveFooterLayout.setExpandRatio(epiCurveModeSelector, 0);
return epiCurveFooterLayout;
}
Aggregations