List of usage examples for com.vaadin.ui Image setCaption
@Override public void setCaption(String caption)
From source file:de.kaiserpfalzEdv.office.ui.web.widgets.about.AboutPanel.java
License:Apache License
@PostConstruct public void init() { Image logo = new Image(null, new ThemeResource("../images/lichti-wappen.png")); logo.setId("about-logo"); logo.setAlternateText("Logo: Kaiserpfalz EDV-Service"); logo.setWidth(150f, Unit.PIXELS);//from ww w.ja va 2 s.co m logo.setHeight(170f, Unit.PIXELS); logo.setCaption("Kaiserpfalz EDV-Service"); addComponent(logo); setComponentAlignment(logo, Alignment.MIDDLE_CENTER); Label name = new Label( "<div style='text-align: center;'><b>" + application.get(ApplicationMetaData.APPLICATION_NAME) + "</b>" + "<br/>" + "<i><small>Version " + application.get(ApplicationMetaData.APPLICATION_VERSION) + "</small></i></div>", ContentMode.HTML); name.setWidth(200f, Unit.PIXELS); addComponent(name); setComponentAlignment(name, Alignment.MIDDLE_CENTER); addComponent(new Label("")); addComponent(new Label("License: " + license.getId())); addComponent(new Label("Licensee: " + license.getLicensee())); addComponent(new Label("")); addComponent(new Label("Issued: " + license.getIssueDate())); addComponent(new Label("Issuer: " + license.getIssuer())); addComponent(new Label("")); addComponent(new Label("Valid (Time): " + license.getStart() + " - " + license.getExpiry())); addComponent(new Label("Valid (Version): " + license.getVersionRange().getStart() + " - " + license.getVersionRange().getEnd())); LOG.trace("Initialized: {}", this); LOG.trace(" application: {}", application); LOG.trace(" license: {}", license); }
From source file:de.uni_tuebingen.qbic.qbicmainportlet.ImageToStringConverter.java
License:Open Source License
@Override public Image convertToModel(String value, Class<? extends Image> targetType, Locale locale) throws com.vaadin.data.util.converter.Converter.ConversionException { Image image = new Image(); image.setCaption(value); return image; }
From source file:org.opencms.ui.dialogs.history.diff.CmsImageDiff.java
License:Open Source License
/** * @see org.opencms.ui.dialogs.history.diff.I_CmsDiffProvider#diff(org.opencms.file.CmsObject, org.opencms.gwt.shared.CmsHistoryResourceBean, org.opencms.gwt.shared.CmsHistoryResourceBean) *//*from ww w . j a v a2 s.co m*/ public Optional<Component> diff(CmsObject cms, CmsHistoryResourceBean v1, CmsHistoryResourceBean v2) throws CmsException { CmsResource r1 = A_CmsAttributeDiff.readResource(cms, v1); if (OpenCms.getResourceManager().matchResourceType(CmsResourceTypeImage.getStaticTypeName(), r1.getTypeId())) { HorizontalLayout hl = new HorizontalLayout(); hl.setSpacing(true); String v1Param = v1.getVersion().getVersionNumber() != null ? "" + v1.getVersion().getVersionNumber() : "" + CmsHistoryResourceHandler.PROJECT_OFFLINE_VERSION; String v2Param = v2.getVersion().getVersionNumber() != null ? "" + v2.getVersion().getVersionNumber() : "" + CmsHistoryResourceHandler.PROJECT_OFFLINE_VERSION; String link1 = OpenCms.getLinkManager().substituteLinkForUnknownTarget(cms, CmsHistoryListUtil.getHistoryLink(cms, v1.getStructureId(), v1Param)); String link2 = OpenCms.getLinkManager().substituteLinkForUnknownTarget(cms, CmsHistoryListUtil.getHistoryLink(cms, v2.getStructureId(), v2Param)); int scaleWidth = 400; int scaleHeight = (2 * scaleWidth) / 3; final String scaleParams = "w:" + scaleWidth + ",h:" + scaleHeight + ",t:1"; // scale type 1 for thumbnails (no enlargement) link1 = CmsRequestUtil.appendParameter(link1, "__scale", scaleParams); link2 = CmsRequestUtil.appendParameter(link2, "__scale", scaleParams); Image img1 = new Image("", new ExternalResource(link1)); Image img2 = new Image("", new ExternalResource(link2)); for (Image img : new Image[] { img1, img2 }) { img.setWidth("" + scaleWidth + "px"); } img1.setCaption("V1"); img2.setCaption("V2"); hl.addComponent(img1); hl.addComponent(img2); Panel result = new Panel("Image comparison"); hl.setMargin(true); result.setContent(hl); return Optional.fromNullable((Component) result); } else { return Optional.absent(); } }