本文整理汇总了Java中com.smartgwt.client.widgets.Img类的典型用法代码示例。如果您正苦于以下问题:Java Img类的具体用法?Java Img怎么用?Java Img使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Img类属于com.smartgwt.client.widgets包,在下文中一共展示了Img类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: loadImage
import com.smartgwt.client.widgets.Img; //导入依赖的package包/类
/**
* Shows a resource as the {@code <img>} element.
*/
public void loadImage(String url) {
ClientUtils.setMembers(display, imgContainer);
image = new Image();
image.addLoadHandler(this);
image.addErrorHandler(this);
image.setUrl(url);
drawHandler = imgContainer.addDrawHandler(this);
resizedHandler = imgContainer.addResizedHandler(this);
ClientUtils.fine(LOG, "loadImage url: %s, width: %s", url, image.getWidth());
if (image.getWidth() == 0) {
WidgetCanvas widgetCanvas = new WidgetCanvas(image);
widgetCanvas.setVisible(false);
widgetCanvas.setWidth(1);
widgetCanvas.setHeight(1);
widgetCanvas.draw();
Img loadingImg = new Img("[SKIN]/loadingSmall.gif", 16, 16);
// Img loadingImg = new Img("[SKIN]/shared/progressCursorTracker.gif", 16, 16);
loadingImg.setAltText(i18n.ImportBatchDataSource_State_LOADING());
loadingImg.setPrompt(i18n.ImportBatchDataSource_State_LOADING());
loadingImg.setLayoutAlign(Alignment.CENTER);
imgContainer.setMembers(loadingImg, widgetCanvas);
}
scheduleForRender();
}
开发者ID:proarc,项目名称:proarc,代码行数:28,代码来源:DigitalObjectPreview.java
示例2: RepeatableForm
import com.smartgwt.client.widgets.Img; //导入依赖的package包/类
RepeatableForm(RepeatableFormItem item) {
this.formItem = item;
setAutoHeight();
this.formFactory = item.getFormFactory();
if (formItem.getMaxOccurrences() > 1 || formItem.getTitle() != null) {
setGroupTitle(formItem.getTitle());
setIsGroup(true);
setLayoutTopMargin(6);
setLayoutLeftMargin(4);
}
if (formItem.isAutoWidth()) {
setAutoWidth();
} else if (formItem.isWidth100()) {
setWidth100();
} else {
setWidth(formItem.getWidthAsString());
}
formError = new Img("[SKIN]/actions/exclamation.png", 16, 16);
formError.setHoverWidth(item.getHoverWidth());
formError.setVisible(false);
addMember(formError);
// ClientUtils.info(LOG, "init.RForm, name: %s, autoWidth: %s, width100: %s, width: %s",
// formItem.getName(), formItem.isAutoWidth(), formItem.isWidth100(), formItem.getWidthAsString());
}
开发者ID:proarc,项目名称:proarc,代码行数:26,代码来源:RepeatableForm.java
示例3: drawAccount
import com.smartgwt.client.widgets.Img; //导入依赖的package包/类
private void drawAccount(Canvas cubeBin, String url) {
if (url == null || "".equals(url.trim())) {
url = "blue.png";
}
if (cubeBin != null) {
int width = cubeBin.getWidth();
final Img img = new Img();
img.setLeft(Random.nextInt(width - 50));
img.setTop(Random.nextInt(240));
img.setWidth(48);
img.setHeight(48);
img.setParentElement(cubeBin);
img.setSrc(url);
img.setCanDragReposition(true);
// img.addClickHandler(new ClickHandler() {
// public void onClick(ClickEvent event) {
// img.destroy();
// }
// });
img.redraw();
}
}
开发者ID:WELTEN,项目名称:dojo-ibl,代码行数:23,代码来源:SingleChoiceDisplay.java
示例4: ImageWidget
import com.smartgwt.client.widgets.Img; //导入依赖的package包/类
/**
*
* @param imageInfo
*/
public ImageWidget(final ImageInfo imageInfo) {
setShowEdges(true);
setDefaultLayoutAlign(Alignment.CENTER);
image = new Img();
UrlBuilder url = new UrlBuilder(Geomajas.getDispatcherUrl() + imageInfo.getUrl());
image.setSrc(url.toString());
image.setAltText(imageInfo.getAlt());
image.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
com.google.gwt.user.client.Window.open(imageInfo.getHref(), "_blank", "");
}
});
// centralize
image.setImageType(ImageStyle.CENTER);
image.setWidth(imageInfo.getWidth());
image.setHeight(imageInfo.getHeight());
addMember(image);
}
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:25,代码来源:ImageWidget.java
示例5: createImage
import com.smartgwt.client.widgets.Img; //导入依赖的package包/类
private Canvas createImage() {
layerImg = LayerIconUtil.getLargeLayerIcon(layer);
layerImg.setImageType(ImageStyle.NORMAL);
Canvas sampleMap = new Canvas();
sampleMap.setAutoHeight();
sampleMap.setAutoWidth();
// sampleMap.setSize("89px", "89px");
if (vectorLayer != null) {
layerLabelOverlay = LayerIconUtil.getLabelOverlayImg();
layerLabelOverlay.setImageType(ImageStyle.NORMAL);
sampleMap.addChild(layerImg);
sampleMap.addChild(layerLabelOverlay);
} else {
Img layerOpacityUnderlay = LayerIconUtil.getOpacityUnderlayImg();
layerOpacityUnderlay.setImageType(ImageStyle.NORMAL);
layerImg.setUseOpacityFilter(true);
sampleMap.addChild(layerOpacityUnderlay);
sampleMap.addChild(layerImg);
}
return sampleMap;
}
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:25,代码来源:LayerActions.java
示例6: LogoOnlyView
import com.smartgwt.client.widgets.Img; //导入依赖的package包/类
public LogoOnlyView() {
VLayout banner = new VLayout();
banner.setLayoutAlign(Alignment.CENTER);
banner.setLayoutAlign(VerticalAlignment.CENTER);
Img logoImg = new Img(logo);
logoImg.setWidth(logoWidth);
logoImg.setHeight(logoHeight);
logoImg.setLayoutAlign(Alignment.CENTER);
logoImg.setLayoutAlign(VerticalAlignment.CENTER);
banner.addMember(logoImg);
setShowShadow(true);
setShadowDepth(WidgetLayout.loadingScreenShadowDepth);
setLayoutAlign(Alignment.CENTER);
setLayoutAlign(VerticalAlignment.CENTER);
setWidth(logoWidth);
setHeight(logoHeight);
setAlign(Alignment.CENTER);
addMember(banner);
}
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:22,代码来源:LoadingScreen.java
示例7: create
import com.smartgwt.client.widgets.Img; //导入依赖的package包/类
public FormItem create() {
final Img image = new Img();
image.setMaxHeight(200);
image.setMaxWidth(300);
image.setShowDisabled(false);
CanvasItem imgItem = new CanvasItem() {
public void setValue(String value) {
image.setSrc(value);
}
};
imgItem.setCanvas(image);
return new EnableToggleFormItem(new TextItem(), imgItem);
}
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:17,代码来源:AttributeFormFieldRegistry.java
示例8: addVector
import com.smartgwt.client.widgets.Img; //导入依赖的package包/类
private void addVector(VectorLayer layer, int ruleIndex, String title) {
HLayout layout = new HLayout(WidgetLayout.marginSmall);
layout.setHeight(WidgetLayout.legendVectorRowHeight);
UrlBuilder urlBuilder = new UrlBuilder(Geomajas.getDispatcherUrl());
urlBuilder.addPath("legendgraphic");
urlBuilder.addPath(layer.getServerLayerId());
urlBuilder.addPath(layer.getLayerInfo().getNamedStyleInfo().getName());
urlBuilder.addPath(ruleIndex + ".png");
Img icon = new Img(urlBuilder.toString(), WidgetLayout.legendRasterIconWidth,
WidgetLayout.legendRasterIconHeight);
icon.setLayoutAlign(Alignment.LEFT);
layout.addMember(icon);
Label label = new Label(title);
label.setWrap(false);
label.setLayoutAlign(Alignment.LEFT);
layout.addMember(label);
addMember(layout);
}
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:19,代码来源:Legend.java
示例9: addRaster
import com.smartgwt.client.widgets.Img; //导入依赖的package包/类
private void addRaster(RasterLayer layer) {
HLayout layout = new HLayout(WidgetLayout.marginSmall);
layout.setHeight(WidgetLayout.legendRasterRowHeight);
UrlBuilder urlBuilder = new UrlBuilder(Geomajas.getDispatcherUrl());
urlBuilder.addPath("legendgraphic");
urlBuilder.addPath(layer.getServerLayerId() + ".png");
Img icon =
new Img(urlBuilder.toString(), WidgetLayout.legendRasterIconWidth, WidgetLayout.legendRasterIconHeight);
icon.setLayoutAlign(Alignment.LEFT);
layout.addMember(icon);
Label label = new Label(layer.getLabel());
label.setWrap(false);
label.setLayoutAlign(Alignment.LEFT);
layout.addMember(label);
addMember(layout);
}
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:17,代码来源:Legend.java
示例10: getViewPanel
import com.smartgwt.client.widgets.Img; //导入依赖的package包/类
public Canvas getViewPanel() {
VLayout layout = new VLayout();
layout.setWidth100();
layout.setHeight100();
Img logo = new Img("[ISOMORPHIC]/geomajas/geomajas_logo.png");
logo.setWidth(600);
logo.setHeight(220);
logo.setMargin(30);
logo.setLayoutAlign(Alignment.CENTER);
HTMLPane pane = new HTMLPane();
String currentLocale = LocaleInfo.getCurrentLocale().getLocaleName();
if ("default".equals(currentLocale)) {
pane.setContentsURL("[ISOMORPHIC]/geomajas/example/pages/intro.html");
} else if ("nl".equals(currentLocale)) {
pane.setContentsURL("[ISOMORPHIC]/geomajas/example/pages/intro_nl.html");
}
layout.addMember(logo);
layout.addMember(pane);
return layout;
}
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:25,代码来源:IntroductionTab.java
示例11: insertImage
import com.smartgwt.client.widgets.Img; //导入依赖的package包/类
public void insertImage(Image image) {
clearTab();
if (image != null && image.getImagePath() != null) {
wfImage = new Img();
wfImage.setImageType(ImageStyle.NORMAL);
wfImage.setSrc(URL.encode(GWT.getModuleBaseURL() + "images?id=" + image.getImagePath()));
wfImage.setDefaultWidth(image.getWidth());
wfImage.setDefaultHeight(image.getHeight());
imagePanel.setContents("");
imagePanel.addChild(wfImage);
} else {
imagePanel.setContents("<b>There is no workflow image for this algorithm</b>");
}
imagePanel.markForRedraw();
}
开发者ID:SHARP-HTP,项目名称:phenotype-portal,代码行数:18,代码来源:WorkflowTab.java
示例12: createDeleteLegendEntryButton
import com.smartgwt.client.widgets.Img; //导入依赖的package包/类
private void createDeleteLegendEntryButton() {
this.deleteButton = new SmallButton(new Img("../img/icons/del.png"),
i18n.delete(), i18n.deleteExtended());
this.deleteButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent evt) {
if (SOSController.isDeletingTS) {
Toaster.getToasterInstance().addMessage(i18n.deleteTimeSeriesActiv());
} else {
SOSController.isDeletingTS = true;
LegendEntryTimeSeries.this.getEventBroker().unregister();
EventBus.getMainEventBus().fireEvent(
new DeleteTimeSeriesEvent(LegendEntryTimeSeries.this
.getElemId()));
}
}
});
}
开发者ID:52North,项目名称:SensorWebClient,代码行数:18,代码来源:LegendEntryTimeSeries.java
示例13: getHomeLabel
import com.smartgwt.client.widgets.Img; //导入依赖的package包/类
private Layout getHomeLabel() {
Layout layout = new VLayout();
layout.setStyleName("n52_sensorweb_client_logoBlock");
Img homeLabel = new Img("../img/client-logo.png", 289, 55);
homeLabel.setStyleName("n52_sensorweb_client_logo");
homeLabel.setCursor(Cursor.POINTER);
homeLabel.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
String url = "http://52north.org/communities/sensorweb/";
Window.open(url, "_blank", "");
}
});
layout.addMember(homeLabel);
return layout;
}
开发者ID:52North,项目名称:SensorWebClient,代码行数:17,代码来源:Header.java
示例14: render
import com.smartgwt.client.widgets.Img; //导入依赖的package包/类
public void render() {
if (loadFailed) {
return ;
}
double ratio = zoom.ratio(
imgContainer.getInnerWidth(), imgContainer.getInnerHeight(),
image.getWidth(), image.getHeight());
double width = (double) image.getWidth() * ratio;
double height = (double) image.getHeight() * ratio;
log("render", width, height);
// do not try to center horizontally as browsers crop large images in small containers
Img img = new Img(image.getUrl(),
(int) width - imgContainer.getScrollbarSize() - 4,
(int) height - imgContainer.getScrollbarSize() - 4);
img.setCanFocus(Boolean.TRUE);
img.setImageType(ImageStyle.STRETCH);
imgContainer.setMembers(img);
imgContainer.adjustForContent(true);
int scrollLeft = (int) (imgContainer.getWidth() * scrollHorizontal);
int scrollTop = (int) (imgContainer.getHeight() * scrollVertical);
imgContainer.scrollTo(scrollLeft, scrollTop);
addContainerMoveListener(imgContainer, img);
if (focus) {
img.focus();
}
}
开发者ID:proarc,项目名称:proarc,代码行数:30,代码来源:DigitalObjectPreview.java
示例15: onError
import com.smartgwt.client.widgets.Img; //导入依赖的package包/类
@Override
public void onError(ErrorEvent event) {
loadFailed = true;
ClientUtils.warning(LOG, "image onError: %s", image.getUrl());
Img img = new Img("[SKIN]/Dialog/warn.png", 2 * 16, 2 * 16);
img.setLayoutAlign(Alignment.CENTER);
img.setAltText(i18n.DigitalObjectPreview_NoContent_Msg());
img.setPrompt(i18n.DigitalObjectPreview_NoContent_Msg());
imgContainer.setMembers(img);
}
开发者ID:proarc,项目名称:proarc,代码行数:11,代码来源:DigitalObjectPreview.java
示例16: DrawableObject
import com.smartgwt.client.widgets.Img; //导入依赖的package包/类
public DrawableObject(String url, int left, int top, Canvas parentObject) {
setCanDragReposition(true);
setLeft(left);
setTop(top);
setParentElement(parentObject);
setHeight(48);
final Img img = new Img();
img.setSrc(url);
img.setHeight(48);
img.setWidth(48);
addMember(img);
}
开发者ID:WELTEN,项目名称:dojo-ibl,代码行数:16,代码来源:DrawableObject.java
示例17: setAccount
import com.smartgwt.client.widgets.Img; //导入依赖的package包/类
public void setAccount(Account account) {
accountImage = new Img();
accountImage.setHeight(48);
accountImage.setWidth(48);
accountImage.setSrc(account.getPicture());
addMember(accountImage);
}
开发者ID:WELTEN,项目名称:dojo-ibl,代码行数:8,代码来源:DrawableObjectWithAccount.java
示例18: getSmallLayerIcon
import com.smartgwt.client.widgets.Img; //导入依赖的package包/类
/**
* Get small layer icon as image.
*
* @param layer
* layer
* @return image
*/
public static Img getSmallLayerIcon(Layer<?> layer) {
String url = getSmallLayerIconUrl(layer);
if (url != null) {
return new Img(url);
} else {
return null;
}
}
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:16,代码来源:LayerIconUtil.java
示例19: getLargeLayerIcon
import com.smartgwt.client.widgets.Img; //导入依赖的package包/类
public static Img getLargeLayerIcon(Layer<?> layer) {
ClientExtraLayerInfo eli = (ClientExtraLayerInfo) layer.getLayerInfo().getWidgetInfo(
ClientExtraLayerInfo.IDENTIFIER);
if (eli != null && eli.getLargeLayerIconUrl() != null && !"".equals(eli.getLargeLayerIconUrl())) {
return new Img(eli.getLargeLayerIconUrl());
} else {
if (layer instanceof RasterLayer) {
return new Img(GltLayout.layerRasterIconLargeUrl);
} else if (layer instanceof VectorLayer) {
LayerType layerType = ((VectorLayer) layer).getLayerInfo().getLayerType();
switch (layerType) {
case POINT:
case MULTIPOINT:
return new Img(GltLayout.layerVectorPointIconLargeUrl);
case LINESTRING:
case MULTILINESTRING:
return new Img(GltLayout.layerVectorLineIconLargeUrl);
case POLYGON:
case MULTIPOLYGON:
case GEOMETRY:
return new Img(GltLayout.layerVectorPolygonIconLargeUrl);
default:
throw new IllegalStateException("Unknown vector layer type " + layerType);
}
} else {
throw new IllegalStateException("Unknown layer type");
}
}
}
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:33,代码来源:LayerIconUtil.java
示例20: getLegendImage
import com.smartgwt.client.widgets.Img; //导入依赖的package包/类
public static Img getLegendImage(Layer<?> layer) {
ClientExtraLayerInfo eli = (ClientExtraLayerInfo) layer.getLayerInfo().getWidgetInfo(
ClientExtraLayerInfo.IDENTIFIER);
if (eli != null && eli.getLegendImageUrl() != null && !"".equals(eli.getLegendImageUrl())) {
return new Img(eli.getLegendImageUrl());
} else {
return null;
}
}
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:10,代码来源:LayerIconUtil.java
注:本文中的com.smartgwt.client.widgets.Img类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论