javatools.filehandlers
Class FigureProducer

java.lang.Object
  extended by javatools.filehandlers.FigureProducer

public class FigureProducer
extends java.lang.Object

This class is part of the Java Tools (see http://mpii.de/yago-naga/javatools). It is licensed under the Creative Commons Attribution License (see http://creativecommons.org/licenses/by/3.0) by the YAGO-NAGA team (see http://mpii.de/yago-naga). This class handles table data of the form

 header1 | header2 | ...
 ------------------------
 entry1  | entry2  | ...
 ...
 
Each column has a ColumnDescriptor and a table consists of column-descriptors and values for the rows, e.g. as follows:
 Table table=new Table("Table caption",
 // left-aligned, non-emphasized column
 new ColumnDescriptor("header1", Alignment.LEFT, false),
 // a column with numerical values and 5 digits after the dot
 new ColumnDescriptor("header2", "##.#####"));

 table.addRow("blah",7);
 table.addRow("blub",8.876);
 
Tables can be rendered as Latex-tables and as JPG graphics as follows:
 FigureProducer.latexTable(table,"output.tex");
 FigureProducer.figure(table,"output.jpg");
 


Nested Class Summary
static class FigureProducer.Alignment
          Alignment within a cell (left/right/center)
static class FigureProducer.ColumnDescriptor
          describes a column
static class FigureProducer.Table
          Holds table data
 
Constructor Summary
FigureProducer()
           
 
Method Summary
static void figure(FigureProducer.Table table, java.io.File output)
          Writes a neat figure to a jpg file for a table
static java.lang.String latexTable(FigureProducer.Table table)
          Produces a latex table for a table
static void latexTable(FigureProducer.Table table, java.io.File output)
          Produces a latex table and stores it in a file
static void main(java.lang.String[] args)
          Test method
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FigureProducer

public FigureProducer()
Method Detail

latexTable

public static java.lang.String latexTable(FigureProducer.Table table)
Produces a latex table for a table


latexTable

public static void latexTable(FigureProducer.Table table,
                              java.io.File output)
                       throws java.io.IOException
Produces a latex table and stores it in a file

Throws:
java.io.IOException

figure

public static void figure(FigureProducer.Table table,
                          java.io.File output)
                   throws java.io.IOException
Writes a neat figure to a jpg file for a table

Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Test method

Throws:
java.lang.Exception