Changeset 3155

Show
Ignore:
Timestamp:
03/11/10 14:41:02 (5 months ago)
Author:
martijn
Message:

Biopax conversion added to converter

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/build.xml

    r3150 r3155  
    266266        <target name="jar" depends="compile-swing" description="Generates pathvisio.jar and pathvisio_core.jar"> 
    267267                <manifestclasspath property="manifest.cp" jarfile="pathvisio.jar"> 
    268                         <classpath refid="standalone.libs" /> 
     268                        <classpath> 
     269                                <path refid="standalone.libs" /> 
     270                        <!--extra transient dependencies for biopax conversion --> 
     271                                <pathelement location="Biopax3GPML.jar"/> 
     272                        </classpath> 
    269273                </manifestclasspath> 
    270274 
  • trunk/src/core/org/pathvisio/util/Converter.java

    r2979 r3155  
    3535import org.pathvisio.model.MappFormat; 
    3636import org.pathvisio.model.Pathway; 
     37import org.pathvisio.model.PathwayExporter; 
     38import org.pathvisio.model.PathwayImporter; 
    3739import org.pathvisio.model.RasterImageExporter; 
    3840import org.pathvisio.preferences.GlobalPreference; 
     
    7173    public static void main(String[] args) 
    7274    { 
    73                 PreferenceManager.init(); 
     75        // Handle command line arguments 
     76        // Check for custom output path 
     77        Logger.log.setStream (System.err); 
     78                                                //debug, trace, info, warn, error, fatal 
     79        Logger.log.setLogLevel (false, false, true, true, true, true); 
     80 
     81        PreferenceManager.init(); 
    7482        Engine engine = new Engine(); 
    7583        engine.addPathwayImporter(new GpmlFormat()); 
     
    8492                engine.addPathwayExporter(new DataNodeListExporter()); 
    8593 
     94                // Transient dependency on Biopax converter 
     95                try 
     96                { 
     97                        Class<?> c = Class.forName("org.pathvisio.biopax3.BiopaxFormat"); 
     98                        Object o  = c.newInstance(); 
     99                        engine.addPathwayExporter((PathwayExporter)o); 
     100                        engine.addPathwayImporter((PathwayImporter)o); 
     101                } 
     102                catch (ClassNotFoundException ex) 
     103                { 
     104                        Logger.log.warn("BioPAX converter not in classpath, BioPAX conversion not available today."); 
     105                } 
     106                catch (InstantiationException e) 
     107                { 
     108                        Logger.log.error("BioPAX instantiation error", e); 
     109                } 
     110                catch (IllegalAccessException e) 
     111                { 
     112                        Logger.log.warn("Access to BioPAX class is Illegal", e); 
     113                } 
     114                 
    86115                //Enable MiM support (for export to graphics formats) 
    87116                PreferenceManager.getCurrent().setBoolean(GlobalPreference.MIM_SUPPORT, true); 
     
    90119        File inputFile = null; 
    91120        File outputFile = null; 
    92  
    93         // Handle command line arguments 
    94         // Check for custom output path 
    95         Logger.log.setStream (System.err); 
    96                                                 //debug, trace, info, warn, error, fatal 
    97         Logger.log.setLogLevel (false, false, true, true, true, true); 
    98121 
    99122                boolean error = false;