diff --git a/projects/viztool/bin/build-dist.sh b/projects/viztool/bin/build-dist.sh new file mode 100755 index 00000000..08c29b9e --- /dev/null +++ b/projects/viztool/bin/build-dist.sh @@ -0,0 +1,41 @@ +#!/bin/sh +# +# $Id: build-dist.sh,v 1.1 2001/08/12 03:59:21 mdb Exp $ +# +# Builds a distribution archive. This should be run from the top-level +# project directory and it will place the distribution archive into the +# directory identified by $DISTDIR. + +USAGE="Usage: $0 distname (eg. viztool-1.4)" +DISTDIR=dist + +if [ -z "$1" ]; then + echo $USAGE + exit -1 +else + TARGET=$1 +fi + +# build our excludes file +cat > .excludes < - - - - - - + + + + + + + + + + + + + + + + - - - + + + + + + - + - - - - - - + + packagenames="${doc.packages}" + windowtitle="${app.name} API" + doctitle="${app.name} API" + overview="src/java/com/samskivert/viztool/overview.html" + bottom="Copyright © 2001 ${copyright.holder}. All Rights Reserved." + destdir="${javadoc.dir}"> + + + + @@ -47,8 +63,8 @@ - + diff --git a/projects/viztool/src/java/com/samskivert/viztool/Driver.java b/projects/viztool/src/java/com/samskivert/viztool/Driver.java index 8c728ccb..0966127e 100644 --- a/projects/viztool/src/java/com/samskivert/viztool/Driver.java +++ b/projects/viztool/src/java/com/samskivert/viztool/Driver.java @@ -1,5 +1,5 @@ // -// $Id: Driver.java,v 1.6 2001/07/24 18:07:35 mdb Exp $ +// $Id: Driver.java,v 1.7 2001/08/12 03:59:21 mdb Exp $ package com.samskivert.viztool; @@ -9,6 +9,10 @@ import java.awt.print.*; import com.samskivert.viztool.enum.*; import com.samskivert.viztool.viz.*; +/** + * The application driver. This class parses the command line arguments + * and invokes the visualization code. + */ public class Driver { public static void main (String[] args) @@ -78,7 +82,7 @@ public class Driver System.exit(0); } else { - TestFrame frame = new TestFrame(viz); + VizFrame frame = new VizFrame(viz); // center the frame in the screen and show it Toolkit tk = frame.getToolkit(); diff --git a/projects/viztool/src/java/com/samskivert/viztool/Visualizer.java b/projects/viztool/src/java/com/samskivert/viztool/Visualizer.java index d16b795d..d0a779d6 100644 --- a/projects/viztool/src/java/com/samskivert/viztool/Visualizer.java +++ b/projects/viztool/src/java/com/samskivert/viztool/Visualizer.java @@ -1,8 +1,13 @@ // -// $Id: Visualizer.java,v 1.1 2001/07/04 18:24:07 mdb Exp $ +// $Id: Visualizer.java,v 1.2 2001/08/12 03:59:21 mdb Exp $ package com.samskivert.viztool.viz; -public class Visualizer +/** + * Not yet in use. This will probably eventually become the interface via + * which the driver accesses whichever visualizer is desired for a + * particular invocation. + */ +public interface Visualizer { } diff --git a/projects/viztool/src/java/com/samskivert/viztool/VizFrame.java b/projects/viztool/src/java/com/samskivert/viztool/VizFrame.java index 264996d2..f8f4298c 100644 --- a/projects/viztool/src/java/com/samskivert/viztool/VizFrame.java +++ b/projects/viztool/src/java/com/samskivert/viztool/VizFrame.java @@ -1,5 +1,5 @@ // -// $Id: VizFrame.java,v 1.1 2001/07/17 01:54:19 mdb Exp $ +// $Id: VizFrame.java,v 1.2 2001/08/12 03:59:21 mdb Exp $ package com.samskivert.viztool; @@ -8,16 +8,19 @@ import javax.swing.*; import com.samskivert.viztool.viz.HierarchyVisualizer; -public class TestFrame extends JFrame +/** + * The top-level frame in which visualizations are displayed. + */ +public class VizFrame extends JFrame { - public TestFrame (HierarchyVisualizer viz) + public VizFrame (HierarchyVisualizer viz) { - super("Test Frame"); + super("viztool"); // quit if we're closed setDefaultCloseOperation(EXIT_ON_CLOSE); - TestPanel panel = new TestPanel(viz); + VizPanel panel = new VizPanel(viz); getContentPane().add(panel, BorderLayout.CENTER); } } diff --git a/projects/viztool/src/java/com/samskivert/viztool/VizPanel.java b/projects/viztool/src/java/com/samskivert/viztool/VizPanel.java index 1f5f4ffc..02ac6b06 100644 --- a/projects/viztool/src/java/com/samskivert/viztool/VizPanel.java +++ b/projects/viztool/src/java/com/samskivert/viztool/VizPanel.java @@ -1,5 +1,5 @@ // -// $Id: VizPanel.java,v 1.1 2001/07/17 01:54:19 mdb Exp $ +// $Id: VizPanel.java,v 1.2 2001/08/12 03:59:21 mdb Exp $ package com.samskivert.viztool; @@ -9,9 +9,12 @@ import javax.swing.*; import com.samskivert.viztool.viz.HierarchyVisualizer; -public class TestPanel extends JPanel +/** + * A very simple UI element for displaying visualizations on screen. + */ +public class VizPanel extends JPanel { - public TestPanel (HierarchyVisualizer viz) + public VizPanel (HierarchyVisualizer viz) { _viz = viz; diff --git a/projects/viztool/src/java/com/samskivert/viztool/enum/package.html b/projects/viztool/src/java/com/samskivert/viztool/enum/package.html new file mode 100644 index 00000000..9355e663 --- /dev/null +++ b/projects/viztool/src/java/com/samskivert/viztool/enum/package.html @@ -0,0 +1,45 @@ + + + + + + + + Provides the ability to enumerate over all classes in the classpath + and filter those enumerations. + +

The main interface for enumerating classes is the {@link + com.samskivert.viztool.enum.ClassEnumerator}. It scans through the + class path and attempts to match a component enumerator to each + component. The {@link + com.samskivert.viztool.enum.DirectoryEnumerator} is used for all + components that don't match one of the other (zip or jar) + enumerators. These component enumerators are then used in turn to + enumerate through all of the classes in the class path. + +

The enumeration can be filtered by making use of a {@link + com.samskivert.viztool.enum.FilterEnumerator}. + + + diff --git a/projects/viztool/src/java/com/samskivert/viztool/hierarchy/ChainGroup.java b/projects/viztool/src/java/com/samskivert/viztool/hierarchy/ChainGroup.java index be0b3011..8672ba22 100644 --- a/projects/viztool/src/java/com/samskivert/viztool/hierarchy/ChainGroup.java +++ b/projects/viztool/src/java/com/samskivert/viztool/hierarchy/ChainGroup.java @@ -1,5 +1,5 @@ // -// $Id: ChainGroup.java,v 1.9 2001/07/24 20:30:53 mdb Exp $ +// $Id: ChainGroup.java,v 1.10 2001/08/12 03:59:21 mdb Exp $ package com.samskivert.viztool.viz; @@ -142,10 +142,10 @@ public class ChainGroup /** * Renders the chains in this group to the supplied graphics object. - * This function requires that layoutGroup has previously - * been called to lay out the group's chains. + * This function requires that layout has previously been + * called to lay out the group's chains. * - * @see #layoutGroup + * @see #layout */ public void render (Graphics2D gfx, double x, double y) { @@ -213,6 +213,10 @@ public class ChainGroup protected static final double BORDER = 72/8; + /** + * Compares the names of two chains. Used to sort them into + * alphabetical order. + */ protected static class NameComparator implements Comparator { public int compare (Object o1, Object o2) diff --git a/projects/viztool/src/java/com/samskivert/viztool/layout/PackedColumnElementLayout.java b/projects/viztool/src/java/com/samskivert/viztool/layout/PackedColumnElementLayout.java index 74fe1203..5bfde7dc 100644 --- a/projects/viztool/src/java/com/samskivert/viztool/layout/PackedColumnElementLayout.java +++ b/projects/viztool/src/java/com/samskivert/viztool/layout/PackedColumnElementLayout.java @@ -1,5 +1,5 @@ // -// $Id: PackedColumnElementLayout.java,v 1.5 2001/07/24 18:07:35 mdb Exp $ +// $Id: PackedColumnElementLayout.java,v 1.6 2001/08/12 03:59:21 mdb Exp $ package com.samskivert.viztool.viz; @@ -77,6 +77,11 @@ public class PackedColumnElementLayout implements ElementLayout return new Rectangle2D.Double(0, 0, maxwidth, y+rowheight); } + /** + * Compares the sizes of two elements. Used to sort them into order + * from highest to lowest. Secondarily sorts alphabetically on the + * element names. + */ protected static class HeightComparator implements Comparator { public int compare (Object o1, Object o2) diff --git a/projects/viztool/src/java/com/samskivert/viztool/layout/package.html b/projects/viztool/src/java/com/samskivert/viztool/layout/package.html new file mode 100644 index 00000000..1372f9fe --- /dev/null +++ b/projects/viztool/src/java/com/samskivert/viztool/layout/package.html @@ -0,0 +1,51 @@ + + + + + + + + The layout and rendering code that performs the actual visualization. + +

Presently, the only visuzliation is provided by the {@link + com.samskivert.viztool.viz.HierarchyVisualizer} and it is accessed + directly by the driver. This will likely eventually change and an + interface will be provided through which the driver accesses + visualizers (probably {@link com.samskivert.viztool.viz.Visualizer}) + and generates visualizations. + +

The hierarchy visualizer makes use of some lower level + visualization components that will likely come in handy in + generating other visualizations. These include the {@link + com.samskivert.viztool.viz.Element} and {@link + com.samskivert.viztool.viz.ElementLayout} interfaces. + +

The {@link com.samskivert.viztool.viz.ChainGroup} class should + probably evolve into something more general that lays out + collections of elements that are all part of a particular package + rather than explicitly working with {@link + com.samskivert.viztool.viz.Chain} instances. + + + diff --git a/projects/viztool/src/java/com/samskivert/viztool/overview.html b/projects/viztool/src/java/com/samskivert/viztool/overview.html new file mode 100644 index 00000000..bc76cadf --- /dev/null +++ b/projects/viztool/src/java/com/samskivert/viztool/overview.html @@ -0,0 +1,51 @@ + + + + + + + +

viztool is used to generate visualizations of collections of Java + classes. These visualizations are intended to be printed out and + taped to the wall or set on the desk beside you or folded into paper + airplanes and sailed around the room. Thus viztool does not include + a sophisticated user interface for viewing these presentations + onscreen (use ghostscript for that), although you can actually + display them on the screen because the rendering is done via the + Java 2D rendering engine. + +

viztool aims to provide an extensible framework for generating + visualizations of collections of classes. It currently generates + inheritance diagrams organized by package, with information on + interfaces implemented and (non-anonymous) inner classes as well. + +

It is a fairly small and simple collection of code, which is + hopefully understandable enough on its own to allow one to dive in + and create their own visualizations or enhance an existing + one. Comments and contributions are always welcome. + +

-- mdb@samskivert.com + + + diff --git a/projects/viztool/src/java/com/samskivert/viztool/package.html b/projects/viztool/src/java/com/samskivert/viztool/package.html new file mode 100644 index 00000000..6de45344 --- /dev/null +++ b/projects/viztool/src/java/com/samskivert/viztool/package.html @@ -0,0 +1,32 @@ + + + + + + + + Top-level stuff like the application driver and log wrapper. + + + diff --git a/projects/viztool/src/java/com/samskivert/viztool/util/Dumper.java b/projects/viztool/src/java/com/samskivert/viztool/util/Dumper.java index a3ef9b14..e64ba3d2 100644 --- a/projects/viztool/src/java/com/samskivert/viztool/util/Dumper.java +++ b/projects/viztool/src/java/com/samskivert/viztool/util/Dumper.java @@ -1,10 +1,13 @@ // -// $Id: Dumper.java,v 1.1 2001/07/14 00:51:13 mdb Exp $ +// $Id: Dumper.java,v 1.2 2001/08/12 03:59:21 mdb Exp $ package com.samskivert.viztool.util; import java.lang.reflect.*; +/** + * A simple utility that dumps out information available via reflection. + */ public class Dumper { public void dump (Class clazz) diff --git a/projects/viztool/src/java/com/samskivert/viztool/util/package.html b/projects/viztool/src/java/com/samskivert/viztool/util/package.html new file mode 100644 index 00000000..e6c6b9cb --- /dev/null +++ b/projects/viztool/src/java/com/samskivert/viztool/util/package.html @@ -0,0 +1,32 @@ + + + + + + + + Various and sundry utilities. + + +