Class GraphEditorDemo

All Implemented Interfaces:
ImageObserver, MenuContainer, Printable, Serializable, Accessible, RootPaneContainer

public class GraphEditorDemo extends JApplet implements Printable
Shows how to create a graph editor with JUNG. Mouse modes and actions are explained in the help text. The application version of GraphEditorDemo provides a File menu with an option to save the visible graph as a jpeg file.
See Also:
  • Field Details

  • Constructor Details

    • GraphEditorDemo

      public GraphEditorDemo()
      create an instance of a simple graph with popup controls to create a graph.
  • Method Details

    • writeJPEGImage

      public void writeJPEGImage(File file)
      copy the visible part of the graph to a file as a jpeg image
      Parameters:
      file - the file in which to save the graph image
    • print

      public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) throws PrinterException
      Specified by:
      print in interface Printable
      Throws:
      PrinterException
    • main

      public static void main(String[] args)