Juxta Source Overview

From Collex/ARC Wiki
Jump to: navigation, search

This document describes the java package originization of the Juxta source code. Hopefully this document will make it easier to get oriented in the project source and to find what you are looking for.

The code is organized into three source folders: the juxta application code, diff alogrithm code, and common code area which is for somewhat generalized and reusable code. What follows is a description of each high level package namespace.

edu.virginia.speclab.juxta.author

This is the top level package for the Juxta application itself. The Juxta code base follows a model-view/controller paradigm. The package structure makes this obvious, with application code found in either the model or view packages.

edu.virginia.speclab.juxta.author.model

This is where all loading, saving, processing and store of data occurs. This package is built on top of the diff package, which does the actual work of comparing documents.

edu.virginia.speclab.juxta.author.view

This package is where all the display, reporting, and user interactivity code is housed. At this level are found dialogs and views which don't have enough supporting classes to merit their own package, the high level modules which organize the view, and the odd controller interface.

edu.virginia.speclab.juxta.author.view.collation

This is where you can find the DifferenceViewer and its supporting classes. This code displays the "heat map" color coded display of the base text.

edu.virginia.speclab.juxta.author.view.compare

Here is the code for displaying a side-by-side comparison of the documents.

edu.virginia.speclab.juxta.author.view.reports

This code uses a velocity script to generate the HTML report files. The script can be found in res/forms.

edu.virginia.speclab.juxta.author.view.ui

These are UI odds and ends that are reusable within the scope of the Juxta project, but probably not for other projects. Also in here is JuxtaUserInterfaceStyle, which houses many of the color constants and file paths to icon image resources. The icons are stored in res/icons.

edu.virginia.speclab

Now for the code found in the common source folder. This is stuff I could imagine some other project wanting to use besides Juxta.

edu.virginia.speclab.exceptions

This package contains a simple scheme for standardizing exception handling and providing a consitent reporting UI to the user and to the log files. It uses SimpleLogger from the util package below.

edu.virginia.speclab.ui

These are slightly generalized based classes and interfaces used to construct the Juxta UI. I found it constructive to seperate the code that did Swing magic from the application code to keep these unrelated concerns unrelated.

edu.virginia.speclab.util

Some good stuff in here, logging, file utilities, image loading, other odds and ends.

edu.virginia.speclab.diff

Ok, this is the fun part, the code that drives the diff algorithm itself. This package is found in the diff source folder. The top level classes do the actual diffing, with the sub packages containing supporting code, extensions, and tests.

edu.virginia.speclab.diff.collation

There is diffing, and then there is collation. Collation takes all the diff results and pools them together into collections of Differences. These classes represent or work on this collection as a whole.

edu.virginia.speclab.diff.document

This package houses the world famous DocumentModel, which is the base class of JuxtaDocumentModel. Classes for reading and writing document models are found here.

edu.virginia.speclab.diff.test

The JUnit tests for the diff algorithm.

edu.virginia.speclab.diff.token

These classes handle the tokenization of the document into comparable tokens.

Personal tools