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