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


Java Image.setSize方法代码示例

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


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

示例1: addLogo

import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
private void addLogo(HorizontalPanel panel) {
  // Logo should be a link to App Inv homepage. Currently, after the user
  // has logged in, the top level *is* ODE; so for now don't make it a link.
  // Add timestamp to logo url to get around browsers that agressively cache
  // the image! This same trick is used in StorageUtil.getFilePath().
  Image logo = new Image(LOGO_IMAGE_URL + "?t=" + System.currentTimeMillis());
  logo.setSize("40px", "40px");
  logo.setStyleName("ode-Logo");
  String logoUrl = ode.getSystemConfig().getLogoUrl();
  if (!Strings.isNullOrEmpty(logoUrl)) {
    logo.addClickHandler(new WindowOpenClickHandler(logoUrl));
  }
  panel.add(logo);
  panel.setCellWidth(logo, "50px");
  Label title = new Label("MIT App Inventor");
  title.setStyleName("ode-LogoText");
  VerticalPanel titleContainer = new VerticalPanel();
  titleContainer.add(title);
  panel.add(titleContainer);
  panel.setCellWidth(titleContainer, "180px");
  panel.setCellHorizontalAlignment(logo, HorizontalPanel.ALIGN_LEFT);
  panel.setCellVerticalAlignment(logo, HorizontalPanel.ALIGN_MIDDLE);
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:24,代码来源:TopPanel.java

示例2: updateImage

import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
/**
 * Updates the provided image with the data stored at
 * the specified index of the data holders array
 * @param dataHolders the list of data holders
 * @param index the index of the required data holder
 * @param image the image to update
 * @param percentWidth the % of client area width that the image is allowed to take 
 * @param percentHeight the % of client area height that the image is allowed to take 
 */
private static void updateImage( final List<BackgroundImageHolder> dataHolders,
								 final int index, final Image image,
							     final int percentWidth, final int percentHeight ){
	//Check for the proper bounds to avoid index out of bounds exception!!!
	if( dataHolders.size() > 0 ) {
		final int actual_index = index % dataHolders.size();
		if( actual_index >= 0 ) {
			final BackgroundImageHolder dataHolder = dataHolders.get( actual_index );
			dataHolder.recommendImageSize( percentWidth, percentHeight  );
			image.setVisible(false);
			image.setUrl( dataHolder.url );
			image.setSize( dataHolder.getRecommendedWidth()+"px",
						   dataHolder.getRecommendedHeight()+"px" );
			image.setVisible(true);
		}
	}
}
 
开发者ID:ivan-zapreev,项目名称:x-cure-chat,代码行数:27,代码来源:SiteDynamicDecorations.java

示例3: makeImage

import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
private Widget makeImage(final TablePanel.View v) {
    Image img = new Image(v.getIcon());
    img.setSize("24px", "24px");
    if (v.getName().equals(selView)) {
        img.addStyleName("selected-view");
        return img;
    } else {
        Widget w = GwtUtil.makeImageButton(img, v.getShortDesc(), new ClickHandler() {
            public void onClick(ClickEvent event) {
                selView = v.getName();
                TablePanel table = hub.getActiveTable();
                table.switchView(selView);
                layout();
            }
        });
        w.addStyleName("selectable-view");
        return w;
    }
}
 
开发者ID:lsst,项目名称:firefly,代码行数:20,代码来源:LayoutSelector.java

示例4: addImageAttribute

import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
private void addImageAttribute(final StringBuffer htmlString, final String attributeValue) {
	final String url = attributeValue.replace("img:", "");
	final Image image = new Image(url);
	image.setSize("48px", "48px");
	
	final Anchor anchor = new AnchorBuilder().setHref(url)
			.setTitle(UIMessages.INSTANCE.openInNewWindow())
			.setImage(image).build();

	htmlString.append(anchor.getElement().getString());
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:12,代码来源:MapToolTipPopup.java

示例5: EvidenceInput

import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
public EvidenceInput( JSONObject o ) {
//			if( o.get( "label" ) != null )
//				panel.add( new Label( o.get( "label" ).isString().stringValue()  ));
//			else
//				panel.add( new Label( o.get( "id" ).isString().stringValue()  ));
			img = new Image();
			img.setSize( "100px", "50px" );
			panel.add( img );
			setValue( "0", "0" );
		}
 
开发者ID:RISCOSS,项目名称:riscoss-corporate,代码行数:11,代码来源:IndicatorWidget.java

示例6: RiskWidget

import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
public RiskWidget( JSONObject o ) {
	if( o.get( "label" ) != null )
		panel.add( new Label( o.get( "label" ).isString().stringValue()  ));
	else
		panel.add( new Label( o.get( "id" ).isString().stringValue()  ));
	img = new Image();
	img.setSize( "100px", "50px" );
	panel.add( img );
}
 
开发者ID:RISCOSS,项目名称:riscoss-corporate,代码行数:10,代码来源:RiskWidget.java

示例7: setupStatusRegion

import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
public static  void setupStatusRegion(LayoutManager lm) {
    final HorizontalPanel hp = new HorizontalPanel();
    Region statusBar = new BaseRegion(STATUS) {
        @Override
        public void setDisplay(Widget display) {
            GwtUtil.setStyles(display, "fontSize", "12px", "lineHeight", "40px");
            super.setDisplay(display);
        }

        @Override
        public void hide() {
            hp.setVisible(false);
        }

        @Override
        public void show() {
            hp.setVisible(true);
        }
    };

    Image im = new Image("images/gxt/attention.gif");
    im.setSize("16px", "16px");
    GwtUtil.setStyle(im, "marginLeft", "20px");
    hp.add(im);
    hp.add(statusBar.getDisplay());
    hp.getElement().setId("app-status");
    hp.setSize("99%", "40px");
    hp.setCellVerticalAlignment(im, VerticalPanel.ALIGN_MIDDLE);
    hp.setCellVerticalAlignment(statusBar.getDisplay(), VerticalPanel.ALIGN_MIDDLE);
    hp.setVisible(false);

    RootPanel.get("application").add(hp);
    lm.addRegion(statusBar);
}
 
开发者ID:lsst,项目名称:firefly,代码行数:35,代码来源:AbstractLayoutManager.java


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