Examples of Thumbnail


Examples of org.dspace.content.Thumbnail

           
            thumbBitstream   = dao.getFirstBitstream(itemId, "THUMBNAIL");
        }

        if (thumbBitstream != null)
            return new Thumbnail(thumbBitstream, primaryBitstream);

        return null;
    }
View Full Code Here

Examples of org.dspace.content.Thumbnail

            throws JspException
    {
      try
      {
            Context c = UIUtil.obtainContext(hrq);
            Thumbnail thumbnail = ItemService.getThumbnail(c, item.getID(), linkToBitstream);

            if (thumbnail == null)
        {
          return "";
        }
          StringBuffer thumbFrag = new StringBuffer();

          if (linkToBitstream)
          {
            Bitstream original = thumbnail.getOriginal();
            String link = hrq.getContextPath() + "/bitstream/" + item.getHandle() + "/" + original.getSequenceID() + "/" +
                    UIUtil.encodeBitstreamName(original.getName(), Constants.DEFAULT_ENCODING);
            thumbFrag.append("<a target=\"_blank\" href=\"" + link + "\" />");
          }
          else
          {
            String link = hrq.getContextPath() + "/handle/" + item.getHandle();
            thumbFrag.append("<a href=\"" + link + "\" />");
          }

          Bitstream thumb = thumbnail.getThumb();
          String img = hrq.getContextPath() + "/retrieve/" + thumb.getID() + "/" +
                UIUtil.encodeBitstreamName(thumb.getName(), Constants.DEFAULT_ENCODING);
          String alt = thumb.getName();
            String scAttr = getScalingAttr(hrq, thumb);
            thumbFrag.append("<img src=\"")
View Full Code Here

Examples of org.dspace.content.Thumbnail

            throws JspException
    {
        try
        {
            Context c = UIUtil.obtainContext(hrq);
            Thumbnail thumbnail = ItemService.getThumbnail(c, item.getID(), linkToBitstream);

            if (thumbnail == null)
            {
                return "";
            }
            StringBuffer thumbFrag = new StringBuffer();

            if (linkToBitstream)
            {
                Bitstream original = thumbnail.getOriginal();
                String link = hrq.getContextPath() + "/bitstream/" + item.getHandle() + "/" + original.getSequenceID() + "/" +
                                UIUtil.encodeBitstreamName(original.getName(), Constants.DEFAULT_ENCODING);
                thumbFrag.append("<a target=\"_blank\" href=\"" + link + "\" />");
            }
            else
            {
                String link = hrq.getContextPath() + "/handle/" + item.getHandle();
                thumbFrag.append("<a href=\"" + link + "\" />");
            }

            Bitstream thumb = thumbnail.getThumb();
            String img = hrq.getContextPath() + "/retrieve/" + thumb.getID() + "/" +
                        UIUtil.encodeBitstreamName(thumb.getName(), Constants.DEFAULT_ENCODING);
            String alt = thumb.getName();
            String scAttr = getScalingAttr(hrq, thumb);
            thumbFrag.append("<img src=\"")
View Full Code Here

Examples of org.dspace.content.Thumbnail

            thumbBitstream   = dao.getFirstBitstream(itemId, "THUMBNAIL");
        }

        if (thumbBitstream != null)
        {
            return new Thumbnail(thumbBitstream, primaryBitstream);
        }

        return null;
    }
View Full Code Here

Examples of org.dspace.content.Thumbnail

            throws JspException
    {
        try
        {
            Context c = UIUtil.obtainContext(hrq);
            Thumbnail thumbnail = ItemService.getThumbnail(c, item.getID(), linkToBitstream);

            if (thumbnail == null)
            {
                return "";
            }
            StringBuffer thumbFrag = new StringBuffer();

            if (linkToBitstream)
            {
                Bitstream original = thumbnail.getOriginal();
                String link = hrq.getContextPath() + "/bitstream/" + item.getHandle() + "/" + original.getSequenceID() + "/" +
                                UIUtil.encodeBitstreamName(original.getName(), Constants.DEFAULT_ENCODING);
                thumbFrag.append("<a target=\"_blank\" href=\"" + link + "\" />");
            }
            else
            {
                String link = hrq.getContextPath() + "/handle/" + item.getHandle();
                thumbFrag.append("<a href=\"" + link + "\" />");
            }

            Bitstream thumb = thumbnail.getThumb();
            String img = hrq.getContextPath() + "/retrieve/" + thumb.getID() + "/" +
                        UIUtil.encodeBitstreamName(thumb.getName(), Constants.DEFAULT_ENCODING);
            String alt = thumb.getName();
            String scAttr = getScalingAttr(hrq, thumb);
            thumbFrag.append("<img src=\"")
View Full Code Here

Examples of org.dspace.content.Thumbnail

            throws JspException
    {
      try
      {
            Context c = UIUtil.obtainContext(hrq);
            Thumbnail thumbnail = ItemService.getThumbnail(c, item.getID(), linkToBitstream);

            if (thumbnail == null)
        {
          return "";
        }
          StringBuffer thumbFrag = new StringBuffer();

          if (linkToBitstream)
          {
            Bitstream original = thumbnail.getOriginal();
            String link = hrq.getContextPath() + "/bitstream/" + item.getHandle() + "/" + original.getSequenceID() + "/" +
                    UIUtil.encodeBitstreamName(original.getName(), Constants.DEFAULT_ENCODING);
            thumbFrag.append("<a target=\"_blank\" href=\"" + link + "\" />");
          }
          else
          {
            String link = hrq.getContextPath() + "/handle/" + item.getHandle();
            thumbFrag.append("<a href=\"" + link + "\" />");
          }

          Bitstream thumb = thumbnail.getThumb();
          String img = hrq.getContextPath() + "/retrieve/" + thumb.getID() + "/" +
                UIUtil.encodeBitstreamName(thumb.getName(), Constants.DEFAULT_ENCODING);
          String alt = thumb.getName();
            String scAttr = getScalingAttr(hrq, thumb);
            thumbFrag.append("<img src=\"")
View Full Code Here

Examples of org.photovault.imginfo.Thumbnail

    /**
       Implementation of @see PhotoInfoChangeListener. Checks if the Thumbnail has changed (e.g. the preferred
       rotation has changed) and updates thumbnail if appropriate
    */
    public void photoInfoChanged( PhotoInfoChangeEvent e ) {
  Thumbnail newThumb = photo.getThumbnail();
  if ( newThumb != thumbnail ) {
      thumbnail = newThumb;
      repaint();
  }
    }
View Full Code Here

Examples of org.photovault.imginfo.Thumbnail

       
        // Create a transaction which will be used for persisten object operations
        // during painting (to avoid creating several short-livin transactions)
        ODMGXAWrapper txw = new ODMGXAWrapper();
       
        Thumbnail thumbnail = null;
        log.debug( "finding thumb" );
        boolean hasThumbnail = photo.hasThumbnail();
        log.debug( "asked if has thumb" );
        if ( hasThumbnail ) {
            log.debug( "Photo " + photo.getUid() + " has thumbnail" );
            thumbnail = photo.getThumbnail();
            log.debug( "got thumbnail" );
        } else {
            /*
             Check if the thumbnail has been just invalidated. If so, use the
             old one until we get the new thumbnail created.
             */
            thumbnail = photo.getOldThumbnail();
            if ( thumbnail != null ) {
                useOldThumbnail = true;
            } else {
                // No success, use default thumnail.
                thumbnail = Thumbnail.getDefaultThumbnail();
            }

            // The photo does not have a thumbnail, so request one to be created
            if ( !thumbCreatorThread.isBusy() ) {
                log.debug( "Create thumbnail for " + photo.getUid() );
                thumbCreatorThread.createThumbnail( photo );
                log.debug( "Thumbnail request submitted" );
            }           
        }
        thumbReadyTime = System.currentTimeMillis();
       
        log.debug( "starting to draw" );
        // Find the position for the thumbnail
        BufferedImage img = thumbnail.getImage();
        if ( img.getWidth() > columnWidth || img.getHeight() > rowHeight ) {
            /*
             If the image is too large for the space reserved for thumbnail, crop
             (yes, this should not be possible but many kinds of miracles do
             happen. Also this has happened in some weird test cases!!!
View Full Code Here

Examples of org.photovault.imginfo.Thumbnail

            log.debug( "Checking bounds" );

            // Get thumbnail dimensions or use defaults if no thumbnail available
            int width = 100;
            int height = 75;
            Thumbnail thumb = null;
      if ( photoCandidate.hasThumbnail() ) {
    thumb = photoCandidate.getThumbnail();
      }
            if ( thumb != null ) {
                BufferedImage img = thumb.getImage();
                width = img.getWidth();
                height = img.getHeight();
            }
      int row = (int) photoNum / columnsToPaint;
      int col = photoNum - row*columnsToPaint;
 
View Full Code Here

Examples of org.photovault.imginfo.Thumbnail

        log.debug( "Waiting..." );
        wait();
        log.debug( "Waited..." );
        if ( photo != null ) {
      log.debug( "Creating thumbnail for " + photo.getUid() );
      Thumbnail thumb = null;
      while ( thumb == null ) {
          try {
        thumb = photo.getThumbnail();
          } catch ( Throwable e ) {
        // Most likely out of memory. Sleep for a while (to allow for other
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.