Java 类com.google.gwt.event.dom.client.ErrorEvent 实例源码

项目:gwthtml5apps    文件:TransparentIt.java   
@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());
        }
    });

}
项目:gwthtml5apps    文件:TransparentIt.java   
@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());
        }
    });


}
项目:gwthtml5apps    文件:PoissonImage.java   
@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);
        }
    });

}
项目:gwthtml5apps    文件:ImageMaskDataEditor.java   
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

        }
    });

}
项目:appinventor-extensions    文件:GalleryPage.java   
/**
 * 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);
    }
}
项目:appinventor-extensions    文件:ProfilePage.java   
/**
 * 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);
  }
}
项目:appinventor-extensions    文件:GalleryGuiFactory.java   
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);
  }
}
项目:Wiab.pro    文件:ImageThumbnailWidget.java   
/** {@inheritDoc}) */
@Override
public void onError(ErrorEvent e) {
  if (completed) {
    return;
  }
  cleanUp();
  spinner.setVisible(false);
  error.setVisible(true);
}
项目:proarc    文件:DigitalObjectPreview.java   
@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);
}
项目:firefly    文件:BasicImageGrid.java   
public void onError(ErrorEvent ev) {
    Object src = ev.getSource();

    if (src instanceof Image) {
        Image image = (Image) src;
        image.setUrl("images/blank_image_icon.png");
    }
}
项目:firefly    文件:ImageGridPanel.java   
public void onError(ErrorEvent ev) {
    Object src = ev.getSource();

    if (src instanceof Image) {
        Image image = (Image)src;
        image.setUrl("images/blank_image_icon.png");
    }
}
项目:gwthtml5apps    文件:SimpleResize.java   
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());
        }
    });

}
项目:iambookmaster    文件:ParagraphEditor.java   
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());
}
项目:geomajas-project-client-gwt2    文件:HtmlImageImpl.java   
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);
    }
}
项目:incubator-wave    文件:ImageThumbnailWidget.java   
/** {@inheritDoc}) */
public void onError(ErrorEvent e) {
  if (completed) {
    return;
  }
  cleanUp();
  spinner.setVisible(false);
  error.setVisible(true);
}
项目:gwt-upload    文件:PreloadedImage.java   
public void onError(ErrorEvent event) {
  loadHandler.removeHandler();
  errHandler.removeHandler();
  Image img = (Image) event.getSource();
  if (img != null) {
    img.removeFromParent();
  }
  if (onError != null) {
    onError.onError(thisInstance);
  }
}
项目:WebConsole    文件:ImageContainer.java   
@Override
public void onError(ErrorEvent event) {
    loadAttempted = true;       
}
项目:LAS    文件:OutputPanel.java   
@Override
public void onError(ErrorEvent event) {
    eventBus.fireEventFromSource(new StringValueChangeEvent(null), this);
}
项目:gwthtml5apps    文件:UVPack.java   
protected void loadFile(final File file,final String asStringText) {
    try{
        //TODO create method
    //ImageElement element=ImageElementUtils.create(asStringText);

    new ImageElementLoader().load(asStringText, new ImageElementListener() {
        @Override
        public void onLoad(ImageElement element) {
            LogUtils.log(file.getFileName()+","+element.getWidth()+"x"+element.getHeight());


            final ImageUrlData data=new ImageUrlData(file.getFileName(),asStringText);

            easyCellTableObjects.addItem(data);
            //updateList();

            //stack on mobile,maybe because of called async method
            Scheduler.get().scheduleDeferred(new ScheduledCommand() {
                @Override
                public void execute() {
                    easyCellTableObjects.setSelected(data, true);
                    makeBt.setEnabled(true);
                }
            });
        }

        @Override
        public void onError(String url, ErrorEvent event) {
            Window.alert(event.toDebugString());
        }


    });



    //doSelecct(data);//only way to update on Android Chrome
    }catch (Exception e) {
        e.printStackTrace();
        LogUtils.log(e.getMessage());
    }


}
项目:gwthtml5apps    文件:TransparentIt.java   
protected void loadFile(final File file,final String asStringText) {
    try{
        //TODO create method

    new ImageElementLoader().load(asStringText, new ImageElementListener() {
        @Override
        public void onLoad(ImageElement element) {
            LogUtils.log(file.getFileName()+","+element.getWidth()+"x"+element.getHeight());


            final ImageElementData data=new ImageElementData(file.getFileName(),element,asStringText);

            EasyCellTableObjects.addItem(data);

            //stack on mobile,maybe because of called async method
            Scheduler.get().scheduleDeferred(new ScheduledCommand() {
                @Override
                public void execute() {
                    EasyCellTableObjects.setSelected(data, true);
                }
            });
        }

        @Override
        public void onError(String url, ErrorEvent event) {
            Window.alert(event.toDebugString());
        }


    });



    //doSelecct(data);//only way to update on Android Chrome
    }catch (Exception e) {
        e.printStackTrace();
        LogUtils.log(e.getMessage());
    }


}
项目:gwthtml5apps    文件:GifMaker.java   
protected void loadFile(final File file,final String asStringText) {
    try{
        //TODO create method
    //ImageElement element=ImageElementUtils.create(asStringText);

    new ImageElementLoader().load(asStringText, new ImageElementListener() {
        @Override
        public void onLoad(ImageElement element) {
            LogUtils.log(file.getFileName()+","+element.getWidth()+"x"+element.getHeight());


            final ImageUrlData data=new ImageUrlData(file.getFileName(),asStringText);

            easyCellTableObjects.addItem(data);
            //updateList();

            //stack on mobile,maybe because of called async method
            Scheduler.get().scheduleDeferred(new ScheduledCommand() {
                @Override
                public void execute() {
                    easyCellTableObjects.setSelected(data, true);
                    makeBt.setEnabled(true);
                }
            });
        }

        @Override
        public void onError(String url, ErrorEvent event) {
            Window.alert(event.toDebugString());
        }


    });



    //doSelecct(data);//only way to update on Android Chrome
    }catch (Exception e) {
        e.printStackTrace();
        LogUtils.log(e.getMessage());
    }


}
项目:gwthtml5apps    文件:Inpaint.java   
private DropDockDataUrlRootPanel createRootAndTop(){

        DropDockDataUrlRootPanel root=new DropDockDataUrlRootPanel(Unit.PX,false) {

            @Override
            public void loadFile(String pareht, Optional<File> optional, String dataUrl) {
                for(File file:optional.asSet()){


                    ImageElementUtils.createWithLoader(dataUrl, new ImageElementListener() {

                        @Override
                        public void onLoad(ImageElement element) {
                            if(element.getWidth()+element.getHeight()>150){
                                Window.alert("hey this is dev mode,made your pc freeze.use on production mode");
                            }
                            uploadImage(element);
                        }

                        @Override
                        public void onError(String url, ErrorEvent event) {
                            LogUtils.log(event.getNativeEvent());
                        }
                    });
                }
            }

        };
        root.setFilePredicate(FilePredicates.getImageExtensionOnly());


        dock = new DockLayoutPanel(Unit.PX);
        //dock.setSize("100%", "100%");
        root.add(dock);

        topPanel = new HorizontalPanel();
        topPanel.setWidth("100%");
        topPanel.setStylePrimaryName("bg1");
        topPanel.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE);
        topPanel.setSpacing(1);
        dock.addNorth(topPanel,30);


        topPanel.add(createTitleWidget());

        topPanel.add(new Anchor("Help", "inpaint_help.html"));
        return root;
    }
项目:gwthtml5apps    文件:GridPaint.java   
protected void loadFile(final File file,final String asStringText) {
    try{
        //TODO create method
    //ImageElement element=ImageElementUtils.create(asStringText);

    new ImageElementLoader().load(asStringText, new ImageElementListener() {
        @Override
        public void onLoad(ImageElement element) {
            //LogUtils.log(file.getFileName()+","+element.getWidth()+"x"+element.getHeight());
            int baseSplit=baseSizeListBox.getValue();

            int[] result=calcurateGrid(element.getWidth(),element.getHeight(),baseSplit);


            final GridImageData data=new GridImageData(file.getFileName(), asStringText,result[0],result[1],result[2],element.getWidth(),element.getHeight());

            easyCellTableObjects.addItem(data);
            //updateList();


            //stack on mobile,maybe because of called async method
            Scheduler.get().scheduleDeferred(new ScheduledCommand() {
                @Override
                public void execute() {
                    easyCellTableObjects.setSelected(data, true);
                }
            });
        }

        @Override
        public void onError(String url, ErrorEvent event) {
            Window.alert(event.toDebugString());
        }
    });



    //doSelecct(data);//only way to update on Android Chrome
    }catch (Exception e) {
        e.printStackTrace();
        LogUtils.log(e.getMessage());
    }
}
项目:gwthtml5apps    文件:GifPlayer.java   
protected void loadFile(final File file,final String asStringText) {
    try{
        //TODO create method
    //ImageElement element=ImageElementUtils.create(asStringText);

    new ImageElementLoader().load(asStringText, new ImageElementListener() {
        @Override
        public void onLoad(ImageElement element) {
            LogUtils.log(file.getFileName()+","+element.getWidth()+"x"+element.getHeight());


            final ImageElementData data=new ImageElementData(file.getFileName(),element,asStringText);

            easyCellTableObjects.addItem(data);
            //updateList();

            //stack on mobile,maybe because of called async method
            Scheduler.get().scheduleDeferred(new ScheduledCommand() {
                @Override
                public void execute() {
                    easyCellTableObjects.setSelected(data, true);
                }
            });
        }

        @Override
        public void onError(String url, ErrorEvent event) {
            Window.alert(event.toDebugString());
        }


    });



    //doSelecct(data);//only way to update on Android Chrome
    }catch (Exception e) {
        e.printStackTrace();
        LogUtils.log(e.getMessage());
    }


}
项目:iambookmaster    文件:IPhoneImageLoader.java   
public void onError(ErrorEvent event) {
    process(event.getSource());
}
项目:iambookmaster    文件:IPhoneScrollPanel.java   
public void onError(ErrorEvent event) {
    scheduleRepeating(100);
}
项目:gwthtml5apps    文件:ExportImage.java   
protected void loadFile(final File file,final String asStringText) {
    try{
        //TODO create method
    //ImageElement element=ImageElementUtils.create(asStringText);

    new ImageElementLoader().load(asStringText, new ImageElementListener() {
        @Override
        public void onLoad(ImageElement element) {



            final ImageElementCaptionData data=new ImageElementCaptionData(file.getFileName(),element,asStringText);

            easyCellTableObjects.addItem(data);
            //updateList();

            //stack on mobile,maybe because of called async method
            Scheduler.get().scheduleDeferred(new ScheduledCommand() {
                @Override
                public void execute() {
                    easyCellTableObjects.setSelected(data, true);

                    updateMarkedText();
                }
            });
        }

        @Override
        public void onError(String url, ErrorEvent event) {
            Window.alert(event.toDebugString());
        }


    });



    //doSelecct(data);//only way to update on Android Chrome
    }catch (Exception e) {
        e.printStackTrace();
        LogUtils.log(e.getMessage());
    }



}
项目:gwthtml5apps    文件:SimpleLogo.java   
/**
     * watch out IE maybe problem
     * @author aki
     *
     */

/*  public class DataToImageElement implements Function<ImageUrlData,ImageElement>{

        @Override
        public ImageElement apply(ImageUrlData input) {
            return ImageElementUtils.create(input.getDataUrl());
        }

    }*/




    protected void loadFile(final File file,final String asStringText) {
        try{
            //TODO create method
        //ImageElement element=ImageElementUtils.create(asStringText);

        new ImageElementLoader().load(asStringText, new ImageElementListener() {
            @Override
            public void onLoad(final ImageElement element) {
                //LogUtils.log(file.getFileName()+","+element.getWidth()+"x"+element.getHeight());


                final LayerData data=new LayerData(file.getFileName(),element,asStringText);

                EasyCellTableObjects.addItem(data);
                //updateList();

                //stack on mobile,maybe because of called async method
                Scheduler.get().scheduleDeferred(new ScheduledCommand() {
                    @Override
                    public void execute() {
                        EasyCellTableObjects.setSelected(data, true);
                        makeBt.setEnabled(true);
                    }
                });
            }

            @Override
            public void onError(String url, ErrorEvent event) {
                Window.alert(event.toDebugString());
            }


        });



        //doSelecct(data);//only way to update on Android Chrome
        }catch (Exception e) {
            e.printStackTrace();
            LogUtils.log(e.getMessage());
        }


    }