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


Java LoadEvent类代码示例

本文整理汇总了Java中com.google.gwt.event.dom.client.LoadEvent的典型用法代码示例。如果您正苦于以下问题:Java LoadEvent类的具体用法?Java LoadEvent怎么用?Java LoadEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: createFrame

import com.google.gwt.event.dom.client.LoadEvent; //导入依赖的package包/类
private Frame createFrame() {
	final Frame frame = new Frame(DEFAULT_TEMPLATE_PATH);
	frame.getElement().setId(DEFAULT_FRAME_NAME);
	frame.setTitle(UIMessages.INSTANCE.previewTitle());
	frame.setWidth("500px");
	frame.setHeight("500px");
	frame.getElement().getStyle().setBackgroundColor("gray");

	frame.setVisible(true);
	RootPanel.get().add(frame);

	frame.addLoadHandler(new LoadHandler() {

		@Override
		public void onLoad(LoadEvent event) {
			frame.getElement().getStyle().setBackgroundColor("white");
			zoomPageComboBox.setValue(75);
		}

	});

	return frame;
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:24,代码来源:PreviewWidget.java

示例2: setImageUrl

import com.google.gwt.event.dom.client.LoadEvent; //导入依赖的package包/类
public void setImageUrl(String src, int width, int height) {
    this.width = width;
    this.height = height;
    imageView = new Image();
    imageView.setUrl(src);
    RootPanel.get().add(imageView);
    imageView.addLoadHandler(new LoadHandler() {

        @Override
        public void onLoad(final LoadEvent event) {
            imageView.removeFromParent();
            createCanvasAndAddToView(imageView);
            if (loadHandler.isPresent()) {
                loadHandler.get().onLoad(event);
            }
        }
    });
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:19,代码来源:CanvasImageView.java

示例3: handleDoubleClick

import com.google.gwt.event.dom.client.LoadEvent; //导入依赖的package包/类
protected void handleDoubleClick(TableData.Row row) {
    VerticalPanel vp = new VerticalPanel();
    final Image previewImage = new Image(getFullSizeUrl(row));
    final HTML caption = new HTML(getPopUpCaption(row));
    String title = getThumbnailDesc(row).replace("<em>", "").replace("</em>", "");

    caption.setWidth("320px");

    previewImage.addLoadHandler(new LoadHandler() {
        public void onLoad(LoadEvent ev) {
            caption.setWidth(previewImage.getWidth() + "px");
        }
    });
    GwtUtil.setStyle(vp, "margin", "8px");

    vp.setCellHorizontalAlignment(previewImage, HasHorizontalAlignment.ALIGN_CENTER);
    vp.setCellVerticalAlignment(previewImage, HasVerticalAlignment.ALIGN_MIDDLE);
    vp.add(previewImage);
    vp.add(caption);

    PopupPane popupPane = new PopupPane(title, vp, PopupType.STANDARD, false, false);

    popupPane.show();
}
 
开发者ID:lsst,项目名称:firefly,代码行数:25,代码来源:BasicImageGrid.java

示例4: onLoad

import com.google.gwt.event.dom.client.LoadEvent; //导入依赖的package包/类
public void onLoad(LoadEvent ev) {
    final Image imw = (Image) ev.getSource();
    Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
        public void execute() {
            if (_imageWidget.getWidgetIndex(imw) > -1) {
                imw.setPixelSize(_tile._width, _tile._height);
                ViewPortPt addPt= _plot.getViewPortCoords(new ScreenPt(_tile._x, _tile._y));
                _imageWidget.setWidgetPosition(imw, addPt.getIX(), addPt.getIY());
                if (!_firstReloadComplete) {
                    onFirstLoadComplete();
                    _firstReloadComplete = true;
                }
            }
        }
    });
}
 
开发者ID:lsst,项目名称:firefly,代码行数:17,代码来源:TileDrawer.java

示例5: startDownloadRequest

import com.google.gwt.event.dom.client.LoadEvent; //导入依赖的package包/类
public void startDownloadRequest(String aUrlPrefix, final int aRequestType, Map<String, String> aParams, RequestBuilder.Method aMethod) throws Exception {
	final Frame frame = new Frame();
	frame.setVisible(false);

	frame.addLoadHandler(new LoadHandler() {

		@Override
		public void onLoad(LoadEvent event) {
			Timer timer = new Timer() {

				@Override
				public void run() {
					frame.removeFromParent();
				}
			};
			timer.schedule(2000);
		}
	});
	String query = "";
	for (Map.Entry<String, String> ent : aParams.entrySet()) {
		query += param(ent.getKey(), ent.getValue()) + "&";
	}
	query += param(PlatypusHttpRequestParams.TYPE, String.valueOf(aRequestType));
	frame.setUrl(apiUrl + aUrlPrefix + "?" + query);
	RootPanel.get().add(frame);
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:27,代码来源:AppClient.java

示例6: TileSet

import com.google.gwt.event.dom.client.LoadEvent; //导入依赖的package包/类
public TileSet(String path, int tileSize) {
	this.tileSize = tileSize;
	img = new Image();

	// TODO add to a hidden block
	RootPanel.get("resourceLoader").add(img);

	img.addLoadHandler(new LoadHandler() {
		@Override
		public void onLoad(LoadEvent event) {
			imgElement = ImageElement.as(img.getElement());
			initImageParameters(imgElement.getWidth(), imgElement.getHeight());
		}
	});
	
	img.setUrl(path);
}
 
开发者ID:PsiAmp,项目名称:punk-toads,代码行数:18,代码来源:TileSet.java

示例7: setHTML

import com.google.gwt.event.dom.client.LoadEvent; //导入依赖的package包/类
public void setHTML(final String html) {
	if (!isLoaded) {
		loadHandler = addLoadHandler(new LoadHandler() {
			@Override
			public void onLoad(LoadEvent event) {
				Scheduler.get().scheduleDeferred(
						new Scheduler.ScheduledCommand() {

							@Override
							public void execute() {
								_setHTML(html);
							}
						});
			}
		});

	} else {
		_setHTML(html);
	}
}
 
开发者ID:Rise-Vision,项目名称:rva,代码行数:21,代码来源:RichTextEditorWidget.java

示例8: createHiddenFrame

import com.google.gwt.event.dom.client.LoadEvent; //导入依赖的package包/类
private void createHiddenFrame(PrintFinishedInfo info) {
	final Frame frame = new Frame();
	frame.setVisible(false);
	UrlBuilder builder = new UrlBuilder(info.getUrl());
	for (String name : info.getParams().keySet()) {
		builder.addParameter(name, info.getParams().get(name));
	}
	frame.setUrl(builder.toString());
	frame.setPixelSize(0, 0);
	frame.getElement().getStyle().setPosition(Style.Position.ABSOLUTE);
	frame.getElement().getStyle().setBorderWidth(0, Style.Unit.PX);
	frame.addLoadHandler(new LoadHandler() {

		@Override
		public void onLoad(LoadEvent event) {
			frame.removeFromParent();
		}
	});
	RootPanel.get().add(frame);
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt2,代码行数:21,代码来源:DefaultPrintRequestHandler.java

示例9: onLoad

import com.google.gwt.event.dom.client.LoadEvent; //导入依赖的package包/类
public void onLoad(LoadEvent event) {
  loadHandler.removeHandler();
  errHandler.removeHandler();
  Image img = (Image) event.getSource();
  if (img != null) {
    img.setVisible(true);
    realWidth = img.getWidth();
    realHeight = img.getHeight();
  }
  if (containerId != null && RootPanel.get(containerId) != null) {
    RootPanel.get(containerId).add(thisInstance);
  }
  if (onLoad != null) {
    onLoad.onLoad(thisInstance);
  }
}
 
开发者ID:mwl,项目名称:gwt-upload,代码行数:17,代码来源:PreloadedImage.java

示例10: checkSetSizeAttachesLoadHandler

import com.google.gwt.event.dom.client.LoadEvent; //导入依赖的package包/类
@Test
public void checkSetSizeAttachesLoadHandler() {
    navigatorThumbnailItemView.setItemPxSize(100,
                                             200);

    final ArgumentCaptor<LoadHandler> loadHandlerArgumentCaptor = ArgumentCaptor.forClass(LoadHandler.class);
    when(thumbImage.getWidth()).thenReturn(100);
    when(thumbImage.getHeight()).thenReturn(200);

    verify(thumbImage).addLoadHandler(loadHandlerArgumentCaptor.capture());

    final LoadHandler loadHandler = loadHandlerArgumentCaptor.getValue();
    assertNotNull(loadHandler);

    loadHandler.onLoad(mock(LoadEvent.class));

    verify(body).setPixelSize(eq(100),
                              eq(200));
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:20,代码来源:NavigatorThumbnailItemViewTest.java

示例11: SpritePlateAnimation

import com.google.gwt.event.dom.client.LoadEvent; //导入依赖的package包/类
public SpritePlateAnimation(String imageUrl, double frameRate, int frameCount, int framesAcross)
{
	m_frameRate = frameRate;
	m_frameCount = frameCount;
	m_framesAcross = framesAcross;

	Image img = new Image();
	m_image = ImageElement.as(img.getElement());
    img.addLoadHandler(new LoadHandler()
    {
    	@Override public void onLoad(LoadEvent event)
        {
    		m_loaded = true;
    		m_frameWidth = m_image.getWidth() / m_framesAcross;
    		
    		int framesDown = m_frameCount / m_framesAcross;
    		framesDown += (m_frameCount % m_framesAcross) > 0 ? 1 : 0;
    				
    		m_frameHeight = m_image.getHeight() / framesDown;
        }
    });

    img.setVisible(false);
    RootPanel.get().add(img);
    img.setUrl(imageUrl);
}
 
开发者ID:dougkoellmer,项目名称:swarm,代码行数:27,代码来源:SpritePlateAnimation.java

示例12: add

import com.google.gwt.event.dom.client.LoadEvent; //导入依赖的package包/类
@Override
public void add(final Widget child) {
    if(child instanceof GalleryImage) {
        ((GalleryImage) child).addLoadHandler(new LoadHandler() {
            @Override
            public void onLoad(LoadEvent event) {
                if(thumbnailWidth != null) {
                    child.setWidth(thumbnailWidth);
                }
                if(thumbnailHeight != null) {
                    child.setHeight(thumbnailHeight);
                }
            }
        });

        super.add(child);
    } else {
        throw new IllegalArgumentException("Gallery can only contain GalleryImage's.");
    }
}
 
开发者ID:gwtbootstrap3,项目名称:gwtbootstrap3-extras,代码行数:21,代码来源:Gallery.java

示例13: init

import com.google.gwt.event.dom.client.LoadEvent; //导入依赖的package包/类
public void init(final ExternalEmpiriaApi api, final ExternalFrameLoadHandler<T> onLoadHandler) {
    frame.addLoadHandler(new LoadHandler() {
        @Override
        public void onLoad(LoadEvent event) {
            T obj = init(frame.getElement(), api);
            onLoadHandler.onExternalModuleLoaded(obj);
        }
    });
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:10,代码来源:ExternalFrame.java

示例14: postConstruct

import com.google.gwt.event.dom.client.LoadEvent; //导入依赖的package包/类
@PostConstruct
public void postConstruct() {
    canvasStubView.setPanelStyle(styleNameConstants.QP_COLORFILL_IMG());
    canvasStubView.setImageLoadHandler(new LoadHandler() {

        @Override
        public void onLoad(LoadEvent event) {
            canvasStubViewLoded = true;
            bindView();
        }
    });
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:13,代码来源:ColorfillCanvasImpl.java

示例15: createTextureFromBytes

import com.google.gwt.event.dom.client.LoadEvent; //导入依赖的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


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