Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: medi/util/AbstractPreviewer.java


1   /*
2    * AbstractPreviewer.java
3    *
4    * Created on 16 luglio 2002, 19.07
5       Medi - A media archiver. Archives media files for easy management.
6       Copyright (C) 2002  Antonio Petrelli
7   
8       This program is free software; you can redistribute it and/or modify
9       it under the terms of the GNU General Public License as published by
10      the Free Software Foundation; either version 2 of the License, or
11      (at your option) any later version.
12  
13      This program is distributed in the hope that it will be useful,
14      but WITHOUT ANY WARRANTY; without even the implied warranty of
15      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16      GNU General Public License for more details.
17  
18      You should have received a copy of the GNU General Public License
19      along with this program; if not, write to the Free Software
20      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  
22      Contact me at: brenmcguire@users.sourceforge.net
23   */
24  
25  package medi.util;
26  
27  import medi.base.Provider;
28  import javatools.db.*;
29  
30  /** It is an abstract class used as a base for file-type-specific previewers.
31   * @author Antonio Petrelli
32   * @version 0.1.0
33   */
34  public abstract class AbstractPreviewer {
35  
36      /** Creates new AbstractPreviewer */
37      public AbstractPreviewer() {
38          prv = null;
39          extensions = null;
40      }
41  
42      /** Sets the provider to use.
43       * @param pPrv The provider to use.
44       */    
45      public void setProvider(Provider pPrv) {
46          prv=pPrv;
47      }
48      
49      /** Returns the managed extensions.
50       * @return The managed extension.
51       */    
52      public String[] getExtensions() {
53          return extensions;
54      }
55      
56      /** Returns the preview component.
57       * @param filePath The file path to preview.
58       * @throws DbException If something goes wrong.
59       * @return The preview component to show.
60       */    
61      public abstract java.awt.Component preview(String filePath) throws DbException;
62      
63      /** The provider to use.
64       */    
65      protected Provider prv;
66      /** The managed extensions.
67       */    
68      protected String[] extensions;
69  }