Examples of PhotoInfo


Examples of org.photovault.imginfo.PhotoInfo

     This method is called by the indexer when a new file has been indexed. It
     updates the statistics fields and thumbnail displayed in dialog.
     @param e Event object describing the file that has been indexed.
     */
    public void fileIndexed(ExtVolIndexerEvent e) {
        final PhotoInfo p = e.getPhoto();
        final ExtVolIndexer indexer = (ExtVolIndexer) e.getSource();
       
        SwingUtilities.invokeLater( new Runnable() {
            public void run() {
                int fileCount = indexer.getIndexedFileCount();
View Full Code Here

Examples of org.photovault.imginfo.PhotoInfo

   
    public void actionPerformed( ActionEvent ev ) {
        Collection selectedPhotos = view.getSelection();
        Iterator iter = selectedPhotos.iterator();
        while ( iter.hasNext() ) {
            PhotoInfo photo = (PhotoInfo) iter.next();
            if ( photo != null ) {
                double curRot = photo.getPrefRotation();
                photo.setPrefRotation( curRot + rot );
                Rectangle2D origCrop = photo.getCropBounds();
                Rectangle2D newCrop = calcNewCrop( origCrop );
                photo.setCropBounds( newCrop );
            }
        }
    }
View Full Code Here

Examples of org.photovault.imginfo.PhotoInfo

    public void windowClosing(WindowEvent e) {
        System.exit(0);
    }
      } );

  PhotoInfo photo = null;
  if ( args.length == 2 ) {
      if ( args[0].equals( "-id" ) ) {
    try {
        int id = Integer.parseInt( args[1] );
        log.debug( "Getting photo " + id );
View Full Code Here

Examples of org.photovault.imginfo.PhotoInfo

            ODMG.initODMG( "", "", db );
        } catch (PhotovaultException ex) {
            fail( ex.getMessage() );
        }
        File photoFile = new File( "testfiles/test1.jpg" );
        PhotoInfo photo = null;
        try {
            photo = PhotoInfo.addToDB(photoFile);
        } catch (PhotoNotFoundException ex) {
            ex.printStackTrace();
            fail( ex.getMessage() );
        }
        photo.setPhotographer( "test" );
        try {
           
            PhotoInfo photo2 = PhotoInfo.retrievePhotoInfo( photo.getUid() );
            Thumbnail thumb = photo2.getThumbnail();
            this.assertFalse( "Default thumbnail returned", thumb == Thumbnail.getDefaultThumbnail() );
        } catch (PhotoNotFoundException ex) {
            fail( "Photo not found in database" );
        }
    }
View Full Code Here

Examples of org.photovault.imginfo.PhotoInfo

  // Then notify all photos belonging to this folder
  if ( photos != null ) {
      Iterator photoIter = photos.iterator();
      while ( photoIter.hasNext() ) {
    PhotoInfo photo = (PhotoInfo) photoIter.next();
    photo.removedFromFolder( this );
      }
  }
  Database db = ODMG.getODMGDatabase();
  db.deletePersistent( this );
 
View Full Code Here

Examples of org.photovault.imginfo.PhotoInfo

   
    /** Main method to aid in testing this component
     */
    public static void main( String args[] ) {
  // Parse the arguments
  PhotoInfo photo = null;
  log.debug( "Number of args" + args.length );
  log.debug( args.toString() );
  if ( args.length == 2 ) {
      if ( args[0].equals( "-f" ) ) {
    File f = new File( args[1] );
View Full Code Here

Examples of org.photovault.imginfo.PhotoInfo

       Implementation of TableCellRenderer interface
    */
    public Component getTableCellRendererComponent( JTable table, Object obj,
                boolean isSelected, boolean hasFocus,
                int row, int column) {
  PhotoInfo p = (PhotoInfo) obj;
  setPhotop );
  if (isSelected) {
      if (selectedBorder == null) {
    setBackground( table.getSelectionBackground() );
      }
View Full Code Here

Examples of org.photovault.imginfo.PhotoInfo

     */

    public void testPhotoAddition() {
  String fname = "test1.jpg";
  File f = new File( testImgDir, fname );
  PhotoInfo photo = null;
  try {
      photo = PhotoInfo.addToDB( f );
  } catch ( PhotoNotFoundException e ) {
      fail( "Could not find photo: " + e.getMessage() );
  }

  PhotoFolder folder = null;
  // Create a folder for the photo
  try {
      folder = PhotoFolder.create( "PhotoAdditionTest", PhotoFolder.getRoot() );
      folder.addPhoto( photo );
     
      assertEquals( "Photo not visible in folders' photo count", folder.getPhotoCount(), 1 );
  } finally {
      // Clean up the test folder
      PhotoFolder parent = folder.getParentFolder();
      parent.removeSubfolder( folder );
      photo.delete();
  }
    }
View Full Code Here

Examples of org.photovault.imginfo.PhotoInfo

  assertEquals( "Number of photos in folder does not match", 2, folder.getPhotoCount() );
 
  // Check that the folder content is OK
  boolean found = false;
  for ( int i = 0; i < folder.getPhotoCount(); i++ ) {
      PhotoInfo photo = folder.getPhoto( i );
      if ( photo.getDescription().equals( "testPhotoRetrieval1" ) ) {
    found = true;
      }
  }
  assertTrue( "Photo testRetrieval1 not found", found );
View Full Code Here

Examples of org.photovault.imginfo.PhotoInfo

  l1.changedFolder = null;

  // Test that photo addition is notified
  String fname = "test1.jpg";
  File f = new File( testImgDir, fname );
  PhotoInfo photo = null;
  try {
      photo = PhotoInfo.addToDB( f );
  } catch ( PhotoNotFoundException e ) {
      fail( "Could not find photo: " + e.getMessage() );
  }
  l1.modified = false;
  folder.addPhoto( photo );
  assertTrue( "l1 not called when adding photo", l1.modified );

  l1.modified = false;
  folder.removePhoto( photo );
  assertTrue( "l1 not called when removing photo", l1.modified );
  photo.delete();
 
  subfolder.delete();
  assertTrue( "Not notified of subfolder structure change", l1.structureModified );
  assertEquals( "subfolder info not correct", folder, l1.structChangeFolder );
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.