Search in sources :

Example 6 with HorizontalSplitPanel

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;
}
Also used : Window(com.vaadin.ui.Window) Button(com.vaadin.ui.Button) HorizontalSplitPanel(com.vaadin.ui.HorizontalSplitPanel) ClickEvent(com.vaadin.ui.Button.ClickEvent) Label(com.vaadin.ui.Label) VerticalLayout(com.vaadin.ui.VerticalLayout) VerticalSplitPanel(com.vaadin.ui.VerticalSplitPanel) ClickListener(com.vaadin.ui.Button.ClickListener)

Aggregations

HorizontalSplitPanel (com.vaadin.ui.HorizontalSplitPanel)6 Label (com.vaadin.ui.Label)3 Button (com.vaadin.ui.Button)2 VerticalLayout (com.vaadin.ui.VerticalLayout)2 GrayTheme (com.vaadin.addon.charts.themes.GrayTheme)1 GridTheme (com.vaadin.addon.charts.themes.GridTheme)1 HighChartsDefaultTheme (com.vaadin.addon.charts.themes.HighChartsDefaultTheme)1 SkiesTheme (com.vaadin.addon.charts.themes.SkiesTheme)1 VaadinTheme (com.vaadin.addon.charts.themes.VaadinTheme)1 ValoDarkTheme (com.vaadin.addon.charts.themes.ValoDarkTheme)1 ValoLightTheme (com.vaadin.addon.charts.themes.ValoLightTheme)1 Theme (com.vaadin.annotations.Theme)1 ExternalResource (com.vaadin.server.ExternalResource)1 Page (com.vaadin.server.Page)1 AbstractSplitPanel (com.vaadin.ui.AbstractSplitPanel)1 ClickEvent (com.vaadin.ui.Button.ClickEvent)1 ClickListener (com.vaadin.ui.Button.ClickListener)1 ComboBox (com.vaadin.ui.ComboBox)1 CssLayout (com.vaadin.ui.CssLayout)1 HorizontalLayout (com.vaadin.ui.HorizontalLayout)1