當前位置: 首頁>>代碼示例>>Java>>正文


Java Image.setVisible方法代碼示例

本文整理匯總了Java中com.google.gwt.user.client.ui.Image.setVisible方法的典型用法代碼示例。如果您正苦於以下問題:Java Image.setVisible方法的具體用法?Java Image.setVisible怎麽用?Java Image.setVisible使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.gwt.user.client.ui.Image的用法示例。


在下文中一共展示了Image.setVisible方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: SolverStatus

import com.google.gwt.user.client.ui.Image; //導入方法依賴的package包/類
public SolverStatus() {
	super("unitime-SolverStatus");
	iStatus = new P("status-label");
	iIcon = new Image(RESOURCES.helpIcon()); iIcon.addStyleName("status-icon");
	iIcon.setVisible(false);
	add(iStatus); add(iIcon);
	RPC.execute(new PageNameRpcRequest("Solver Status"), new AsyncCallback<PageNameInterface>() {
		@Override
		public void onFailure(Throwable caught) {}
		@Override
		public void onSuccess(final PageNameInterface result) {
			iIcon.setTitle(MESSAGES.pageHelp(result.getName()));
			iIcon.setVisible(true);
			iIcon.addClickHandler(new ClickHandler() {
				@Override
				public void onClick(ClickEvent event) {
					if (result.getHelpUrl() == null || result.getHelpUrl().isEmpty()) return;
					UniTimeFrameDialog.openDialog(MESSAGES.pageHelp(result.getName()), result.getHelpUrl());
				}
			});
		}
	});
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:24,代碼來源:SolverPage.java

示例2: PageLabelImpl

import com.google.gwt.user.client.ui.Image; //導入方法依賴的package包/類
public PageLabelImpl() {
       iName = new P("text");
       
	iHelp = new Image(RESOURCES.help());
	iHelp.addStyleName("icon");
	iHelp.setVisible(false);
	
	add(iName);
	add(iHelp);
	
	iHelp.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			if (iUrl == null || iUrl.isEmpty()) return;
			UniTimeFrameDialog.openDialog(MESSAGES.pageHelp(getText()), iUrl);
		}
	});
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:19,代碼來源:PageLabelImpl.java

示例3: 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

示例4: addImage

import com.google.gwt.user.client.ui.Image; //導入方法依賴的package包/類
private Image addImage()
{
  AbstractImagePrototype imageprototype = AbstractImagePrototype.create( Icons.s_instance
      .strategy_padlock() );
  if( GameEngine.model().getZoomDisplayed().getValue() == EnuZoom.Medium )
  {
    imageprototype = AbstractImagePrototype.create( Icons.s_instance.tactic_padlock() );
  }
  Image image = null;
  if( !m_unusedImages.isEmpty() )
  {
    image = m_unusedImages.iterator().next();
    imageprototype.applyTo( image );
    image.setVisible( true );
    m_unusedImages.remove( image );
  }
  else
  {
    image = imageprototype.createImage();
    add( image );
    DOM.setStyleAttribute( image.getElement(), "zIndex", "1000" );
    image.addStyleName( "transparent50" );
  }
  m_usedImages.add( image );
  return image;
}
 
開發者ID:kroc702,項目名稱:fullmetalgalaxy,代碼行數:27,代碼來源:WgtBoardLayerLocked.java

示例5: getAuthenticationPanel

import com.google.gwt.user.client.ui.Image; //導入方法依賴的package包/類
private VerticalPanel getAuthenticationPanel() {
	final VerticalPanel panel = new VerticalPanel();

	panel.setWidth("150px");
	panel.setSpacing(10);
	Anchor anchor = new AnchorBuilder().setHref("http://www.geowe.org")
			.setImage(new Image(ImageProvider.INSTANCE.geoweSquareLogo()))
			.build();
	panel.add(anchor);

	userNameField = new TextField();
	userNameField.setTitle(UIMessages.INSTANCE.gitHubUserNameField());
	userNameField.setEmptyText(UIMessages.INSTANCE.gitHubUserNameField());
	userNameField.setWidth(120);
	userNameField.setAllowBlank(false);
	// userNameField.focus();
	panel.add(userNameField);

	passwordField = new PasswordField();
	passwordField.setTitle(UIMessages.INSTANCE.gitHubPasswordField());
	passwordField.setEmptyText(UIMessages.INSTANCE.gitHubPasswordField());
	passwordField.setWidth(120);
	passwordField.setAllowBlank(false);
	panel.add(passwordField);

	progressImage = new Image(ImageProvider.INSTANCE.circleProgress());
	progressImage.setVisible(false);
	panel.add(progressImage);
	return panel;
}
 
開發者ID:geowe,項目名稱:sig-seguimiento-vehiculos,代碼行數:31,代碼來源:Welcome.java

示例6: createTextureFromBytes

import com.google.gwt.user.client.ui.Image; //導入方法依賴的package包/類
/**
 * Creates texture region from byte[].
 * <p>
 * GWT platform requires additional step (as far as i know) to deal with Pixmap. It is need to load Image element
 * and wait until it is loaded.
 *
 * @param bytes    Image byte[] representation, not null
 * @param consumer Consumer where you should deal with region, not null
 */
public static void createTextureFromBytes(byte[] bytes, final Consumer<TextureRegion> consumer)
{
    String base64 = "data:image/png;base64," + new String(Base64Coder.encode(bytes));
    final Image image = new Image();
    image.setVisible(false);
    image.addLoadHandler(new LoadHandler()
    {
        @Override
        public void onLoad(LoadEvent event)
        {
            ImageElement imageElement = image.getElement().cast();
            Pixmap pixmap = new Pixmap(imageElement);
            Gdx.app.log("ImageHelper", "pixmap: " + pixmap.getWidth() + "/" + pixmap.getHeight());
            final int orgWidth = pixmap.getWidth();
            final int orgHeight = pixmap.getHeight();
            int width = MathUtils.nextPowerOfTwo(orgWidth);
            int height = MathUtils.nextPowerOfTwo(orgHeight);
            final Pixmap potPixmap = new Pixmap(width, height, pixmap.getFormat());
            potPixmap.drawPixmap(pixmap, 0, 0, 0, 0, pixmap.getWidth(), pixmap.getHeight());
            pixmap.dispose();
            TextureRegion region = new TextureRegion(new Texture(potPixmap), 0, 0, orgWidth, orgHeight);
            potPixmap.dispose();
            RootPanel.get().remove(image);
            consumer.accept(region);
        }
    });
    image.setUrl(base64);
    RootPanel.get().add(image);
}
 
開發者ID:mk-5,項目名稱:gdx-fireapp,代碼行數:39,代碼來源:ImageHelper.java

示例7: ImageContainer

import com.google.gwt.user.client.ui.Image; //導入方法依賴的package包/類
public ImageContainer(String imageUrl, boolean isSecure) {
	image = new Image(imageUrl);
	//this.loadedCallbacks.add(loadedCallback);
	image.addLoadHandler(this);
	image.addErrorHandler(this);
	image.setVisible(false);
	
	if (!image.getUrl().equalsIgnoreCase("")) {
		Image.prefetch(image.getUrl());
		// Add image to Root Panel so that loaded callback gets fired if image does exist
		RootPanel.get().add(image);
	}
}
 
開發者ID:openremote,項目名稱:WebConsole,代碼行數:14,代碼來源:ImageContainer.java

示例8: getMap

import com.google.gwt.user.client.ui.Image; //導入方法依賴的package包/類
private void getMap() {
	// canvas size in px
    final int width = 1121;
    final int height = 2585;
    
       // get the 2D rendering context
       context = mapCanvas.getContext2d();

       // initialize the canvas
       mapCanvas.setWidth(width + "px");
       mapCanvas.setHeight(height + "px");
       mapCanvas.setPixelSize(width, height);
       mapCanvas.setCoordinateSpaceWidth(width);
       mapCanvas.setCoordinateSpaceHeight(height);
       
       container.setWidth(width + "px");
              
       final Image seattleImage = new Image(Resources.INSTANCE.seattleArea());
       seattleImage.addLoadHandler(new LoadHandler() {

		@Override
		public void onLoad(LoadEvent event) {
               ImageElement imageElement = seattleImage.getElement().cast();
               context.drawImage(imageElement, 0, 0);
		}
	});
       
       seattleImage.setVisible(false);
       container.add(seattleImage);
}
 
開發者ID:waynedyck,項目名稱:mgwt-traffic-flow,代碼行數:31,代碼來源:SeattleViewGwtImpl.java

示例9: getMap

import com.google.gwt.user.client.ui.Image; //導入方法依賴的package包/類
private void getMap() {
	// Tacoma map canvas size in px
    final int width = 1360;
    final int height = 1204;
    
       // get the 2D rendering context
       context = mapCanvas.getContext2d();

       // initialize the canvas
       mapCanvas.setWidth(width + "px");
       mapCanvas.setHeight(height + "px");
       mapCanvas.setPixelSize(width, height);
       mapCanvas.setCoordinateSpaceWidth(width);
       mapCanvas.setCoordinateSpaceHeight(height);
       
       container.setWidth(width + "px");
              
       final Image tacomaImage = new Image(Resources.INSTANCE.tacomaArea());
       tacomaImage.addLoadHandler(new LoadHandler() {

		@Override
		public void onLoad(LoadEvent event) {
               ImageElement imageElement = tacomaImage.getElement().cast();
               context.drawImage(imageElement, 0, 0);
		}
	});
       
       tacomaImage.setVisible(false);
       container.add(tacomaImage);
}
 
開發者ID:waynedyck,項目名稱:mgwt-traffic-flow,代碼行數:31,代碼來源:TacomaViewGwtImpl.java

示例10: InfoPanelWidget

import com.google.gwt.user.client.ui.Image; //導入方法依賴的package包/類
public InfoPanelWidget() {
	throbber = new Image("throbber1.gif");
	throbber.setVisible(false);
	this.add(throbber);
	
	information = new Label();
	this.add(information);
	
	this.addStyleName("easyvote-infoPanel");
}
 
開發者ID:nmldiegues,項目名稱:easy-vote,代碼行數:11,代碼來源:InfoPanelWidget.java

示例11: removeAllImages

import com.google.gwt.user.client.ui.Image; //導入方法依賴的package包/類
private void removeAllImages()
{
  for( Image image : m_usedImages )
  {
    image.setVisible( false );
  }
  m_unusedImages.addAll( m_usedImages );
  m_usedImages.clear();
}
 
開發者ID:kroc702,項目名稱:fullmetalgalaxy,代碼行數:10,代碼來源:WgtBoardLayerLocked.java

示例12: addWarningImage

import com.google.gwt.user.client.ui.Image; //導入方法依賴的package包/類
protected void addWarningImage(Image p_image, AbstractImagePrototype p_absImage, EbToken p_token,
    int p_landPixOffset)
{
  if( p_absImage == null )
  {
    p_image.setVisible( false );
    return;
  }
  if( !p_image.isAttached() || !p_image.isVisible() )
  {
    add( p_image );
    p_image.setVisible( true );
  }
  p_absImage.applyTo( p_image );

  if( p_token.getPosition().getY() < m_cropTopHex )
  {
    DOM.setStyleAttribute( p_image.getElement(), "zIndex",
        Integer.toString( p_token.getZIndex( GameEngine.game().getLandHeight() + 1, true ) ) );
  }
  else
  {
    DOM.setStyleAttribute( p_image.getElement(), "zIndex", Integer.toString( p_token.getZIndex( 1, true ) ) );
  }


  setWidgetHexPosition( p_image, p_token.getPosition(), p_landPixOffset );
}
 
開發者ID:kroc702,項目名稱:fullmetalgalaxy,代碼行數:29,代碼來源:WgtBoardLayerToken.java

示例13: hideOtherImage

import com.google.gwt.user.client.ui.Image; //導入方法依賴的package包/類
public void hideOtherImage()
{
  int indexTmp = m_nextImageIndex;
  while( m_nextImageIndex < m_imagePool.size() )
  {
    Image image = m_imagePool.get( m_nextImageIndex );
    image.setVisible( false );
    image.removeStyleName( "transparent50" );
    m_nextImageIndex++;
  }
  m_nextImageIndex = indexTmp;
}
 
開發者ID:kroc702,項目名稱:fullmetalgalaxy,代碼行數:13,代碼來源:ImagePool.java

示例14: load

import com.google.gwt.user.client.ui.Image; //導入方法依賴的package包/類
public void load() {
	if (!loading && GWT.isClient()) {
		String mapParameter = Window.Location.getParameter("map");
		if (mapParameter != null && !mapParameter.isEmpty()) {
			loading=true;
			mapName = mapParameter;
			mapFile = null;
			final Image img = new Image("img.php?mode=native&url=" + mapParameter);
			img.setVisible(false);
			RootPanel.get().add(img);
			img.addLoadHandler(new LoadHandler() {
				@Override
				public void onLoad(LoadEvent event) {

					Gdx.app.postRunnable(new Runnable() {
						@Override
						public void run() {
							ImageElement imgElement = ImageElement.as(img.getElement());
							RootPanel.get().remove(img);
							Pixmap pixmap = new ScreenshotHelper().asPixmap(imgElement);
							if (pixmap != null) {
								Layer layer = layerManager.getLayer("RAW", RenderMask.Mask.BASIC);
								layer.drawPixmapToFit(pixmap);
								layer.invalidateTexture();
								pixmap.dispose();
								processed = true;

								world.getSystem(RefreshHandlerSystem.class).restart();
							}
						}
					});
				}
			});
		}
	}

	if (!loading && mapFile != null) {
		loading = true;
		processed = true;
		layerManager.getLayer("RAW", RenderMask.Mask.BASIC).drawPixmapToFit(new Pixmap(Gdx.files.internal(mapFile)));
	}
}
 
開發者ID:DaanVanYperen,項目名稱:ns2-scc-profiler,代碼行數:43,代碼來源:LayerLoaderSystem.java

示例15: buildActivationUI

import com.google.gwt.user.client.ui.Image; //導入方法依賴的package包/類
public static Widget buildActivationUI(String text,
                                       String tip,
                                       final MonitorItem monItem,
                                       final int idx,
                                       final BackgroundActivation bActivate,
                                       boolean markAlreadyActivated) {

    final Image icon= new Image(RETRIEVED_ICON);
    icon.setVisible(markAlreadyActivated);

    Widget button= GwtUtil.makeLinkButton(text, tip,
                                          new ClickHandler() {
                                              public void onClick(ClickEvent event) {
                                                  bActivate.activate(monItem,idx, false);
                                                  icon.setVisible(true);
                                              }
                                          });

    WebEventListener autoActListener= new WebEventListener() {
        public void eventNotify(WebEvent ev) {
            if (ev.getSource()==monItem && ev.getName()==Name.MONITOR_ITEM_UPDATE) {
                if (monItem.isDone() && monItem.isActivated(idx)) {
                    icon.setVisible(true);
                    WebEventManager.getAppEvManager().removeListener(Name.MONITOR_ITEM_UPDATE,
                                                                     monItem,this);
                }

            }
        }
    };


    WebEventManager.getAppEvManager().addListener(Name.MONITOR_ITEM_UPDATE,monItem,autoActListener);



    FlexTable fp= new FlexTable();
    HTMLTable.CellFormatter formatter= fp.getCellFormatter();

    fp.setWidget(0,0,button);
    formatter.setWidth(0,0,"100px");

    fp.setWidget(0,4,icon);
    formatter.setWidth(0,4,"20px");
    formatter.setHorizontalAlignment(0,4, HasHorizontalAlignment.ALIGN_RIGHT);
    return fp;
}
 
開發者ID:lsst,項目名稱:firefly,代碼行數:48,代碼來源:UIBackgroundUtil.java


注:本文中的com.google.gwt.user.client.ui.Image.setVisible方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。