本文整理汇总了Java中com.vaadin.ui.AbstractOrderedLayout类的典型用法代码示例。如果您正苦于以下问题:Java AbstractOrderedLayout类的具体用法?Java AbstractOrderedLayout怎么用?Java AbstractOrderedLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AbstractOrderedLayout类属于com.vaadin.ui包,在下文中一共展示了AbstractOrderedLayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buttonClick
import com.vaadin.ui.AbstractOrderedLayout; //导入依赖的package包/类
@Override
public void buttonClick(Button.ClickEvent event) {
if (event.getButton().equals(btnSubmit)) {
try {
bodyField.commit();
binder.commit();
comment = binder.getItemDataSource().getBean();
Comment newComment = HybridbpmUI.getCommentAPI().saveComment(comment);
((AbstractOrderedLayout)getParent()).addComponent(new CommentViewLayout(newComment), ((AbstractOrderedLayout)getParent()).getComponentIndex(this));
if (deleteOnSave){
((AbstractOrderedLayout)getParent()).removeComponent(this);
} else {
bodyField.setValue(null);
}
} catch (Exception ex) {
Notification.show("Error", ex.getLocalizedMessage(), Notification.Type.ERROR_MESSAGE);
Logger.getLogger(CommentFormLayout.class.getName()).log(Level.SEVERE, ex.getMessage(), ex);
}
}
}
示例2: createDocumentHistoryChartByOrg
import com.vaadin.ui.AbstractOrderedLayout; //导入依赖的package包/类
@Override
public void createDocumentHistoryChartByOrg(final AbstractOrderedLayout content, final String org) {
final String searchOrg = org.toUpperCase(Locale.ENGLISH).replace(UNDER_SCORE, EMPTY_STRING)
.replace(MINUS_SIGN, EMPTY_STRING).trim();
final DataSeries dataSeries = new DataSeries();
final Series series = new Series();
final Map<String, List<ViewRiksdagenOrgDocumentDailySummary>> allMap = getViewRiksdagenOrgDocumentDailySummaryMap();
final List<ViewRiksdagenOrgDocumentDailySummary> itemList = allMap.get(searchOrg);
if (itemList != null) {
addDocumentHistoryByOrgData(dataSeries, series, itemList);
}
addChart(content, DOCUMENT_HISTORY_BY_ORG,
new DCharts().setDataSeries(dataSeries)
.setOptions(getChartOptions().createOptionsXYDateFloatLegendInsideOneColumn(series)).show(),
true);
}
示例3: createDocumentHistoryPartyChart
import com.vaadin.ui.AbstractOrderedLayout; //导入依赖的package包/类
@Override
public void createDocumentHistoryPartyChart(final AbstractOrderedLayout content,final String org) {
final DataSeries dataSeries = new DataSeries();
final Series series = new Series();
final Map<String, List<ViewRiksdagenPartyDocumentDailySummary>> allMap = getViewRiksdagenPartyDocumentDailySummaryMap();
final List<ViewRiksdagenPartyDocumentDailySummary> itemList = allMap
.get(org.toUpperCase(Locale.ENGLISH).replace(UNDER_SCORE, EMPTY_STRING).trim());
if (itemList != null) {
final Map<String, List<ViewRiksdagenPartyDocumentDailySummary>> map = itemList.parallelStream()
.filter(Objects::nonNull).collect(Collectors.groupingBy(
t -> StringUtils.defaultIfBlank(t.getEmbeddedId().getDocumentType(), NO_INFO)));
addDocumentHistoryByPartyData(dataSeries, series, map);
}
addChart(content, DOCUMENT_HISTORY_PARTY,new DCharts().setDataSeries(dataSeries).setOptions(getChartOptions().createOptionsXYDateFloatLegendInsideOneColumn(series)).show(), true);
}
示例4: createDocumentTypeChart
import com.vaadin.ui.AbstractOrderedLayout; //导入依赖的package包/类
@Override
public void createDocumentTypeChart(final AbstractOrderedLayout content) {
final Map<String, List<ViewRiksdagenDocumentTypeDailySummary>> map = getDocumentTypeMap();
final SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DD_MMM_YYYY, Locale.ENGLISH);
final SimpleDateFormat parseInputDateFormat = new SimpleDateFormat("yyyy-MM-dd");
final DataSeries dataSeries = new DataSeries();
final Series series = new Series();
for (final Entry<String, List<ViewRiksdagenDocumentTypeDailySummary>> entry : map.entrySet()) {
if (entry.getKey() != null && !EMPTY_STRING.equals(entry.getKey())) {
addDataSeries(simpleDateFormat, parseInputDateFormat, dataSeries, series, entry);
}
}
addChart(content, "Document type",
new DCharts().setDataSeries(dataSeries)
.setOptions(getChartOptions().createOptionsXYDateFloatLegendInsideOneColumn(series)).show(),
true);
}
示例5: addOrderedLayoutComponents
import com.vaadin.ui.AbstractOrderedLayout; //导入依赖的package包/类
private void addOrderedLayoutComponents(AbstractOrderedLayout container, Element element,
SlideContainerPresenter presenter, Supplier<Unit> unitsGetter, Supplier<Float> sizeGetter,
Consumer<String> sizeSetter) {
DocumentUtility.getContainerComponents(element, ValidationSets.VALID_CONTAINER_CHILDREN).stream()
.map(m -> createComponentFromElement(m, presenter)).filter(Objects::nonNull).forEach(e -> {
Component component = e.getComponent();
container.addComponent(component);
container.setComponentAlignment(component, e.getAlignment());
if (Objects.nonNull(unitsGetter) && Objects.nonNull(sizeGetter) && Objects.nonNull(sizeSetter)) {
float ratio = 1.0f;
if (unitsGetter.get() == Unit.PERCENTAGE) {
ratio = sizeGetter.get() / 100;
sizeSetter.accept("100%");
}
container.setExpandRatio(component, ratio);
}
});
}
示例6: addToLayout
import com.vaadin.ui.AbstractOrderedLayout; //导入依赖的package包/类
/**
* Add a spacer to the given layout that will expand automatically.
*
* @param layout
* The layout to add the spacer to
*/
public static Spacer addToLayout(AbstractOrderedLayout layout) {
Objects.requireNonNull(layout, "Layout may not be null");
Spacer spacer = new Spacer();
layout.addComponent(spacer);
layout.setExpandRatio(spacer, 1);
return spacer;
}
示例7: init
import com.vaadin.ui.AbstractOrderedLayout; //导入依赖的package包/类
private final void init() {
if (content instanceof AbstractOrderedLayout) {
((AbstractOrderedLayout) content).setSpacing(true);
((AbstractOrderedLayout) content).setMargin(true);
}
if (content instanceof GridLayout) {
addStyleName("marginTop");
}
if (content != null) {
mainLayout.addComponent(content);
mainLayout.setExpandRatio(content, 1.0F);
}
createMandatoryLabel();
final HorizontalLayout buttonLayout = createActionButtonsLayout();
mainLayout.addComponent(buttonLayout);
mainLayout.setComponentAlignment(buttonLayout, Alignment.TOP_CENTER);
setCaption(caption);
setCaptionAsHtml(true);
setContent(mainLayout);
setResizable(false);
center();
setModal(true);
addStyleName("fontsize");
setOrginaleValues();
addComponentListeners();
}
示例8: createIndicatorChart
import com.vaadin.ui.AbstractOrderedLayout; //导入依赖的package包/类
@Override
public void createIndicatorChart(final AbstractOrderedLayout content,final List<WorldBankData> list,
final ViewWorldbankIndicatorDataCountrySummary summary) {
final Map<Country, List<WorldBankData>> countryIndicatorsMap = list.stream()
.collect(Collectors.groupingBy(WorldBankData::getCountry, Collectors.toList()));
final Series series = new Series();
final DataSeries dataSeries = new DataSeries();
for (final Entry<Country, List<WorldBankData>> entry : countryIndicatorsMap.entrySet() ) {
series.addSeries(new XYseries().setLabel(entry.getKey().getValue()));
dataSeries.newSeries();
for (final WorldBankData item : entry.getValue()) {
if (item != null && item.getYearDate() != null && item.getDataValue() != null
&& !item.getDataValue().isEmpty()) {
dataSeries.add(item.getYearDate() + "-01-01", Float.valueOf(item.getDataValue()));
}
}
}
addChart(content,summary.getIndicatorName(), new DCharts().setDataSeries(dataSeries).setOptions(getChartOptions().createOptionsCountryLineChart(series)).show(), false);
}
示例9: addChart
import com.vaadin.ui.AbstractOrderedLayout; //导入依赖的package包/类
/**
* Adds the chart.
*
* @param content
* the content
* @param caption
* the caption
* @param chart
* the chart
* @param fullPage
* the full page
*/
protected final void addChart(final AbstractOrderedLayout content,final String caption, final DCharts chart, final boolean fullPage) {
final HorizontalLayout horizontalLayout = new HorizontalLayout();
final int browserWindowWidth = getChartWindowWidth();
final int browserWindowHeight = getChartWindowHeight(fullPage);
horizontalLayout.setWidth(browserWindowWidth, Unit.PIXELS);
horizontalLayout.setHeight(browserWindowHeight, Unit.PIXELS);
horizontalLayout.setMargin(true);
horizontalLayout.setSpacing(false);
horizontalLayout.addStyleName("v-layout-content-overview-panel-level1");
final Panel formPanel = new Panel();
formPanel.setSizeFull();
formPanel.setContent(horizontalLayout);
formPanel.setCaption(caption);
content.addComponent(formPanel);
content.setExpandRatio(formPanel, ContentRatio.LARGE);
chart.setWidth(100, Unit.PERCENTAGE);
chart.setHeight(100, Unit.PERCENTAGE);
chart.setMarginRight(CHART_RIGHT_MARGIN);
chart.setMarginLeft(CHART_LEFT_MARGIN);
chart.setMarginBottom(CHART_BOTTOM_MARGIN_SIZE);
chart.setMarginTop(CHART_TOP_MARGIN_SIZE);
horizontalLayout.addComponent(chart);
chart.setCaption(caption);
}
示例10: createMinistryGovernmentBodyHeadcountSummaryChart
import com.vaadin.ui.AbstractOrderedLayout; //导入依赖的package包/类
@Override
public void createMinistryGovernmentBodyHeadcountSummaryChart(final AbstractOrderedLayout content,
final String name) {
final Map<Integer, List<GovernmentBodyAnnualSummary>> map = esvApi.getDataPerMinistry(name);
final List<String> governmentBodyNames = esvApi.getGovernmentBodyNames(name);
final DataSeries dataSeries = new DataSeries();
final Series series = new Series();
for (final String govBodyName : governmentBodyNames) {
series.addSeries(new XYseries().setLabel(govBodyName));
dataSeries.newSeries();
for (final Entry<Integer, List<GovernmentBodyAnnualSummary>> entry : map.entrySet()) {
final List<GovernmentBodyAnnualSummary> item = entry.getValue();
final Integer totalHeadcount = item.stream().filter(p -> p.getName().equalsIgnoreCase(govBodyName))
.collect(Collectors.summingInt(GovernmentBodyAnnualSummary::getHeadCount));
if (entry.getKey() != null && item != null && totalHeadcount > 0) {
dataSeries.add(FIRST_OF_JAN + entry.getKey(), totalHeadcount);
}
}
}
addChart(content, name + ANNUAL_HEADCOUNT_SUMMARY_ALL_GOVERNMENT_BODIES,
new DCharts().setDataSeries(dataSeries)
.setOptions(getChartOptions().createOptionsXYDateFloatLogYAxisLegendOutside(series)).show(), true);
}
示例11: createChart
import com.vaadin.ui.AbstractOrderedLayout; //导入依赖的package包/类
@Override
public void createChart(final Tab tab,final AbstractOrderedLayout content,final ViewRiksdagenVoteDataBallotSummary viewRiksdagenVoteDataBallotSummary) {
final DataSeries dataSeries = new DataSeries();
dataSeries.newSeries().add("Yes", viewRiksdagenVoteDataBallotSummary.getYesVotes());
dataSeries.newSeries().add("No", viewRiksdagenVoteDataBallotSummary.getNoVotes());
dataSeries.newSeries().add("Abstain", viewRiksdagenVoteDataBallotSummary.getAbstainVotes());
dataSeries.newSeries().add("Absent", viewRiksdagenVoteDataBallotSummary.getAbsentVotes());
final String caption = "Summary : " +viewRiksdagenVoteDataBallotSummary.getEmbeddedId().getIssue() + " " + viewRiksdagenVoteDataBallotSummary.getEmbeddedId().getConcern();
tab.setCaption(caption);
addChart(content,caption, new DCharts().setDataSeries(dataSeries).setOptions(getChartOptions().createOptionsDonoutChart()).show(), true);
}
示例12: createApplicationActionEventPageDailySummaryChart
import com.vaadin.ui.AbstractOrderedLayout; //导入依赖的package包/类
@Override
public void createApplicationActionEventPageDailySummaryChart(final AbstractOrderedLayout content) {
final Map<String, List<ViewApplicationActionEventPageDailySummary>> map = getApplicationActionEventPageDailySummaryMap();
final DataSeries dataSeries = new DataSeries();
final SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DD_MMM_YYYY, Locale.ENGLISH);
final Series series = new Series();
for (final Entry<String, List<ViewApplicationActionEventPageDailySummary>> entry : map.entrySet()) {
if (entry.getKey() != null) {
series.addSeries(new XYseries().setLabel(entry.getKey()));
dataSeries.newSeries();
final List<ViewApplicationActionEventPageDailySummary> list = entry.getValue();
for (final ViewApplicationActionEventPageDailySummary viewRiksdagenVoteDataBallotPartySummaryDaily : list) {
if (viewRiksdagenVoteDataBallotPartySummaryDaily != null) {
dataSeries.add(simpleDateFormat.format(viewRiksdagenVoteDataBallotPartySummaryDaily.getEmbeddedId().getCreatedDate()),
viewRiksdagenVoteDataBallotPartySummaryDaily.getHits());
}
}
}
}
addChart(content,"Application Action Events daily Summary", new DCharts().setDataSeries(dataSeries).setOptions(getChartOptions().createOptionsXYDateFloatLogYAxisLegendOutside(series)).show(), true);
}
示例13: createApplicationActionEventPageModeDailySummaryChart
import com.vaadin.ui.AbstractOrderedLayout; //导入依赖的package包/类
@Override
public void createApplicationActionEventPageModeDailySummaryChart(final AbstractOrderedLayout content,final String page) {
final Map<String, List<ViewApplicationActionEventPageModeDailySummary>> map = getApplicationActionEventPageModeDailySummaryMap(page);
final DataSeries dataSeries = new DataSeries();
final SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DD_MMM_YYYY, Locale.ENGLISH);
final Series series = new Series();
for (final Entry<String, List<ViewApplicationActionEventPageModeDailySummary>> entry : map.entrySet()) {
if (entry.getKey() != null) {
series.addSeries(new XYseries().setLabel(entry.getKey()));
dataSeries.newSeries();
final List<ViewApplicationActionEventPageModeDailySummary> list = entry.getValue();
for (final ViewApplicationActionEventPageModeDailySummary item : list) {
if (item != null) {
dataSeries.add(simpleDateFormat.format(item.getEmbeddedId().getCreatedDate()),
item.getHits());
}
}
}
}
addChart(content,"Page Action Events daily Summary", new DCharts().setDataSeries(dataSeries).setOptions(getChartOptions().createOptionsXYDateFloatLogYAxisLegendOutside(series)).show(), true);
}
示例14: createDecisionTypeChart
import com.vaadin.ui.AbstractOrderedLayout; //导入依赖的package包/类
@Override
public void createDecisionTypeChart(final AbstractOrderedLayout content) {
final Map<String, List<ViewRiksdagenCommitteeDecisionTypeDailySummary>> map = getCommitteeDecisionTypeMap();
final SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DD_MMM_YYYY, Locale.ENGLISH);
final DataSeries dataSeries = new DataSeries();
final Series series = new Series();
for (final Entry<String, List<ViewRiksdagenCommitteeDecisionTypeDailySummary>> entry : map.entrySet()) {
if (entry.getKey() != null) {
series.addSeries(new XYseries().setLabel(entry.getKey()));
dataSeries.newSeries();
final List<ViewRiksdagenCommitteeDecisionTypeDailySummary> list = entry.getValue();
for (final ViewRiksdagenCommitteeDecisionTypeDailySummary item : list) {
if (item != null) {
dataSeries.add(simpleDateFormat.format(item.getEmbeddedId().getDecisionDate()),
item.getTotal());
}
}
}
}
addChart(content,"Decision type daily summary", new DCharts().setDataSeries(dataSeries).setOptions(getChartOptions().createOptionsXYDateFloatLegendInsideOneColumn(series)).show(), true);
}
示例15: createPartyBallotChart
import com.vaadin.ui.AbstractOrderedLayout; //导入依赖的package包/类
/**
* Creates the party ballot chart.
*
* @param dataValueCalculator
* the data value calculator
* @return the d charts
*/
private void createPartyBallotChart(final AbstractOrderedLayout content,final DataValueCalculator dataValueCalculator) {
final Map<String, List<ViewRiksdagenVoteDataBallotPartySummaryDaily>> map = getPartyMap();
final DataSeries dataSeries = new DataSeries();
final SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DD_MMM_YYYY, Locale.ENGLISH);
final Series series = new Series();
for (final Entry<String, List<ViewRiksdagenVoteDataBallotPartySummaryDaily>> entry : map.entrySet()) {
if (!"-".equals(entry.getKey())) {
series.addSeries(new XYseries().setLabel(getPartyName(entry.getKey())));
dataSeries.newSeries();
final List<ViewRiksdagenVoteDataBallotPartySummaryDaily> list = entry.getValue();
for (final ViewRiksdagenVoteDataBallotPartySummaryDaily viewRiksdagenVoteDataBallotPartySummaryDaily : list) {
if (viewRiksdagenVoteDataBallotPartySummaryDaily != null) {
dataSeries.add(
simpleDateFormat
.format(viewRiksdagenVoteDataBallotPartySummaryDaily.getEmbeddedId().getVoteDate()),
dataValueCalculator.getDataValue(viewRiksdagenVoteDataBallotPartySummaryDaily));
}
}
}
}
addChart(content,"Party ballot chart", new DCharts().setDataSeries(dataSeries).setOptions(getChartOptions().createOptionsXYDateFloatLegendInsideOneColumn(series)).show(), true);
}