当前位置: 首页>>代码示例>>Java>>正文


Java Image.setDescription方法代码示例

本文整理汇总了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);
	}
}
 
开发者ID:fau-amos-2014-team-2,项目名称:root,代码行数:28,代码来源:WoundSelector.java

示例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;
}
 
开发者ID:bsutton,项目名称:scoutmaster,代码行数:24,代码来源:SchoolView.java

示例3: getMinifiedView

import com.vaadin.ui.Image; //导入方法依赖的package包/类
@Override
public Component getMinifiedView() {
	Image img = new Image();
	img.setSource(getFilterIcon());
	img.setDescription(getFilterStateDesc());
	
	return img;
}
 
开发者ID:villeteam,项目名称:vexer,代码行数:9,代码来源:TemplateSubmissionStatisticsGiver.java

示例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);
}
 
开发者ID:villeteam,项目名称:vexer,代码行数:52,代码来源:StatSubmInfoFilterEditor.java

示例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;
}
 
开发者ID:MyCollab,项目名称:mycollab,代码行数:6,代码来源:UserAvatarControlFactory.java


注:本文中的com.vaadin.ui.Image.setDescription方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。