Examples of PhotoInfo


Examples of org.photovault.imginfo.PhotoInfo

       This method is called when a PhotoInfo that is visible in the
       view is changed. it redraws the thumbnail & texts ascociated
       with it
    */
    public void photoInfoChanged( PhotoInfoChangeEvent ev ) {
  PhotoInfo photo = (PhotoInfo) ev.getSource();
  repaintPhoto( photo );
  // Find the location of the photo

    }
View Full Code Here

Examples of org.photovault.imginfo.PhotoInfo

    private PhotoInfo getPhotoAtLocation( int x, int y ) {
        if ( photoCollection == null ) {
            return null;
        }

        PhotoInfo photo = null;
        int row = (int) y / rowHeight;
        int col = (int) x / columnWidth;
        int photoNum = row * columnsToPaint + col;
        log.warn( "Located photo # " + photoNum );
       
View Full Code Here

Examples of org.photovault.imginfo.PhotoInfo

     * @return Rectangle bounding the photo or null if photoNum is larger than
     * # of photos.
     */
    protected Rectangle getPhotoBounds( int photoNum ) {
        if ( photoNum < photoCollection.getPhotoCount() ) {
            PhotoInfo photoCandidate = photoCollection.getPhoto( photoNum );
            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();
View Full Code Here

Examples of org.photovault.imginfo.PhotoInfo

  Rectangle viewRect = null;
  if ( parent instanceof JViewport ) {
      viewRect = ((JViewport)parent).getViewRect();
  }

  PhotoInfo nextPhoto = null;
 
  // Walk through all photos until we find a photo that is visible
  // and does not have a thumbnail. If all visible photos have a thumbnail
        // but some non-visible ones do not, create a thumbnail for one of those.
  log.debug( "Finding photo without thumbnail" );
  for ( int n = 0; n < photoCollection.getPhotoCount(); n++ ) {
            PhotoInfo photoCandidate = photoCollection.getPhoto( n );
      log.debug( "Photo " + photoCandidate.getUid() );
      if ( !photoCandidate.hasThumbnail() ) {
    log.debug( "No thumbnail" );
    Rectangle photoRect = getPhotoBounds( n );
    if ( photoRect.intersects( viewRect )  ) {
        // This photo is visible so it is a perfect candidate
        // for thumbnail creation. Do not look further
        nextPhoto = photoCandidate;
        break;
    } else if ( nextPhoto == null ) {
        // Not visible but no photo without thumbnail has been
        // found previously. Store as a candidate and keep looking.
        nextPhoto = photoCandidate;
    }       
      }
  }
  if ( nextPhoto != null && !thumbCreatorThread.isBusy() ) {
      final PhotoInfo p = nextPhoto;
//       SwingUtilities.invokeLater( new Runnable() {
//         public void run() {
      log.debug( "Making request for the next thumbail, " + p.getUid() );
      thumbCreatorThread.createThumbnail( p );
      log.debug( "request submitted" );
//         }
//     });
  }
View Full Code Here

Examples of org.photovault.imginfo.PhotoInfo

      // Selection was already handled by drag handler so do nothing
      dragJustEnded = false;
      return;
  }
 
        PhotoInfo clickedPhoto = getPhotoAtLocation( mouseEvent.getX(), mouseEvent.getY() );
        if ( clickedPhoto != null ) {
            if ( mouseEvent.isControlDown() ) {
                photoClickedCtrlDown( clickedPhoto );
            } else {
                photoClickedNoModifiers( clickedPhoto );
            }
      // If this was a doublke click open the selected photo(s)
      if ( mouseEvent.getClickCount() == 2 ) {
    showSelectedPhotoAction.actionPerformed( new ActionEvent( this, 0, null ) );
      }
        } else {
            // The click was between photos. Clear the selection
            if ( !mouseEvent.isControlDown() ) {
    Object[] oldSelection = selection.toArray();
    selection.clear();
    fireSelectionChangeEvent();
    for ( int n = 0; n < oldSelection.length; n++ ) {
        PhotoInfo photo = (PhotoInfo) oldSelection[n];
        repaintPhoto( photo );
    }

            }
        }
View Full Code Here

Examples of org.photovault.imginfo.PhotoInfo

    private void photoClickedNoModifiers( PhotoInfo clickedPhoto ) {
  // Clear selection & issue repaint requests for all selected photos
  Object[] oldSelection = selection.toArray();
        selection.clear();
  for ( int n = 0; n < oldSelection.length; n++ ) {
      PhotoInfo photo = (PhotoInfo) oldSelection[n];
      repaintPhoto( photo );
  }
     
        selection.add( clickedPhoto );
  fireSelectionChangeEvent();
View Full Code Here

Examples of org.photovault.imginfo.PhotoInfo

    public void mousePressed(MouseEvent mouseEvent) {
        // save the mouse press event so that we can later decide whether this gesture
        // is intended as a drag
        firstMouseEvent = mouseEvent;

  PhotoInfo photo = getPhotoAtLocation( mouseEvent.getX(), mouseEvent.getY() );
  if ( photo == null ) {
      dragType = DRAG_TYPE_SELECT;
      // If ctrl is not down clear the selection
            if ( !mouseEvent.isControlDown() ) {
    Object[] oldSelection = selection.toArray();
    selection.clear();
    fireSelectionChangeEvent();
    for ( int n = 0; n < oldSelection.length; n++ ) {
        PhotoInfo p = (PhotoInfo) oldSelection[n];
        repaintPhoto( p );
    }
   
            }
      dragSelectionRect = new Rectangle( mouseEvent.getX(), mouseEvent.getY(), 0, 0 );
View Full Code Here

Examples of org.photovault.imginfo.PhotoInfo

        }  
    }
   
    public void selectNextPhoto() {
        if ( this.getSelectedCount() == 1 ) {
            PhotoInfo selectedPhoto = (PhotoInfo) (selection.toArray())[0];
            int idx = photos.indexOf( selectedPhoto );
            idx++;
            if ( idx >= photos.size() ) {
                idx = photos.size()-1;
            }
View Full Code Here

Examples of org.photovault.imginfo.PhotoInfo

        }       
    }
   
    public void selectPreviousPhoto() {
        if ( this.getSelectedCount() == 1 ) {
            PhotoInfo selectedPhoto = (PhotoInfo) (selection.toArray())[0];
            int idx = photos.indexOf( selectedPhoto );
            idx--;
            if ( idx < 0 ) {
                idx = 0;
            }
View Full Code Here

Examples of org.photovault.imginfo.PhotoInfo

            PhotoFolder folder = dlg.getSelectedFolder();
            // A folder was selected, so add the selected photo to this folder
            Collection selectedPhotos = getSelection();
            Iterator iter = selectedPhotos.iterator();
            while ( iter.hasNext() ) {
                PhotoInfo photo = (PhotoInfo) iter.next();
                if ( photo != null ) {
                    folder.addPhoto ( photo );
                }
            }
        }
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.