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();
}
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();
}
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;
}
Aggregations