Package org.apache.wicket.markup.html.image

Examples of org.apache.wicket.markup.html.image.NonCachingImage


       
        final BufferedDynamicImageResource imageResource = new BufferedDynamicImageResource();
        imageResource.setImage(image);
        final ThumbnailImageResource thumbnailImageResource = new ThumbnailImageResource(imageResource, 300);
       
        final NonCachingImage wicketImage = new NonCachingImage(id, thumbnailImageResource);
        return wicketImage;
    }
View Full Code Here


        super(id);
       
        Date[] range = getDateRange();
       
        BufferedDynamicImageResource resource = queryAndRenderChart(monitor, range);
        add(chartImage = new NonCachingImage("chart", resource));
        chartImage.setOutputMarkupId(true);
       
        Form form = new Form("form");
        add(form);
       
View Full Code Here

        chart.setBackgroundPaint(Color.WHITE);
       
        BufferedDynamicImageResource resource = new BufferedDynamicImageResource();
        resource.setImage(chart.createBufferedImage(650,500));
       
        add(new NonCachingImage("chart", resource));

    }
View Full Code Here

        LOG.warn("Your Picnik API key must be in Java System property picnik.apikey");
      }
     
      LOG.debug("new PicnikExamplePage in Session " + getSession().getId() + " from "  + ((WebRequest)getRequest()).getHttpServletRequest().getRemoteAddr());
     
      final NonCachingImage nonCachingImage1 = new NonCachingImage("picnikImage1", new WebResource() {
      @Override
      public IResourceStream getResourceStream() {
        return new FileResourceStream(imageFile1);
      }
      });
      nonCachingImage1.setOutputMarkupId(true);
    add(nonCachingImage1);

      PullPanel pullPanel = new PullPanel("pullPanel") {
      @Override
      protected Form createForm(String id, IModel model) {
        return new Form(id, model) {
          @Override
          protected void onSubmit() {
            PicnikFileUpload upload = (PicnikFileUpload) getModelObject();
           
              LOG.debug("File received in Session " + getSession().getId() + " from "  + ((WebRequest)getRequest()).getHttpServletRequest().getRemoteAddr());
             
            FileUpload fileUpload = upload.getFileUpload();
            if (fileUpload != null) {
              LOG.debug("Size: " + fileUpload.getSize());
              LOG.debug("Name: " + fileUpload.getClientFileName());
              LOG.debug("Type: " + fileUpload.getContentType());
              try {
                fileUpload.writeTo(imageFile1);
              } catch (IOException e) {
                throw new WicketRuntimeException(e);
              }
              // following line is actually only required when doing the modal way
              setResponsePage(CloseModalPage.class);             
            }           
          }
        };
      }
      };
      add(pullPanel);

      PicnikCall call1 = new PicnikCall();
      call1.getGeneralSettings().setApiKey(picnikApi);

      ExportSettings exportSettings1 = pullPanel.getExportSettings();
      exportSettings1.setTitle("Wicket!");
    call1.setExportSettings(exportSettings1);
   
    NavigationSettings navSettings = new NavigationSettings();
    navSettings.setPage("/in/upload");
    call1.setNavigationSettings(navSettings);
   
      PicnikLinkModel picnikLinkModel1 = new PicnikLinkModel(call1);
    ExternalLink picnikLink1 = new ExternalLink("importLink1", picnikLinkModel1);
    add(picnikLink1);
     
    final Image logoImage = new Image("logoImage", new ResourceReference(PullPanel.class, "picnik_logo_small.jpg"));
    picnikLink1.add(logoImage);

      // ========================================================================
    // same thing, but in modal window
      PicnikCall call3 = new PicnikCall();
      call3.getGeneralSettings().setApiKey(picnikApi);
      call3.getImportSettings().setImportSource("http://www.indyphone.de/static/media/89e9e0a2-0d17-49db-97fb-e46a2e8c68ea.png");
     
      NavigationSettings navSettings3 = new NavigationSettings();
      navSettings3.setPage("/edit");
     
      ExportSettings exportSettings3 = pullPanel.getExportSettings();
      exportSettings3.setTitle("Wicket!");
    call3.setExportSettings(exportSettings3);
   
    BoxSettings boxSettings3 = new BoxSettings();
    boxSettings3.setExpandButton(false);
    boxSettings3.setCloseTarget("http://rue.dnsdojo.net:42000/wicketstuff-picnik/");
     
      PicnikLinkModel picnikLinkModel3 = new PicnikLinkModel(call3);
     
    ModalPicnikLink modalPicnikLink = new ModalPicnikLink("modalPicnikLink", picnikLinkModel3)
    {
      @Override
      protected void onPicnikFinished(AjaxRequestTarget target) {
              target.addComponent(nonCachingImage1);
      }
     
    };
    add(modalPicnikLink);
   
      // ========================================================================

      final NonCachingImage picnikImage2 = new NonCachingImage("picnikImage2", new WebResource() {
      @Override
      public IResourceStream getResourceStream() {
        return new FileResourceStream(imageFile2);
      }
      });
      picnikImage2.setOutputMarkupId(true);
    add(picnikImage2);
     
      PushTargetPanel pushtarget = new PushTargetPanel("pushtargetPanel") {
      /**
       * @see org.wicketstuff.picnik.PushTargetPanel#createForm(java.lang.String)
View Full Code Here

      String picnikApi = System.getProperty("picnik.apikey");
      if (Strings.isEmpty(picnikApi) && LOG.isWarnEnabled()) {
        LOG.warn("Your Picnik API key must be in Java System property picnik.apikey");
      }

      add(new NonCachingImage("picnikImage2", new WebResource() {
      @Override
      public IResourceStream getResourceStream() {
        return new FileResourceStream(imageFile2);
      }
      }));
View Full Code Here

    private static final long serialVersionUID = 1L;

    public Crop(String id, MarkupContainer markupProvider, final File file) {
      super(id, "crop", markupProvider);
      setOutputMarkupId(true);
      NonCachingImage image = new NonCachingImage("img", new DynamicImageResource() {

        private static final long serialVersionUID = 1L;

        @Override
        protected byte[] getImageData() {
          try {
            return IOUtils.toByteArray(new FileInputStream(file));
          } catch (Exception e) {
            throw new RuntimeException(e);
          }
        }
      });
      image.setOutputMarkupId(true);
      add(image);
      final ImageCropper imageCropper = new ImageCropper("cropperImage", new Model<String>(image.getMarkupId()),
          settings) {
        private static final long serialVersionUID = 1L;

        @Override
        protected void onCrop(int top, int left, int height, int width, AjaxRequestTarget target) {
View Full Code Here

        super(id, mimeType, uploadedBytes);
    }

    @Override
    public Component preview() {
        return this.add(new NonCachingImage("previewImage", new ThumbnailImageResource(new DynamicImageResource() {

            private static final long serialVersionUID = 923201517955737928L;

            @Override
            protected byte[] getImageData(final IResource.Attributes attributes) {
View Full Code Here

      });
    animalSelectionLabel.setOutputMarkupId(true);
    add(animalSelectionLabel);

    // Image referencing captcha image resource
    image = new NonCachingImage("image", imageResource = new CaptchaImageResource(animals));
    image.add(new AjaxEventBehavior("onclick")
    {
      private static final long serialVersionUID = 7480352029955897654L;

      @Override
View Full Code Here

      });
    animalSelectionLabel.setOutputMarkupId(true);
    add(animalSelectionLabel);

    // Image referencing captcha image resource
    image = new NonCachingImage("image", imageResource = new CaptchaImageResource(animals));
    image.add(new AjaxEventBehavior("click")
    {
      private static final long serialVersionUID = 7480352029955897654L;

      @Override
View Full Code Here

        super(id);
       
        Date[] range = getDateRange();
       
        BufferedDynamicImageResource resource = queryAndRenderChart(monitor, range);
        add(chartImage = new NonCachingImage("chart", resource));
        chartImage.setOutputMarkupId(true);
       
        Form form = new Form("form");
        add(form);
       
View Full Code Here

TOP

Related Classes of org.apache.wicket.markup.html.image.NonCachingImage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.