Go to Google Home
A data-code-compute resource for research and education in information visualization
InfoVis Home Learning Modules Software Databases Compute Resources References

How to Extend the XML Toolkit

XML Data Models | Persisting Data | Ant Build File | Acknowledgments

XML Data Models

One major feature of the repository is that multiple algorithms can be used to analyze or visualize one and the same data set. In addition, data analysis algorithms produce output formats that provide direct input to the existing layout algorithms. To facilitate this, a number of data models is used.

To give an example of a data model, take the Swing TreeModel interface as part of the standard Java edition (J2SE). It defines a suitable data model for a JTree. A JTree object doesn't actually contain your data; it simply provides a view of the data. Models can be used to retrieve and store data. Currently, the XML toolkit uses the TreeModel, TableModel, and ListModel which are part of the standard Java edition (J2SE) along with the MatrixModel and NetworkModel which are additional interfaces supported in this framework. The TreeModel defines a suitable interface for RadialTree, HyperbolicTree, etc.

Have a look at the 'Demo.java' program in the '/src/iu/iv/persistence/demo' directory. The code line

save(radialTree.getModel().getTreeModel(), FILE_PATH);

retrieves a TreeModel.

The persistors are stored in the '/IVR/src/edu/iu/iv/persistence' directory. 'TreeModelPersister.java' has a method called 'persist' that persists a model (e.g., TreeModel) to the data storage object.

public void save(TreeModel model, Key location) {
      Persister persister = XMLPersistenceFactory.getInstance()

      persister.persist(model, dataSet);
      XMLWriter writer = new XMLWriter();
      writer.write(dataSet, location);
      System.err.println("end persist");

Like any non-trivial Swing component, the tree gets data by querying its data model.

You can run the demo under unix by typicing 'ant persistencedemo' in the main IVR directory.

Persisting Data

The first think you may like to try is to convertyour own data into a format that the toolkit can process. Sample converter code that reads out a directory or file and saves the result in TreeModel format can be found in the '/IVR/iu/iv/util/converter' directory.

Ant Build File

In order to compile a new converter, say you called it MyConverter, the subsequent need to be added to the 'build.xml' file in the 'IVR' directory:

  <target name="myconverter" depends="compile">
    <java classname='edu.iu.iv.util.converter.MyConverter'
      <classpath refid='project.classpath' />
      <arg value="${arg0}" />
      <arg value="${arg1}" />

We assumed that you can give it one input file and an output file as arguments, similar to the converter introduced in Visualize Your Own Data.

More information will be added soon!


This documentation was compiled by Katy Börner and Bruce William Herr.

Information Visualization Cyberinfrastructure @ SLIS, Indiana University
Last Modified February 10, 2004