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


Java ErrorEvent类代码示例

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


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

示例1: undo

import com.google.gwt.event.dom.client.ErrorEvent; //导入依赖的package包/类
@Override
public void undo() {
	
	ImageElementLoader loader=new ImageElementLoader();
	loader.load(beforeUri, new ImageElementListener() {
		@Override
		public void onLoad(ImageElement element) {
			canvas.getContext2d().save();
			canvas.getContext2d().setGlobalCompositeOperation(Composite.COPY);
			canvas.getContext2d().drawImage(element,0,0);
			canvas.getContext2d().restore();
		
			updateCurrentSelectionDataUrl(beforeUri);
		}
		
		@Override
		public void onError(String url, ErrorEvent event) {
			Window.alert(event.toDebugString());
		}
	});
	
}
 
开发者ID:akjava,项目名称:gwthtml5apps,代码行数:23,代码来源:TransparentIt.java

示例2: redo

import com.google.gwt.event.dom.client.ErrorEvent; //导入依赖的package包/类
@Override
public void redo() {
	ImageElementLoader loader=new ImageElementLoader();
	loader.load(afterUri, new ImageElementListener() {
		@Override
		public void onLoad(ImageElement element) {
			canvas.getContext2d().save();
			canvas.getContext2d().setGlobalCompositeOperation(Composite.COPY);
			canvas.getContext2d().drawImage(element,0,0);
			canvas.getContext2d().restore();
			
			updateCurrentSelectionDataUrl(afterUri);
		}
		
		@Override
		public void onError(String url, ErrorEvent event) {
			Window.alert(event.toDebugString());
		}
	});
	
	
}
 
开发者ID:akjava,项目名称:gwthtml5apps,代码行数:23,代码来源:TransparentIt.java

示例3: execAsync

import com.google.gwt.event.dom.client.ErrorEvent; //导入依赖的package包/类
@Override
public void execAsync(final String data) {
	new ImageElementLoader().load(data, new ImageElementListener() {
		
		@Override
		public void onLoad(ImageElement element) {
			done(data,true);
			imageElements.add(element);
		}
		
		@Override
		public void onError(String url, ErrorEvent event) {
			
			done(data,false);
		}
	});
	
}
 
开发者ID:akjava,项目名称:gwthtml5apps,代码行数:19,代码来源:PoissonImage.java

示例4: doCropSrcs

import com.google.gwt.event.dom.client.ErrorEvent; //导入依赖的package包/类
protected void doCropSrcs() {
	resetCanvas();
	ImageElementUtils.createWithLoader(backgroundDataUrl,new ImageElementListener() {
		
		@Override
		public void onLoad(ImageElement element) {
			//Window.open(overlayCanvas.toDataUrl(), "hello", null);
			canvas.getContext2d().save();
			canvas.getContext2d().setGlobalCompositeOperation(Composite.DESTINATION_OUT);
			canvas.getContext2d().drawImage(element, 0, 0);//TODO support scale
			canvas.getContext2d().restore();
			updateCanvas();
		}
		
		@Override
		public void onError(String url, ErrorEvent event) {
			// TODO Auto-generated method stub
			
		}
	});

}
 
开发者ID:akjava,项目名称:gwthtml5apps,代码行数:23,代码来源:ImageMaskDataEditor.java

示例5: updateAppImage

import com.google.gwt.event.dom.client.ErrorEvent; //导入依赖的package包/类
/**
 * Helper method to update the app image
 * @param url  The URL of the image to show
 * @param container  The container that image widget resides
 */
private void updateAppImage(String url, final Panel container) {
    image = new Image();
    image.addStyleName("app-image");
    image.setUrl(url);
    // if the user has provided a gallery app image, we'll load it. But if not
    // the error will occur and we'll load default image
    image.addErrorHandler(new ErrorHandler() {
      public void onError(ErrorEvent event) {
        image.setUrl(GalleryApp.DEFAULTGALLERYIMAGE);
      }
    });
    container.add(image);

    if(gallery.getSystemEnvironment() != null &&
        gallery.getSystemEnvironment().toString().equals("Development")){
      final OdeAsyncCallback<String> callback = new OdeAsyncCallback<String>(
        // failure message
        MESSAGES.galleryError()) {
          @Override
          public void onSuccess(String newUrl) {
            image.setUrl(newUrl + "?" + System.currentTimeMillis());
          }
        };
      Ode.getInstance().getGalleryService().getBlobServingUrl(url, callback);
    }
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:32,代码来源:GalleryPage.java

示例6: updateUserImage

import com.google.gwt.event.dom.client.ErrorEvent; //导入依赖的package包/类
/**
 * Helper method to update the user's image
 * @param url  The URL of the image to show
 * @param container  The container that image widget resides
 */
private void updateUserImage(final String url, Panel container) {
  userAvatar = new Image();
  //setUrl if the new URL is the same one as it was before; an easy workaround is
  //to make the URL unique so it forces the browser to reload
  userAvatar.setUrl(url + "?" + System.currentTimeMillis());
  userAvatar.addStyleName("app-image");
  if (profileStatus == PRIVATE) {
    //userAvatar.addStyleName("status-updating");
  }
  // if the user has provided a gallery app image, we'll load it. But if not
  // the error will occur and we'll load default image
  userAvatar.addErrorHandler(new ErrorHandler() {
    public void onError(ErrorEvent event) {
      userAvatar.setUrl(GalleryApp.DEFAULTUSERIMAGE);
    }
  });
  container.add(userAvatar);

  if(gallery.getSystemEnvironment() != null &&
      gallery.getSystemEnvironment().toString().equals("Development")){
    final OdeAsyncCallback<String> callback = new OdeAsyncCallback<String>(
      // failure message
      MESSAGES.galleryError()) {
        @Override
        public void onSuccess(String newUrl) {
          userAvatar.setUrl(newUrl + "?" + System.currentTimeMillis());
        }
      };
    Ode.getInstance().getGalleryService().getBlobServingUrl(url, callback);
  }
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:37,代码来源:ProfilePage.java

示例7: GalleryAppWidget

import com.google.gwt.event.dom.client.ErrorEvent; //导入依赖的package包/类
private GalleryAppWidget(final GalleryApp app) {
  nameLabel = new Label(app.getTitle());
  authorLabel = new Label(app.getDeveloperName());
  numDownloadsLabel = new Label(Integer.toString(app.getDownloads()));
  numLikesLabel = new Label(Integer.toString(app.getLikes()));
  numViewsLabel = new Label(Integer.toString(app.getViews()));
  numCommentsLabel = new Label(Integer.toString(app.getComments()));
  image = new Image();
  image.addErrorHandler(new ErrorHandler() {
    public void onError(ErrorEvent event) {
      image.setUrl(GalleryApp.DEFAULTGALLERYIMAGE);
    }
  });
  String url = gallery.getCloudImageURL(app.getGalleryAppId());
  image.setUrl(url);

  if(gallery.getSystemEnvironment() != null &&
      gallery.getSystemEnvironment().toString().equals("Development")){
    final OdeAsyncCallback<String> callback = new OdeAsyncCallback<String>(
      // failure message
      MESSAGES.galleryError()) {
        @Override
        public void onSuccess(String newUrl) {
          image.setUrl(newUrl + "?" + System.currentTimeMillis());
        }
      };
    Ode.getInstance().getGalleryService().getBlobServingUrl(url, callback);
  }
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:30,代码来源:GalleryGuiFactory.java

示例8: onError

import com.google.gwt.event.dom.client.ErrorEvent; //导入依赖的package包/类
/** {@inheritDoc}) */
@Override
public void onError(ErrorEvent e) {
  if (completed) {
    return;
  }
  cleanUp();
  spinner.setVisible(false);
  error.setVisible(true);
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:11,代码来源:ImageThumbnailWidget.java

示例9: onError

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

示例10: onError

import com.google.gwt.event.dom.client.ErrorEvent; //导入依赖的package包/类
public void onError(ErrorEvent ev) {
    Object src = ev.getSource();

    if (src instanceof Image) {
        Image image = (Image) src;
        image.setUrl("images/blank_image_icon.png");
    }
}
 
开发者ID:lsst,项目名称:firefly,代码行数:9,代码来源:BasicImageGrid.java

示例11: onError

import com.google.gwt.event.dom.client.ErrorEvent; //导入依赖的package包/类
public void onError(ErrorEvent ev) {
    Object src = ev.getSource();

    if (src instanceof Image) {
        Image image = (Image)src;
        image.setUrl("images/blank_image_icon.png");
    }
}
 
开发者ID:lsst,项目名称:firefly,代码行数:9,代码来源:ImageGridPanel.java

示例12: loadFile

import com.google.gwt.event.dom.client.ErrorEvent; //导入依赖的package包/类
protected void loadFile(final File file, String asStringText) {
	ImageElementUtils.createWithLoader(asStringText, new ImageElementListener() {
		
		@Override
		public void onLoad(ImageElement element) {
			loadFile(file,element);
		}
		
		@Override
		public void onError(String url, ErrorEvent event) {
			LogUtils.log(event.getNativeEvent());
		}
	});
	
}
 
开发者ID:akjava,项目名称:gwthtml5apps,代码行数:16,代码来源:SimpleResize.java

示例13: ImageSprite

import com.google.gwt.event.dom.client.ErrorEvent; //导入依赖的package包/类
public ImageSprite(Sprite sprite) {
	this.sprite = sprite;
	addErrorHandler(new ErrorHandler(){
		public void onError(ErrorEvent event) {
			Window.alert(appMessages.paragraphCannotLoadImage(backImage.getUrl()));
		}
	});
	setUrl(sprite.getPicture().getUrl());
}
 
开发者ID:Antokolos,项目名称:iambookmaster,代码行数:10,代码来源:ParagraphEditor.java

示例14: onError

import com.google.gwt.event.dom.client.ErrorEvent; //导入依赖的package包/类
public void onError(ErrorEvent event) {
	nrAttempts--;
	if (nrAttempts > 0) {
		asImage().addLoadHandler(this);
		asImage().addErrorHandler(this);
		asImage().setUrl(src);
	} else if (onDoneLoading != null) {
		onDoneLoading.onFailure(src);
	}
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt2,代码行数:11,代码来源:HtmlImageImpl.java

示例15: onError

import com.google.gwt.event.dom.client.ErrorEvent; //导入依赖的package包/类
/** {@inheritDoc}) */
public void onError(ErrorEvent e) {
  if (completed) {
    return;
  }
  cleanUp();
  spinner.setVisible(false);
  error.setVisible(true);
}
 
开发者ID:apache,项目名称:incubator-wave,代码行数:10,代码来源:ImageThumbnailWidget.java


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