public static void main(String args[]) {
String fileName = "data/table/salivary.tqd";
if (args.length > 0) {
fileName = args[0];
}
DefaultTable t = new DefaultTable(); // Create a table
AbstractReader reader = // Create a reader for the specified file
TableReaderFactory.createTableReader(fileName, t);
if (reader == null || !reader.load()) { // if it works, load the file
System.err.println("cannot load " + fileName);
System.exit(1);
}
TimeSeriesVisualization visualization = // Create a visualization
new TimeSeriesVisualization(t); // for Time Series
VisualizationPanel panel = // Create a Swing Component to hold it
new VisualizationPanel(visualization);
// Associate the color with the Name attribute
visualization.setVisualColumn(
TimeSeriesVisualization.VISUAL_COLOR,
t.getColumn("Name"));
// Display the visualization Panel in a simple JFrame
JFrame frame = new JFrame(fileName);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(panel);