use of com.vaadin.ui.Panel in project opennms by OpenNMS.
the class JmxConfigGeneratorUI method initContentPanel.
// the Main panel holds all views such as Config view, mbeans view, etc.
private void initContentPanel() {
contentPanel = new Panel();
contentPanel.setSizeFull();
}
use of com.vaadin.ui.Panel in project Activiti by Activiti.
the class SimpleTableEditor method showDiagram.
protected void showDiagram() {
StreamResource.StreamSource streamSource = new StreamSource() {
private static final long serialVersionUID = 6993112534181068935L;
public InputStream getStream() {
WorkflowDefinitionConversion workflowDefinitionConversion = ExplorerApp.get().getWorkflowDefinitionConversionFactory().createWorkflowDefinitionConversion(createWorkflow());
final ProcessEngineImpl defaultProcessEngine = (ProcessEngineImpl) ProcessEngines.getDefaultProcessEngine();
final ProcessEngineConfiguration processEngineConfiguration = defaultProcessEngine.getProcessEngineConfiguration();
final ProcessDiagramGenerator diagramGenerator = processEngineConfiguration.getProcessDiagramGenerator();
return diagramGenerator.generateDiagram(workflowDefinitionConversion.getBpmnModel(), "png", processEngineConfiguration.getActivityFontName(), processEngineConfiguration.getLabelFontName(), processEngineConfiguration.getAnnotationFontName(), processEngineConfiguration.getClassLoader());
}
};
// resource must have unique id (or cache-crap can happen)!
StreamResource imageresource = new StreamResource(streamSource, UUID.randomUUID() + ".png", ExplorerApp.get());
Embedded diagram = new Embedded("", imageresource);
diagram.setType(Embedded.TYPE_IMAGE);
diagram.setSizeUndefined();
// using panel for scrollbars
imagePanel = new Panel();
imagePanel.setScrollable(true);
imagePanel.addStyleName(Reindeer.PANEL_LIGHT);
imagePanel.setWidth(100, UNITS_PERCENTAGE);
imagePanel.setHeight("100%");
mainLayout.addComponent(imagePanel);
HorizontalLayout panelLayout = new HorizontalLayout();
panelLayout.setSizeUndefined();
imagePanel.setContent(panelLayout);
imagePanel.addComponent(diagram);
}
use of com.vaadin.ui.Panel in project Activiti by Activiti.
the class EditorProcessDefinitionInfoComponent method initImage.
protected void initImage() {
processImageContainer = new VerticalLayout();
Label processTitle = new Label(i18nManager.getMessage(Messages.PROCESS_HEADER_DIAGRAM));
processTitle.addStyleName(ExplorerLayout.STYLE_H3);
processImageContainer.addComponent(processTitle);
StreamSource streamSource = null;
final byte[] editorSourceExtra = repositoryService.getModelEditorSourceExtra(modelData.getId());
if (editorSourceExtra != null) {
streamSource = new StreamSource() {
private static final long serialVersionUID = 1L;
public InputStream getStream() {
InputStream inStream = null;
try {
inStream = new ByteArrayInputStream(editorSourceExtra);
} catch (Exception e) {
LOGGER.warn("Error reading PNG in StreamSource", e);
}
return inStream;
}
};
}
if (streamSource != null) {
Embedded embedded = new Embedded(null, new ImageStreamSource(streamSource, ExplorerApp.get()));
embedded.setType(Embedded.TYPE_IMAGE);
embedded.setSizeUndefined();
// using panel for scrollbars
Panel imagePanel = new Panel();
imagePanel.addStyleName(Reindeer.PANEL_LIGHT);
imagePanel.setWidth(100, UNITS_PERCENTAGE);
imagePanel.setHeight(700, UNITS_PIXELS);
HorizontalLayout panelLayout = new HorizontalLayout();
panelLayout.setSizeUndefined();
imagePanel.setContent(panelLayout);
imagePanel.addComponent(embedded);
processImageContainer.addComponent(imagePanel);
} else {
Label noImageAvailable = new Label(i18nManager.getMessage(Messages.PROCESS_NO_DIAGRAM));
processImageContainer.addComponent(noImageAvailable);
}
addComponent(processImageContainer);
}
use of com.vaadin.ui.Panel in project opennms by OpenNMS.
the class DashboardBody method createPanel.
private Panel createPanel(Component content, String caption) {
Panel panel = new Panel();
panel.setSizeFull();
panel.setCaption(caption);
panel.setContent(content);
panel.addStyleName("novscroll");
return panel;
}
use of com.vaadin.ui.Panel in project Activiti by Activiti.
the class ProfilePanel method initInformationPanel.
protected void initInformationPanel() {
Panel infoPanel = new Panel();
infoPanel.addStyleName(Reindeer.PANEL_LIGHT);
infoPanel.setSizeFull();
profilePanelLayout.addComponent(infoPanel);
// info panel should take all the remaining width available
profilePanelLayout.setExpandRatio(infoPanel, 1.0f);
// All the information sections are put under each other in a vertical layout
this.infoPanelLayout = new VerticalLayout();
infoPanel.setContent(infoPanelLayout);
initAboutSection();
initContactSection();
}
Aggregations