Rearranged packages in preparation for the addition of a new type of

visualization.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@486 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2001-11-30 22:57:31 +00:00
parent 2ced5ba7c9
commit 0618cc9b8e
14 changed files with 68 additions and 40 deletions
@@ -1,5 +1,5 @@
//
// $Id: Driver.java,v 1.11 2001/08/14 00:41:53 mdb Exp $
// $Id: Driver.java,v 1.12 2001/11/30 22:57:31 mdb Exp $
//
// viztool - a tool for visualizing collections of java classes
// Copyright (C) 2001 Michael Bayne
@@ -25,7 +25,9 @@ import java.awt.print.*;
import com.samskivert.swing.util.SwingUtil;
import com.samskivert.viztool.enum.*;
import com.samskivert.viztool.viz.*;
import com.samskivert.viztool.hierarchy.HierarchyVisualizer;
import com.samskivert.viztool.util.FontPicker;
/**
* The application driver. This class parses the command line arguments
@@ -67,7 +69,7 @@ public class Driver
// and finally generate the visualization
PackageEnumerator penum = new PackageEnumerator(pkgroot, enum, true);
HierarchyVisualizer viz = new HierarchyVisualizer(pkgroot, penum);
Visualizer viz = new HierarchyVisualizer(pkgroot, penum);
if (print) {
// we use the print system to render things
@@ -1,5 +1,5 @@
//
// $Id: Visualizer.java,v 1.3 2001/08/12 04:36:58 mdb Exp $
// $Id: Visualizer.java,v 1.4 2001/11/30 22:57:31 mdb Exp $
//
// viztool - a tool for visualizing collections of java classes
// Copyright (C) 2001 Michael Bayne
@@ -18,13 +18,33 @@
// with this program; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.samskivert.viztool.viz;
package com.samskivert.viztool;
import java.awt.Graphics2D;
import java.awt.print.Printable;
/**
* Not yet in use. This will probably eventually become the interface via
* which the driver accesses whichever visualizer is desired for a
* particular invocation.
* The interface via which the driver accesses whichever visualizer is
* desired for a particular invocation.
*/
public interface Visualizer
public interface Visualizer extends Printable
{
/**
* Requests that the visualization lay itself out in pages with the
* specified dimensions. Subsequent calls to {@link #print} or {@link
* #paint} will assume that things are laid out according to the most
* recent call to this method.
*/
public void layout (Graphics2D gfx, double x, double y,
double width, double height);
/**
* Renders the specified page of this visualization.
*/
public void paint (Graphics2D gfx, int pageIndex);
/**
* Returns the number of pages occupied by the visualization.
*/
public int getPageCount ();
}
@@ -1,5 +1,5 @@
//
// $Id: VizFrame.java,v 1.5 2001/08/14 00:45:56 mdb Exp $
// $Id: VizFrame.java,v 1.6 2001/11/30 22:57:31 mdb Exp $
//
// viztool - a tool for visualizing collections of java classes
// Copyright (C) 2001 Michael Bayne
@@ -24,14 +24,13 @@ import java.awt.BorderLayout;
import javax.swing.*;
import com.samskivert.swing.*;
import com.samskivert.viztool.viz.HierarchyVisualizer;
/**
* The top-level frame in which visualizations are displayed.
*/
public class VizFrame extends JFrame
{
public VizFrame (HierarchyVisualizer viz)
public VizFrame (Visualizer viz)
{
super("viztool");
@@ -1,5 +1,5 @@
//
// $Id: VizPanel.java,v 1.6 2001/08/14 00:45:56 mdb Exp $
// $Id: VizPanel.java,v 1.7 2001/11/30 22:57:31 mdb Exp $
//
// viztool - a tool for visualizing collections of java classes
// Copyright (C) 2001 Michael Bayne
@@ -24,8 +24,6 @@ import java.awt.*;
import java.awt.geom.Rectangle2D;
import javax.swing.*;
import com.samskivert.viztool.viz.HierarchyVisualizer;
/**
* A very simple UI element for displaying visualizations on screen.
*/
@@ -34,9 +32,9 @@ public class VizPanel extends JPanel
/**
* Constructs a panel for displaying a particular visualization.
*/
public VizPanel (HierarchyVisualizer viz)
public VizPanel (Visualizer viz)
{
// we'll need these later
// we'll need this later
_viz = viz;
// set the font
@@ -98,12 +96,12 @@ public class VizPanel extends JPanel
/**
* Returns the visualizer we're currently displaying.
*/
public HierarchyVisualizer getVisualizer ()
public Visualizer getVisualizer ()
{
return _viz;
}
protected HierarchyVisualizer _viz;
protected Visualizer _viz;
protected int _currentPage = 0;
// our preferred size is one page at 72 pixels per inch
@@ -1,5 +1,5 @@
//
// $Id: CascadingChainVisualizer.java,v 1.9 2001/08/12 04:36:58 mdb Exp $
// $Id: CascadingChainVisualizer.java,v 1.10 2001/11/30 22:57:31 mdb Exp $
//
// viztool - a tool for visualizing collections of java classes
// Copyright (C) 2001 Michael Bayne
@@ -18,7 +18,7 @@
// with this program; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.samskivert.viztool.viz;
package com.samskivert.viztool.hierarchy;
import java.awt.Font;
import java.awt.Graphics2D;
@@ -27,6 +27,8 @@ import java.awt.font.FontRenderContext;
import java.awt.geom.*;
import java.util.ArrayList;
import com.samskivert.viztool.util.FontPicker;
/**
* The cascading chain visualizer lays out chains in the standard
* cascading format that looks something like this:
@@ -1,5 +1,5 @@
//
// $Id: Chain.java,v 1.9 2001/08/12 04:36:58 mdb Exp $
// $Id: Chain.java,v 1.10 2001/11/30 22:57:31 mdb Exp $
//
// viztool - a tool for visualizing collections of java classes
// Copyright (C) 2001 Michael Bayne
@@ -18,12 +18,14 @@
// with this program; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.samskivert.viztool.viz;
package com.samskivert.viztool.hierarchy;
import java.util.*;
import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D;
import com.samskivert.viztool.layout.Element;
/**
* A chain is used by the hierarchy visualizer to represent inheritance
* chains.
@@ -1,5 +1,5 @@
//
// $Id: ChainGroup.java,v 1.11 2001/08/12 04:36:58 mdb Exp $
// $Id: ChainGroup.java,v 1.12 2001/11/30 22:57:31 mdb Exp $
//
// viztool - a tool for visualizing collections of java classes
// Copyright (C) 2001 Michael Bayne
@@ -18,7 +18,7 @@
// with this program; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.samskivert.viztool.viz;
package com.samskivert.viztool.hierarchy;
import java.awt.*;
import java.awt.geom.GeneralPath;
@@ -26,6 +26,10 @@ import java.awt.geom.Rectangle2D;
import java.awt.font.TextLayout;
import java.util.*;
import com.samskivert.viztool.layout.ElementLayout;
import com.samskivert.viztool.layout.PackedColumnElementLayout;
import com.samskivert.viztool.util.FontPicker;
/**
* A chain group is used to group together all of the classes from a
* particular package.
@@ -1,5 +1,5 @@
//
// $Id: ChainUtil.java,v 1.6 2001/08/12 04:36:58 mdb Exp $
// $Id: ChainUtil.java,v 1.7 2001/11/30 22:57:31 mdb Exp $
//
// viztool - a tool for visualizing collections of java classes
// Copyright (C) 2001 Michael Bayne
@@ -18,7 +18,7 @@
// with this program; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.samskivert.viztool.viz;
package com.samskivert.viztool.hierarchy;
import java.io.PrintStream;
import java.util.ArrayList;
@@ -1,5 +1,5 @@
//
// $Id: ChainVisualizer.java,v 1.3 2001/08/12 04:36:58 mdb Exp $
// $Id: ChainVisualizer.java,v 1.4 2001/11/30 22:57:31 mdb Exp $
//
// viztool - a tool for visualizing collections of java classes
// Copyright (C) 2001 Michael Bayne
@@ -18,7 +18,7 @@
// with this program; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.samskivert.viztool.viz;
package com.samskivert.viztool.hierarchy;
import java.awt.Graphics2D;
@@ -1,5 +1,5 @@
//
// $Id: HierarchyVisualizer.java,v 1.14 2001/11/30 22:41:04 mdb Exp $
// $Id: HierarchyVisualizer.java,v 1.15 2001/11/30 22:57:31 mdb Exp $
//
// viztool - a tool for visualizing collections of java classes
// Copyright (C) 2001 Michael Bayne
@@ -18,7 +18,7 @@
// with this program; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.samskivert.viztool.viz;
package com.samskivert.viztool.hierarchy;
import java.awt.*;
import java.awt.geom.Rectangle2D;
@@ -26,6 +26,7 @@ import java.awt.print.*;
import java.util.*;
import com.samskivert.viztool.Log;
import com.samskivert.viztool.Visualizer;
import com.samskivert.viztool.enum.PackageEnumerator;
import com.samskivert.util.Comparators;
@@ -34,7 +35,7 @@ import com.samskivert.util.Comparators;
* representation so that an entire package can be displayed on a single
* page (or small number of pages).
*/
public class HierarchyVisualizer implements Printable
public class HierarchyVisualizer implements Visualizer
{
/**
* Constructs a hierarchy visualizer with the supplied enumerator as
@@ -1,5 +1,5 @@
//
// $Id: Element.java,v 1.3 2001/08/12 04:36:58 mdb Exp $
// $Id: Element.java,v 1.4 2001/11/30 22:57:31 mdb Exp $
//
// viztool - a tool for visualizing collections of java classes
// Copyright (C) 2001 Michael Bayne
@@ -18,7 +18,7 @@
// with this program; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.samskivert.viztool.viz;
package com.samskivert.viztool.layout;
import java.awt.geom.Rectangle2D;
@@ -1,5 +1,5 @@
//
// $Id: ElementLayout.java,v 1.4 2001/08/12 04:36:58 mdb Exp $
// $Id: ElementLayout.java,v 1.5 2001/11/30 22:57:31 mdb Exp $
//
// viztool - a tool for visualizing collections of java classes
// Copyright (C) 2001 Michael Bayne
@@ -18,7 +18,7 @@
// with this program; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.samskivert.viztool.viz;
package com.samskivert.viztool.layout;
import java.awt.geom.Rectangle2D;
import java.util.List;
@@ -1,5 +1,5 @@
//
// $Id: PackedColumnElementLayout.java,v 1.7 2001/08/12 04:36:58 mdb Exp $
// $Id: PackedColumnElementLayout.java,v 1.8 2001/11/30 22:57:31 mdb Exp $
//
// viztool - a tool for visualizing collections of java classes
// Copyright (C) 2001 Michael Bayne
@@ -18,7 +18,7 @@
// with this program; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.samskivert.viztool.viz;
package com.samskivert.viztool.layout;
import java.awt.geom.Rectangle2D;
import java.util.*;
@@ -1,5 +1,5 @@
//
// $Id: FontPicker.java,v 1.2 2001/08/12 04:36:58 mdb Exp $
// $Id: FontPicker.java,v 1.3 2001/11/30 22:57:31 mdb Exp $
//
// viztool - a tool for visualizing collections of java classes
// Copyright (C) 2001 Michael Bayne
@@ -18,7 +18,7 @@
// with this program; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.samskivert.viztool.viz;
package com.samskivert.viztool.util;
import java.awt.Font;