in pprogress...
[jalview.git] / forester_applications / src / org / forester / applications / phylo2graphics.java
1
2 package org.forester.applications;
3
4 import java.awt.Color;
5 import java.io.File;
6 import java.io.IOException;
7
8 import org.forester.archaeopteryx.AptxUtil;
9 import org.forester.archaeopteryx.AptxUtil.GraphicsExportType;
10 import org.forester.archaeopteryx.Configuration;
11 import org.forester.archaeopteryx.Options;
12 import org.forester.archaeopteryx.TreeColorSet;
13
14 public class phylo2graphics {
15
16     public static void main( final String[] args ) {
17         try {
18             final Configuration config = new Configuration();
19             // Could also read a configuration file with:
20             // Configuration config = new Configuration("my_configuration_file.txt", false, false, false);
21             config.putDisplayColors( TreeColorSet.BACKGROUND, new Color( 255, 255, 255 ) );
22             config.putDisplayColors( TreeColorSet.BRANCH, new Color( 0, 0, 0 ) );
23             config.putDisplayColors( TreeColorSet.TAXONOMY, new Color( 0, 0, 0 ) );
24             config.setPhylogenyGraphicsType( Options.PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR );
25             AptxUtil.writePhylogenyToGraphicsFile( new File( "/home/czmasek/tol_117_TEST.xml" ),
26                                                    new File( "/home/czmasek/tol_117_TEST_.png" ),
27                                                    1000,
28                                                    1000,
29                                                    GraphicsExportType.PNG,
30                                                    config );
31             // If the tree 'phy' already exists, can also use this:
32             //AptxUtil.writePhylogenyToGraphicsFile( phy,
33             //                                       new File( "/home/czmasek/tol_117_TEST_.png" ),
34             //                                      1000,
35             //                                      1000,
36             //                                      GraphicsExportType.PNG,
37             //                                      config );
38         }
39         catch ( final IOException e ) {
40             e.printStackTrace();
41         }
42     }
43 }