Package org.photovault.imginfo.indexer

Examples of org.photovault.imginfo.indexer.ExtVolIndexer


            } catch (PhotovaultException ex) {
                // This should not happen since we just checked for it!!!
            }
           
            // Set up the indexer
            ExtVolIndexer indexer = new ExtVolIndexer( v );
            PhotoFolder parentFolder = fc.getExtvolParentFolder();
            if ( parentFolder == null ) {
                parentFolder = PhotoFolder.getRoot();
            }
            String rootFolderName = "extvol_" + dir.getName();
            if ( rootFolderName.length() > PhotoFolder.NAME_LENGTH ) {
                rootFolderName = rootFolderName.substring( 0, PhotoFolder.NAME_LENGTH );
            }
            PhotoFolder topFolder = PhotoFolder.create( rootFolderName,
                    parentFolder );
            topFolder.setDescription( "Indexed from " + dir.getAbsolutePath() );
            indexer.setTopFolder( topFolder );

            // Save the configuration of the new volume
            settings.saveConfig();
           
            // Show status dialog & index the directory
View Full Code Here


     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();
                indexedFilesLabel.setText( "" + fileCount );
                int photoCount = indexer.getNewPhotoCount();
                newPhotosLabel.setText( "" + photoCount );
                int instanceCount = indexer.getNewInstanceCount();
                newInstancesLabel.setText( "" + instanceCount );
                int folderCount = indexer.getNewFolderCount();
                newFoldersLabel.setText( "" + folderCount );
                if ( p != null ) {
                    thumbView.setPhoto( p );
                }
                progressBar.setValue( indexer.getPercentComplete() );
                long timeDiff = System.currentTimeMillis() - indexer.getStartTime().getTime();
               
                timeElapsedLabel.setText( getTimeString( timeDiff ) );
            }
           
            DecimalFormat fmt = new DecimalFormat( "00" );
View Full Code Here

     */
    private void indexNextVolume() {
        if ( volumes.size() > 0 ) {
            errorFiles.clear();
            vol = (ExternalVolume)volumes.get(0);
            ExtVolIndexer indexer = new ExtVolIndexer( vol );
            volumes.remove( vol );
            indexer.addIndexerListener( this );
            Thread t = new Thread( indexer );
            t.start();
            percentIndexed = 0;
            StatusChangeEvent e = new StatusChangeEvent( this, "Indexing "
                    + vol.getBaseDir() );
View Full Code Here

    ExternalVolume vol = null;
   
    List errorFiles = new ArrayList();
   
    public void fileIndexed(ExtVolIndexerEvent e) {
        ExtVolIndexer indexer = (ExtVolIndexer) e.getSource();
        int newPercentIndexed = indexer.getPercentComplete();
        if ( e.getResult() == ExtVolIndexerEvent.RESULT_ERROR ) {
            StringBuffer errorBuf = new StringBuffer( "Error indexing file" );
            if ( e.getIndexedFile() != null ) {
                errorBuf.append( " " ).append( e.getIndexedFile().getAbsolutePath() );
                errorFiles.add( e.getIndexedFile() );
View Full Code Here

TOP

Related Classes of org.photovault.imginfo.indexer.ExtVolIndexer

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.