Numerous cleanups in preparation for public release.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@247 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2001-08-12 03:59:21 +00:00
parent 5ea831c2fd
commit 4ddd0fbf02
14 changed files with 334 additions and 39 deletions
+41
View File
@@ -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 <<EOF
build-dist.sh
CVS
dist
lib/*.jar
code
.excludes
EOF
# create our distribution directory
mkdir /tmp/$TARGET
# temporarily move the distribution files into temp so that we can put
# them into a properly named directory
tar --exclude-from=.excludes -cf - * | tar -C /tmp/$TARGET -xf -
# now build the actual archive file
tar -C /tmp -czf $DISTDIR/$TARGET.tgz $TARGET
# and clean up after ourselves
rm -rf /tmp/$TARGET
rm .excludes
+37 -21
View File
@@ -1,45 +1,61 @@
<!-- build configuration -->
<project name="viztool" default="compile" basedir=".">
<!-- configuration parameters -->
<property name="app.name" value="viztool"/>
<property name="deploy.home" value="dist"/>
<property name="dist.home" value="${deploy.home}"/>
<property name="dist.jar" value="${app.name}.jar"/>
<property name="javadoc.home" value="${deploy.home}/docs"/>
<!-- things you may want to change -->
<property name="build.compiler" value="jikes"/>
<property name="java.libraries" value="/usr/share/java"/>
<!-- things you probably don't want to change -->
<property name="app.name" value="viztool"/>
<property name="deploy.dir" value="dist"/>
<property name="dist.jar" value="${app.name}.jar"/>
<property name="javadoc.dir" value="${deploy.dir}/docs"/>
<property name="doc.packages" value="com.samskivert.*"/>
<property name="copyright.holder" value="Michael Bayne"/>
<!-- declare our classpath -->
<path id="classpath">
<fileset dir="${java.libraries}" includes="**/*.jar"/>
<fileset dir="lib" includes="**/*.jar"/>
<pathelement location="${deploy.dir}/classes"/>
</path>
<!-- prepares the application directories -->
<target name="prepare">
<mkdir dir="${deploy.home}"/>
<mkdir dir="${deploy.home}/classes"/>
<mkdir dir="${javadoc.home}"/>
<mkdir dir="${deploy.dir}"/>
<mkdir dir="${deploy.dir}/classes"/>
<mkdir dir="${javadoc.dir}"/>
<copy todir="${deploy.dir}/classes">
<fileset dir="src/java" includes="**/*.properties"/>
</copy>
</target>
<!-- cleans out the installed application -->
<target name="clean">
<delete dir="${deploy.home}"/>
<delete dir="${deploy.dir}"/>
</target>
<!-- build the java class files -->
<target name="compile" depends="prepare">
<javac srcdir="src/java" destdir="${deploy.home}/classes"
<javac srcdir="src/java" destdir="${deploy.dir}/classes"
debug="on" optimize="off" deprecation="off">
<classpath>
<fileset dir="${java.libraries}" includes="**/*.jar"/>
<fileset dir="lib" includes="**/*.jar"/>
<pathelement location="${deploy.home}/classes"/>
</classpath>
<classpath refid="classpath"/>
</javac>
</target>
<!-- build the javadoc documentation -->
<target name="javadoc" depends="prepare">
<javadoc sourcepath="src/java"
packagenames="com.samskivert.*"
classpath="${deploy.home}/classes"
destdir="${javadoc.home}"/>
packagenames="${doc.packages}"
windowtitle="${app.name} API"
doctitle="${app.name} API"
overview="src/java/com/samskivert/viztool/overview.html"
bottom="Copyright &#169; 2001 ${copyright.holder}. All Rights Reserved."
destdir="${javadoc.dir}">
<classpath refid="classpath"/>
<link href="http://java.sun.com/products/jdk/1.3/docs/api"/>
<link href="http://www.waywardgeeks.org/code/samskivert/javadoc"/>
</javadoc>
</target>
<!-- the default target is to rebuild everything -->
@@ -47,8 +63,8 @@
<!-- builds our distribution files (war and jar) -->
<target name="dist" depends="prepare,compile">
<jar jarfile="${dist.home}/${dist.jar}"
basedir="${deploy.home}/classes"/>
<jar jarfile="${deploy.dir}/${dist.jar}"
basedir="${deploy.dir}/classes"/>
</target>
</project>
@@ -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();
@@ -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
{
}
@@ -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);
}
}
@@ -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;
@@ -0,0 +1,45 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!--
$Id: package.html,v 1.1 2001/08/12 03:59:21 mdb Exp $
viztool - a tool for visualizing collections of java classes
Copyright (C) 2001 Michael Bayne
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
</head>
<body bgcolor="white">
Provides the ability to enumerate over all classes in the classpath
and filter those enumerations.
<p> 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.
<p> The enumeration can be filtered by making use of a {@link
com.samskivert.viztool.enum.FilterEnumerator}.
</body>
</html>
@@ -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 <code>layoutGroup</code> has previously
* been called to lay out the group's chains.
* This function requires that <code>layout</code> 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)
@@ -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)
@@ -0,0 +1,51 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!--
$Id: package.html,v 1.1 2001/08/12 03:59:21 mdb Exp $
viztool - a tool for visualizing collections of java classes
Copyright (C) 2001 Michael Bayne
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
</head>
<body bgcolor="white">
The layout and rendering code that performs the actual visualization.
<p> 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.
<p> 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.
<p> 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.
</body>
</html>
@@ -0,0 +1,51 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!--
$Id: overview.html,v 1.1 2001/08/12 03:59:21 mdb Exp $
viztool - a tool for visualizing collections of java classes
Copyright (C) 2001 Michael Bayne
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
</head>
<body bgcolor="white">
<p> 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.
<p> 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.
<p> 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.
<p> -- <a href="mailto:mdb@samskivert.com">mdb@samskivert.com</a>
</body>
</html>
@@ -0,0 +1,32 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!--
$Id: package.html,v 1.1 2001/08/12 03:59:21 mdb Exp $
viztool - a tool for visualizing collections of java classes
Copyright (C) 2001 Michael Bayne
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
</head>
<body bgcolor="white">
Top-level stuff like the application driver and log wrapper.
</body>
</html>
@@ -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)
@@ -0,0 +1,32 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!--
$Id: package.html,v 1.1 2001/08/12 03:59:21 mdb Exp $
viztool - a tool for visualizing collections of java classes
Copyright (C) 2001 Michael Bayne
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
</head>
<body bgcolor="white">
Various and sundry utilities.
</body>
</html>