本文整理汇总了Java中com.vaadin.ui.Image.setDescription方法的典型用法代码示例。如果您正苦于以下问题:Java Image.setDescription方法的具体用法?Java Image.setDescription怎么用?Java Image.setDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.Image
的用法示例。
在下文中一共展示了Image.setDescription方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addWoundAtPosition
import com.vaadin.ui.Image; //导入方法依赖的package包/类
public void addWoundAtPosition(WoundPosition woundPosition) {
if (!markedWounds.containsKey(woundPosition)) {
Image image = getImage(WOUND_INDICATOR);
if (woundManager.getWoundAtWoundPosition(woundPosition).getEndDate() != null) {
image = getImage(WOUND_HEALED_INDICATOR);
}
image.addClickListener(woundClickListener);
image.setDescription(woundPosition.getDescription());
image.setAlternateText(woundPosition.getDescription());
// Removing half the size of the indicator to put the click position in the middle of the indicator
float correctedXPos = (float) scaleFactor*(woundPosition.getXPosition() - (image.getWidth() / 2));
float correctedYPos = (float) scaleFactor*(woundPosition.getYPosition() - (image.getHeight() / 2));
ComponentPosition imagePosition = new ComponentPosition();
imagePosition.setLeft((float)correctedXPos, Unit.PIXELS);
imagePosition.setTop((float)correctedYPos, Unit.PIXELS);
image.setData(woundPosition);
markedWounds.put(woundPosition, image);
addComponent(image);
setPosition(image, imagePosition);
}
}
示例2: createEmailIcon
import com.vaadin.ui.Image; //导入方法依赖的package包/类
private Image createEmailIcon(EmailContact emailContact)
{
final String basepath = VaadinService.getCurrent().getBaseDirectory().getAbsolutePath();
final FileResource resource = new FileResource(new File(basepath + "/images/email.png"));
Image image = new Image(null, resource);
image.setDescription("Click to send an email");
image.setVisible(false);
image.addClickListener(new MouseEventLogged.ClickListener()
{
private static final long serialVersionUID = 1L;
@Override
public void clicked(final com.vaadin.event.MouseEvents.ClickEvent event)
{
showMailForm(emailContact);
}
});
return image;
}
示例3: getMinifiedView
import com.vaadin.ui.Image; //导入方法依赖的package包/类
@Override
public Component getMinifiedView() {
Image img = new Image();
img.setSource(getFilterIcon());
img.setDescription(getFilterStateDesc());
return img;
}
示例4: showAddNewPopup
import com.vaadin.ui.Image; //导入方法依赖的package包/类
private void showAddNewPopup() {
final Window popup = new Window();
popup.setWidth("400px");
popup.setHeight("400px");
popup.center();
popup.setModal(true);
VerticalLayout cont = new VerticalLayout();
cont.setMargin(true);
cont.setSpacing(true);
GridLayout factories = new GridLayout(3, 3);
factories.setSpacing(true);
factories.setMargin(true);
for (final FilterEditorFactory<B> fef : ffKeeper
.getAllEditorFactories()) {
VerticalLayout aFactory = new VerticalLayout();
Image img = new Image(null, fef.getFilterIcon());
img.setDescription(fef.getFilterDesc(localizer));
aFactory.addComponent(img);
aFactory.addComponent(new Label(fef.getFilterName(localizer)));
aFactory.addLayoutClickListener(new LayoutClickListener() {
/**
*
*/
private static final long serialVersionUID = -6943926604606589576L;
@Override
public void layoutClick(LayoutClickEvent event) {
FilterEditor<B> newEditor = fef
.newEditorInstance(localizer);
FilterEditorView<B> wrappedEditor = addNewFilterEditor(newEditor);
UI.getCurrent().removeWindow(popup);
wrappedEditor.showEditFilterPopup();
}
});
factories.addComponent(aFactory);
}
cont.addComponent(factories);
popup.setContent(cont);
UI.getCurrent().addWindow(popup);
}
示例5: createUserAvatarEmbeddedComponent
import com.vaadin.ui.Image; //导入方法依赖的package包/类
public static Image createUserAvatarEmbeddedComponent(String avatarId, int size, String tooltip) {
Image embedded = new Image(null, createAvatarResource(avatarId, size));
embedded.setDescription(tooltip);
return embedded;
}