Search in sources :

Example 1 with Image

use of com.vaadin.ui.Image in project cia by Hack23.

the class AbstractView method addLogoToHeader.

/**
 * Adds the logo to header.
 *
 * @param topHeader
 *            the top header
 */
private static void addLogoToHeader(final HorizontalLayout topHeader) {
    final ThemeResource ciaLogoResource = new ThemeResource("cia-logo.png");
    final Image ciaLogoImage = new Image(null, ciaLogoResource);
    topHeader.addComponent(ciaLogoImage);
    ciaLogoImage.setWidth("60px");
    ciaLogoImage.setHeight("60px");
    topHeader.setComponentAlignment(ciaLogoImage, Alignment.MIDDLE_LEFT);
    topHeader.setExpandRatio(ciaLogoImage, ContentRatio.SMALL);
}
Also used : ThemeResource(com.vaadin.server.ThemeResource) Image(com.vaadin.ui.Image)

Example 2 with Image

use of com.vaadin.ui.Image in project ANNIS by korpling.

the class ReportBugWindow method addScreenshotPreview.

private void addScreenshotPreview(Layout layout, final byte[] rawImage, String mimeType) {
    StreamResource res = new StreamResource(new ScreenDumpStreamSource(rawImage), "screendump_" + UUID.randomUUID().toString() + ".png");
    res.setMIMEType(mimeType);
    final Image imgScreenshot = new Image("Attached screenshot", res);
    imgScreenshot.setAlternateText("Screenshot of the ANNIS browser window, " + "no other window or part of the desktop is captured.");
    imgScreenshot.setVisible(false);
    imgScreenshot.setWidth("100%");
    Button btShowScreenshot = new Button("Show attached screenshot", new ShowScreenshotClickListener(imgScreenshot));
    btShowScreenshot.addStyleName(BaseTheme.BUTTON_LINK);
    btShowScreenshot.setIcon(FontAwesome.PLUS_SQUARE_O);
    layout.addComponent(btShowScreenshot);
    layout.addComponent(imgScreenshot);
}
Also used : StreamResource(com.vaadin.server.StreamResource) Button(com.vaadin.ui.Button) Image(com.vaadin.ui.Image)

Example 3 with Image

use of com.vaadin.ui.Image in project cia by Hack23.

the class PoliticianOverviewPageModContentFactoryImpl method createOverviewContent.

/**
 * Creates the overview content.
 *
 * @param panelContent
 *            the panel content
 * @param personData
 *            the person data
 * @param viewRiksdagenPolitician
 *            the view riksdagen politician
 * @param pageId
 *            the page id
 */
private void createOverviewContent(final VerticalLayout panelContent, final PersonData personData, final ViewRiksdagenPolitician viewRiksdagenPolitician, final String pageId) {
    LabelFactory.createHeader2Label(panelContent, OVERVIEW);
    final Link createPoliticianPageLink = getPageLinkFactory().createPoliticianPageLink(personData);
    panelContent.addComponent(createPoliticianPageLink);
    final Image image = new Image("", new ExternalResource(personData.getImageUrl192().replace("http://", "https://")));
    final HorizontalLayout horizontalLayout = new HorizontalLayout();
    horizontalLayout.setSizeFull();
    panelContent.addComponent(horizontalLayout);
    horizontalLayout.addComponent(image);
    getFormFactory().addFormPanelTextFields(horizontalLayout, viewRiksdagenPolitician, ViewRiksdagenPolitician.class, AS_LIST);
    final VerticalLayout overviewLayout = new VerticalLayout();
    overviewLayout.setSizeFull();
    panelContent.addComponent(overviewLayout);
    panelContent.setExpandRatio(overviewLayout, ContentRatio.LARGE_FORM);
    getPoliticianMenuItemFactory().createOverviewPage(overviewLayout, pageId);
    panelContent.setExpandRatio(createPoliticianPageLink, ContentRatio.SMALL);
    panelContent.setExpandRatio(horizontalLayout, ContentRatio.GRID);
}
Also used : VerticalLayout(com.vaadin.ui.VerticalLayout) Image(com.vaadin.ui.Image) ExternalResource(com.vaadin.server.ExternalResource) Link(com.vaadin.ui.Link) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Aggregations

Image (com.vaadin.ui.Image)3 ExternalResource (com.vaadin.server.ExternalResource)1 StreamResource (com.vaadin.server.StreamResource)1 ThemeResource (com.vaadin.server.ThemeResource)1 Button (com.vaadin.ui.Button)1 HorizontalLayout (com.vaadin.ui.HorizontalLayout)1 Link (com.vaadin.ui.Link)1 VerticalLayout (com.vaadin.ui.VerticalLayout)1