Package workbench.ui

Source Code of workbench.ui.DiagramPanel

package workbench.ui;

import java.io.PrintWriter;
import java.io.Reader;

import javax.swing.JScrollPane;

import att.grappa.Graph;
import att.grappa.GrappaPanel;
import att.grappa.Parser;

public class DiagramPanel extends JScrollPane {
  private static final long serialVersionUID = 1L;
  private Graph diagram = new Graph("Graph");

  public DiagramPanel(){
    GrappaPanel grappa = new GrappaPanel(diagram);
    setName("Diagram");
    setViewportView(grappa);
  }
 
  public void drawGraph(Reader reader){   
      try {
        Parser program = new Parser(reader, new PrintWriter(System.err), diagram);
        program.parse();
//        diagram.printGraph(new PrintWriter(System.err));
        diagram.repaint()
      } catch(Exception ex) {
        System.err.println("Exception: " + ex.getMessage());
      }
  }
}
TOP

Related Classes of workbench.ui.DiagramPanel

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.