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


Java Embedded.setWidth方法代码示例

本文整理汇总了Java中com.vaadin.ui.Embedded.setWidth方法的典型用法代码示例。如果您正苦于以下问题:Java Embedded.setWidth方法的具体用法?Java Embedded.setWidth怎么用?Java Embedded.setWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vaadin.ui.Embedded的用法示例。


在下文中一共展示了Embedded.setWidth方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: FileExample

import com.vaadin.ui.Embedded; //导入方法依赖的package包/类
public FileExample() {
    setCaption("Interactive SVG");
    addComponent(new MLabel(
            "A simple example from an svg file using Embedded component. Unlike with Image component, the SVGs JS etc are active. The example also demonstrates how to provide a trivial server side integration API for the SVG."));
    Embedded svg = new Embedded();
    svg.setWidth("400px");
    svg.setHeight("400px");
    svg.setSource(new ClassResource("/pull.svg"));

    // Expose a JS hook that pull.svg file calls when clicked
    JavaScript.getCurrent().addFunction("callMyVaadinFunction", (JsonArray arguments) -> {
        Notification.show("Message from SVG:" + arguments.getString(0));
    });

    addComponent(svg);
}
 
开发者ID:mstahv,项目名称:svgexamples,代码行数:17,代码来源:FileExample.java

示例2: initPicture

import com.vaadin.ui.Embedded; //导入方法依赖的package包/类
protected void initPicture(IdentityService identityService, boolean renderPicture, final String userName) {
  if(renderPicture) {
    Picture picture = identityService.getUserPicture(userName);
    if(picture != null) {
      Resource imageResource = new StreamResource(new InputStreamStreamSource(picture.getInputStream()), 
        userName + picture.getMimeType(), ExplorerApp.get());
      
      Embedded image = new Embedded(null, imageResource);
      image.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
      image.setType(Embedded.TYPE_IMAGE);
      image.setHeight(30, Embedded.UNITS_PIXELS);
      image.setWidth(30, Embedded.UNITS_PIXELS);
      image.addListener(new MouseEvents.ClickListener() {
        private static final long serialVersionUID = 7341560240277898495L;
        public void click(com.vaadin.event.MouseEvents.ClickEvent event) {
          viewManager.showProfilePopup(userName);
        }
      });
      
      addComponent(image);
      setComponentAlignment(image, Alignment.MIDDLE_LEFT);
    } else {
     // TODO: what when no image is available?
    }
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:27,代码来源:UserProfileLink.java

示例3: populateSubTasks

import com.vaadin.ui.Embedded; //导入方法依赖的package包/类
protected void populateSubTasks(List<HistoricTaskInstance> subTasks) {
  for (final HistoricTaskInstance subTask : subTasks) {
    // icon
    Embedded icon = new Embedded(null, Images.TASK_22);
    icon.setWidth(22, UNITS_PIXELS);
    icon.setWidth(22, UNITS_PIXELS);
    subTaskGrid.addComponent(icon);
    
    // Link to subtask
    Button subTaskLink = new Button(subTask.getName());
    subTaskLink.addStyleName(Reindeer.BUTTON_LINK);
    subTaskLink.addListener(new ClickListener() {
      public void buttonClick(ClickEvent event) {
        ExplorerApp.get().getViewManager().showTaskPage(subTask.getId());
      }
    });
    subTaskGrid.addComponent(subTaskLink);
    subTaskGrid.setComponentAlignment(subTaskLink, Alignment.MIDDLE_LEFT);
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:21,代码来源:HistoricTaskDetailPanel.java

示例4: LebAnzeigen

import com.vaadin.ui.Embedded; //导入方法依赖的package包/类
public LebAnzeigen(FossaApplication app, SchuelerLaso schueler, KlasseLaso klasse) throws DocumentException, IOException {
	super(app);
	setCaption(" - Lernentwicklungsbericht anzeigen - ");
	VerticalLayout layout = new VerticalLayout();
	setWidth("800px");
	setContent(layout);
	layout.setSpacing(true);
	
	Embedded embeddedPdf = new Embedded();
	embeddedPdf.setType(Embedded.TYPE_BROWSER);
	DateFormat dateFormat = new SimpleDateFormat("ddMMyy-HHmmss");
	String dateiname = "Klasse" + klasse.getKlassenname() + "_" + schueler.getVorname() + "_" + schueler.getName() + "_" + dateFormat.format(new Date()) + ".pdf";
	embeddedPdf.setSource(new LebCreator(app, schueler, klasse, dateiname).getLebResource());
	embeddedPdf.setWidth(100, Sizeable.UNITS_PERCENTAGE);
	embeddedPdf.setHeight("580px");
	windowCloseButton.setWidth(100, Sizeable.UNITS_PERCENTAGE);
	layout.addComponent(embeddedPdf);
	layout.addComponent(windowCloseButton);
}
 
开发者ID:fossaag,项目名称:rolp,代码行数:20,代码来源:LebAnzeigen.java

示例5: buildMainLayout

import com.vaadin.ui.Embedded; //导入方法依赖的package包/类
@Override
public void buildMainLayout() {
	Embedded logo = new Embedded(null, new ThemeResource(MAINPAGE_PANEL_ANMELDEN_LOGO_PATH));
	logo.setType(Embedded.TYPE_IMAGE);
	logo.setWidth("100px");
	logo.setHeight("96px");
	headlineApp.addComponent(logo,"logo");
	headlineApp.addComponent(authorizerLayout,"authorizerLayout");
	headlineApp.addStyleName("headlineApp");
	
	layout.addComponent(headlineApp,"headlineApp");
	
	getMainWindow().setContent(layout);		
	getMainWindow().addComponent(getAnimator());
	
	if(getLoginLehrer().getIsAdmin()){
		layout.addComponent(getAdminDashboard(), "admin");
	} else {
		layout.addComponent(main, "main");
		buildAppLayout();
	}
}
 
开发者ID:fossaag,项目名称:rolp,代码行数:23,代码来源:RolpApplication.java

示例6: addSliderWithIcons

import com.vaadin.ui.Embedded; //导入方法依赖的package包/类
private void addSliderWithIcons(ComponentContainer optionLayout) {
    final Component emb = new Embedded(null, getNextIcon());
    emb.setWidth("32px");
    final Embedded emb2 = new Embedded(null, getNextIcon());
    emb2.setWidth("32px");
    final Slider slider = new Slider(0, 100);
    slider.setWidth(100, UNITS_PERCENTAGE);

    HorizontalLayout hl = new HorizontalLayout();
    hl.addComponent(emb);
    hl.addComponent(slider);
    hl.addComponent(emb2);
    hl.setWidth(100, UNITS_PERCENTAGE);
    hl.setExpandRatio(slider, 1);
    hl.setComponentAlignment(slider, Alignment.MIDDLE_CENTER);
    optionLayout.addComponent(hl);
}
 
开发者ID:vaadin,项目名称:touchkit,代码行数:18,代码来源:NavPanelTestWithViews.java

示例7: AnimationExample

import com.vaadin.ui.Embedded; //导入方法依赖的package包/类
public AnimationExample() {
	setCaption("Animation");
	addComponent(new MLabel(
			"A simple example from an svg file. Also demonstrates SVG animations.").withFullWidth());
	Embedded svg = new Embedded();
	svg.setWidth("800px");
	svg.setHeight("400px");
	svg.setSource(new ClassResource("/svg2009.svg"));
	addComponent(svg);
}
 
开发者ID:mstahv,项目名称:svgexamples,代码行数:11,代码来源:AnimationExample.java

示例8: ButtonMiddle

import com.vaadin.ui.Embedded; //导入方法依赖的package包/类
/**
 * Konstruktor für einen Button mit einzeiligem Label
 * 
 * @author Tobias Lindner
 * 
 * @param iconPfad
 * 		String: Pfad zum Icon Image
 * @param text
 * 		String: Text für den Button
 * @param lcl
 * 		LayoutClickListener: Listener, der Aktionen bei Klick auf den ButtonMiddle ausführt.
 */
public ButtonMiddle (String iconPfad, String text, LayoutClickListener lcl) {

	this.lcl = lcl;
	setHeight(95, UNITS_PIXELS);
	setWidth(100, UNITS_PERCENTAGE);
	setStyleName("buttonMiddle");
	
	gap1 = new Label ();
	gap1.setWidth(15, UNITS_PIXELS);
	icon = new Embedded(null, new ThemeResource(iconPfad));
	icon.setWidth(40, UNITS_PIXELS);
	icon.setStyleName("buttonIconMiddle");
	
	gap2 = new Label();
	gap2.setWidth(10, UNITS_PIXELS);
	
	label = new Label (text);
	label.setStyleName("buttonLabelMiddle");
	label.setWidth(Sizeable.SIZE_UNDEFINED, 0);
	label.setHeight(Sizeable.SIZE_UNDEFINED, 0);

	vl = new VerticalLayout();
	vl.addComponent(label);
	vl.setSizeUndefined();
	gap3 = new Label();
	gap3.setSizeFull();
	
	addComponent(gap1);
	addComponent(icon);
	addComponent(gap2);
	addComponent(vl);
	addComponent(gap3);
	setExpandRatio(gap3, 1.0f);
	
	setComponentAlignment(icon, Alignment.MIDDLE_CENTER);
	setComponentAlignment(vl, Alignment.MIDDLE_CENTER);
	
	addListener(lcl);
}
 
开发者ID:DHBW-Karlsruhe,项目名称:businesshorizon2,代码行数:52,代码来源:ButtonMiddle.java

示例9: buildContents

import com.vaadin.ui.Embedded; //导入方法依赖的package包/类
@AutoGenerated
private HorizontalLayout buildContents() {
	// common part: create layout
	contents = new HorizontalLayout();
	contents.setImmediate(false);
	contents.setWidth("100.0%");
	contents.setHeight("-1px");
	contents.setMargin(true);
	contents.setSpacing(true);

	// details
	details = buildDetails();
	contents.addComponent(details);

	// userPortrait
	userPortrait = new Embedded();
	userPortrait.setCaption("User Portrait:");
	userPortrait.setImmediate(false);
	userPortrait.setWidth("-1px");
	userPortrait.setHeight("-1px");
	userPortrait.setSource(new ThemeResource(
			"img/component/embedded_icon.png"));
	userPortrait.setType(1);
	userPortrait.setMimeType("image/png");
	contents.addComponent(userPortrait);

	return contents;
}
 
开发者ID:dnebinger,项目名称:vaadin-sample-portlet,代码行数:29,代码来源:UserDetailComponent.java

示例10: FachlehrerDashboard

import com.vaadin.ui.Embedded; //导入方法依赖的package包/类
public FachlehrerDashboard(RolpApplication app) {
	super(app);
	this.app = app;
	setCaption(" - FachlehrerDashboard - ");
	setWidth("100%");
	setHeight("100%");
	
	buildButtonBatteries();
	
	CustomLayout layout = new CustomLayout("./lehrerDashboards/fachLehrerDashboardMain");
	setContent(layout);
	
	CustomLayout headline = new CustomLayout("./lehrerDashboards/headline");
	headline.addStyleName("headline");
	
	Embedded logo = new Embedded(null, new ThemeResource(MAINPAGE_PANEL_ANMELDEN_LOGO_PATH));
	logo.setType(Embedded.TYPE_IMAGE);
	logo.setWidth("100px");
	logo.setHeight("96px");
	
	headline.addComponent(logo,"logo");
	
	CustomLayout faecherListe = new CustomLayout("./lehrerDashboards/liste");
	faecherListe.addStyleName("liste");
	faecherList = getFaecherList();
	faecherList.setHeight("250px");
	faecherList.setStyleName("list");
	faecherListe.addComponent(faecherList, "list");
	faecherListe.setHeight("260px");
	
	layout.addComponent(faecherListe,"liste");
	layout.addComponent(headline,"headline");
	layout.addComponent(horizontalButtonBattery,"horizontalButtonBattery");
	
	lehrerBlog = getLehrerBlog();
	layout.addComponent(lehrerBlog,"blog");
	windowCloseButton.setWidth("100%");
	layout.addComponent(windowCloseButton, "windowCloseButton");
	
}
 
开发者ID:fossaag,项目名称:rolp,代码行数:41,代码来源:FachlehrerDashboard.java

示例11: buildHlImage

import com.vaadin.ui.Embedded; //导入方法依赖的package包/类
private HorizontalLayout buildHlImage() {
	// common part: create layout
	hlImage = new HorizontalLayout();
	hlImage.setImmediate(false);
	hlImage.setWidth("-1px");
	hlImage.setHeight("-1px");
	hlImage.setMargin(false);
	
	// embeddedImage
	embeddedImage = new Embedded();
	embeddedImage.setImmediate(false);
	embeddedImage.setWidth("80px");
	embeddedImage.setHeight("100px");
	embeddedImage.setSource(new ThemeResource(
			"images/imageNotAvailable.png"));
	embeddedImage.setType(1);
	embeddedImage.setMimeType("image/png");
	hlImage.addComponent(embeddedImage);
	
	// btnClearImage
	btnClearImage = new Button();
	btnClearImage.setCaption("X");
	btnClearImage.setImmediate(true);
	btnClearImage.setWidth("-1px");
	btnClearImage.setHeight("-1px");
	hlImage.addComponent(btnClearImage);
	hlImage.setComponentAlignment(btnClearImage, new Alignment(9));
	
	return hlImage;
}
 
开发者ID:thingtrack,项目名称:konekti,代码行数:31,代码来源:ImageField.java

示例12: buildHorizontalLayout_1

import com.vaadin.ui.Embedded; //导入方法依赖的package包/类
@AutoGenerated
private HorizontalLayout buildHorizontalLayout_1() {
	// common part: create layout
	horizontalLayout_1 = new HorizontalLayout();
	horizontalLayout_1.setImmediate(false);
	horizontalLayout_1.setWidth("100.0%");
	horizontalLayout_1.setHeight("-1px");
	horizontalLayout_1.setMargin(false);
	
	// logoField
	logoField = new Embedded();
	logoField.setCaption("Logo");
	logoField.setImmediate(false);
	logoField.setWidth("70px");
	logoField.setHeight("60px");
	logoField
			.setSource(new ThemeResource("img/component/embedded_icon.png"));
	logoField.setType(1);
	logoField.setMimeType("image/png");
	horizontalLayout_1.addComponent(logoField);
	
	// activeField
	activeField = new CheckBox();
	activeField.setCaption("Activo");
	activeField.setImmediate(false);
	activeField.setWidth("-1px");
	activeField.setHeight("-1px");
	activeField.setRequired(true);
	horizontalLayout_1.addComponent(activeField);
	horizontalLayout_1
			.setComponentAlignment(activeField, new Alignment(34));
	
	return horizontalLayout_1;
}
 
开发者ID:thingtrack,项目名称:konekti,代码行数:35,代码来源:CalendarViewForm.java

示例13: buildErrorHeaderLayout

import com.vaadin.ui.Embedded; //导入方法依赖的package包/类
@AutoGenerated
private AbsoluteLayout buildErrorHeaderLayout() {
	// common part: create layout
	errorHeaderLayout = new AbsoluteLayout();
	errorHeaderLayout.setImmediate(false);
	errorHeaderLayout.setWidth("100.0%");
	errorHeaderLayout.setHeight("100px");
	errorHeaderLayout.setMargin(false);
	
	// imageErrorImage
	imageErrorImage = new Embedded();
	imageErrorImage.setImmediate(false);
	imageErrorImage.setWidth("60px");
	imageErrorImage.setHeight("60px");
	imageErrorImage.setSource(new ThemeResource(
			"images/exclamation.png"));
	imageErrorImage.setType(1);
	imageErrorImage.setMimeType("image/png");
	errorHeaderLayout.addComponent(imageErrorImage,
			"top:20.0px;left:20.0px;");
	
	// errorHeaderTittleLabel
	errorHeaderTittleLabel = new Label();
	errorHeaderTittleLabel.setImmediate(false);
	errorHeaderTittleLabel.setWidth("100.0%");
	errorHeaderTittleLabel.setHeight("100.0%");
	errorHeaderTittleLabel.setValue("Error Header");
	errorHeaderLayout.addComponent(errorHeaderTittleLabel,
			"top:20.0px;right:36.0px;bottom:20.0px;left:118.0px;");
	
	return errorHeaderLayout;
}
 
开发者ID:thingtrack,项目名称:konekti,代码行数:33,代码来源:ErrorViewForm.java

示例14: buildMainLayout

import com.vaadin.ui.Embedded; //导入方法依赖的package包/类
@AutoGenerated
	private AbsoluteLayout buildMainLayout() {
		// common part: create layout
		mainLayout = new AbsoluteLayout();
		mainLayout.setImmediate(false);
//		mainLayout.setWidth("982px");
		mainLayout.setWidth("100%");
		mainLayout.setHeight("143px");
		
		// top-level component properties
//		setWidth("982px");
		setWidth("100.0%");
		setHeight("143px");
		
		// headerImage
		headerImage = new Embedded();
		headerImage.setImmediate(false);
		headerImage.setWidth("982px");
		headerImage.setHeight("143px");
		headerImage.setSource(new ThemeResource(
				"img/component/embedded_icon.png"));
		headerImage.setType(1);
		headerImage.setMimeType("image/png");
		mainLayout.addComponent(headerImage, "top:0.0px;left:0.0px;");
		
		return mainLayout;
	}
 
开发者ID:unicesi,项目名称:academ,代码行数:28,代码来源:PanelEncabezado.java

示例15: buildMainLayout

import com.vaadin.ui.Embedded; //导入方法依赖的package包/类
@AutoGenerated
	private AbsoluteLayout buildMainLayout() {
		// common part: create layout
		mainLayout = new AbsoluteLayout();
		mainLayout.setImmediate(false);
		mainLayout.setWidth("100%");
//		mainLayout.setWidth("982px");
		mainLayout.setHeight("70px");
		
		// top-level component properties
//		setWidth("982px");
		setWidth("100.0%");
		setHeight("70px");
		
		// footerImage
		footerImage = new Embedded();
		footerImage.setImmediate(false);
		footerImage.setWidth("982px");
		footerImage.setHeight("70px");
		footerImage.setSource(new ThemeResource(
				"img/component/embedded_icon.png"));
		footerImage.setType(1);
		footerImage.setMimeType("image/png");
		mainLayout.addComponent(footerImage, "top:0.0px;left:0.0px;");
		
		return mainLayout;
	}
 
开发者ID:unicesi,项目名称:academ,代码行数:28,代码来源:PanelPieDePagina.java


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