use of com.vaadin.ui.HorizontalSplitPanel in project charts by vaadin.
the class ResizeInsideVaadinComponent method getChart.
@Override
protected Component getChart() {
VerticalSplitPanel verticalSplitPanel = new VerticalSplitPanel();
HorizontalSplitPanel horizontalSplitPanel = new HorizontalSplitPanel();
horizontalSplitPanel.setSecondComponent(verticalSplitPanel);
verticalSplitPanel.setFirstComponent(createChart());
VerticalLayout verticalLayout = new VerticalLayout();
verticalLayout.setMargin(true);
verticalLayout.setSpacing(true);
verticalLayout.addComponent(new Label("Relatively sized components resize themselves automatically when in Vaadin component."));
Button button = new Button("Open in a window");
button.addClickListener(new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
Window window = new Window("Chart windodw");
VerticalLayout layout = new VerticalLayout(createChart());
layout.setMargin(true);
layout.setSizeFull();
window.setContent(layout);
window.setWidth("50%");
window.setHeight("50%");
getUI().addWindow(window);
}
});
verticalLayout.addComponent(button);
horizontalSplitPanel.setFirstComponent(verticalLayout);
return horizontalSplitPanel;
}
Aggregations