當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。