Search in sources :

Example 1 with VerticalSplitPanel

use of com.vaadin.ui.VerticalSplitPanel in project opennms by OpenNMS.

the class NodeMapsApplication method updateWidgetView.

private void updateWidgetView() {
    final VerticalSplitPanel bottomLayoutBar = new VerticalSplitPanel();
    bottomLayoutBar.setFirstComponent(m_nodeMapComponent);
    // Split the screen 70% top, 30% bottom
    bottomLayoutBar.setSplitPosition(70, Unit.PERCENTAGE);
    bottomLayoutBar.setSizeFull();
    bottomLayoutBar.setSecondComponent(getTabSheet());
    m_layout.addComponent(bottomLayoutBar);
    m_layout.markAsDirty();
}
Also used : VerticalSplitPanel(com.vaadin.ui.VerticalSplitPanel)

Example 2 with VerticalSplitPanel

use of com.vaadin.ui.VerticalSplitPanel in project opennms by OpenNMS.

the class TopologyUI method updateWidgetView.

/**
 * Updates the bottom widget area with the registered widgets
 *
 * Any widget with the service property of 'location=bottom' are
 * included.
 *
 * @param widgetManager The WidgetManager.
 */
private void updateWidgetView(WidgetManager widgetManager) {
    synchronized (m_layout) {
        m_layout.removeAllComponents();
        if (widgetManager.widgetCount() == 0) {
            m_layout.addComponent(m_mapLayout);
        } else {
            VerticalSplitPanel bottomLayoutBar = new VerticalSplitPanel();
            bottomLayoutBar.setFirstComponent(m_mapLayout);
            // Split the screen 70% top, 30% bottom
            bottomLayoutBar.setSplitPosition(70, Unit.PERCENTAGE);
            bottomLayoutBar.setSizeFull();
            bottomLayoutBar.setSecondComponent(getTabSheet(widgetManager, this));
            bottomLayoutBar.addSplitterClickListener((event) -> {
                if (event.isDoubleClick()) {
                    if (bottomLayoutBar.getSplitPosition() == 100) {
                        bottomLayoutBar.setSplitPosition(70, Unit.PERCENTAGE);
                    } else {
                        bottomLayoutBar.setSplitPosition(100, Unit.PERCENTAGE);
                    }
                }
            });
            m_layout.addComponent(bottomLayoutBar);
            updateTabVisibility();
        }
        m_layout.markAsDirty();
    }
    m_layout.markAsDirty();
}
Also used : VerticalSplitPanel(com.vaadin.ui.VerticalSplitPanel)

Example 3 with VerticalSplitPanel

use of com.vaadin.ui.VerticalSplitPanel 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

VerticalSplitPanel (com.vaadin.ui.VerticalSplitPanel)3 Button (com.vaadin.ui.Button)1 ClickEvent (com.vaadin.ui.Button.ClickEvent)1 ClickListener (com.vaadin.ui.Button.ClickListener)1 HorizontalSplitPanel (com.vaadin.ui.HorizontalSplitPanel)1 Label (com.vaadin.ui.Label)1 VerticalLayout (com.vaadin.ui.VerticalLayout)1 Window (com.vaadin.ui.Window)1