Search in sources :

Example 1 with Panel

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();
}
Also used : Panel(com.vaadin.ui.Panel) HeaderPanel(org.opennms.features.vaadin.jmxconfiggenerator.ui.HeaderPanel)

Example 2 with Panel

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);
}
Also used : WorkflowDefinitionConversion(org.activiti.workflow.simple.converter.WorkflowDefinitionConversion) Panel(com.vaadin.ui.Panel) DetailPanel(org.activiti.explorer.ui.custom.DetailPanel) StreamSource(com.vaadin.terminal.StreamResource.StreamSource) ProcessEngineConfiguration(org.activiti.engine.ProcessEngineConfiguration) StreamResource(com.vaadin.terminal.StreamResource) ProcessDiagramGenerator(org.activiti.image.ProcessDiagramGenerator) StreamSource(com.vaadin.terminal.StreamResource.StreamSource) Embedded(com.vaadin.ui.Embedded) ProcessEngineImpl(org.activiti.engine.impl.ProcessEngineImpl) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 3 with Panel

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);
}
Also used : Panel(com.vaadin.ui.Panel) ByteArrayInputStream(java.io.ByteArrayInputStream) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) StreamSource(com.vaadin.terminal.StreamResource.StreamSource) Label(com.vaadin.ui.Label) VerticalLayout(com.vaadin.ui.VerticalLayout) Embedded(com.vaadin.ui.Embedded) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 4 with Panel

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;
}
Also used : Panel(com.vaadin.ui.Panel)

Example 5 with 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();
}
Also used : Panel(com.vaadin.ui.Panel) VerticalLayout(com.vaadin.ui.VerticalLayout)

Aggregations

Panel (com.vaadin.ui.Panel)12 VerticalLayout (com.vaadin.ui.VerticalLayout)7 Label (com.vaadin.ui.Label)6 HorizontalLayout (com.vaadin.ui.HorizontalLayout)5 Embedded (com.vaadin.ui.Embedded)4 StreamResource (com.vaadin.terminal.StreamResource)3 InputStream (java.io.InputStream)3 DetailPanel (org.activiti.explorer.ui.custom.DetailPanel)3 ExternalResource (com.vaadin.terminal.ExternalResource)2 StreamSource (com.vaadin.terminal.StreamResource.StreamSource)2 URL (java.net.URL)2 XMLInputFactory (javax.xml.stream.XMLInputFactory)2 XMLStreamReader (javax.xml.stream.XMLStreamReader)2 BpmnXMLConverter (org.activiti.bpmn.converter.BpmnXMLConverter)2 BpmnModel (org.activiti.bpmn.model.BpmnModel)2 GraphicInfo (org.activiti.bpmn.model.GraphicInfo)2 ProcessEngineConfiguration (org.activiti.engine.ProcessEngineConfiguration)2 PrettyTimeLabel (org.activiti.explorer.ui.custom.PrettyTimeLabel)2 ProcessDiagramGenerator (org.activiti.image.ProcessDiagramGenerator)2 Action (com.vaadin.event.Action)1