Package aud.util

Class DotViewer

java.lang.Object
aud.util.DotViewer

public class DotViewer extends Object
Simple viewer for Graphvizable.

Based on Batik's SVGCanvas.

Usage:

  • Shift+Mouse Left = pan
  • Shift+Mouse Right (drag) = zoom in/out
  • Ctrl+Mouse Left = rectangle zoom
  • Ctrl+Mouse Right (drag) = rotate [disabled]
  • Ctrl+I = zoom in
  • Ctrl+O = zoom out
DotViewer can be used with SingleStepper to visualize progress of an algorithm. GraphDemo shows an example.
See Also:
  • Field Details

    • dotfile

      protected File dotfile
    • frame

      protected JFrame frame
    • svgCanvas

      protected org.apache.batik.swing.JSVGCanvas svgCanvas
    • graphviz

      protected Graphviz graphviz
    • label

      protected JLabel label
  • Constructor Details

    • DotViewer

      public DotViewer(JFrame parent)
      create new instance
  • Method Details

    • parent

      public JFrame parent()
      get parent widget
    • statusbar

      public JLabel statusbar()
      get status bar
    • createComponents

      protected JComponent createComponents()
    • help

      public static void help()
      print help (mouse/key bindings) to stdout
    • display

      public void display(String code)
      display dot code
      See Also:
    • display

      public void display(Graphvizable object)
      display object
    • displayWindow

      public static DotViewer displayWindow(Graphvizable object, String caption)
      create new DotViewer (toplevel window) and display object
    • displayWindow

      public static DotViewer displayWindow(String code, String caption)
      create new DotViewer (toplevel window) and display code
    • setExitOnClose

      public void setExitOnClose()
      exit application if viewer is closed
    • main

      public static void main(String[] args)
      visualize given dot files (file names as command line arguments)