/** * This is a very simple application based on a diagram component, * * This application displays a diagram component in a frame. * A simple data file is loaded and displayed using a * basic style sheet. A predefined toolbar is also used. */ public class BasicDiagrammerApplication extends JFrame { // Create the main frame. // public BasicDiagrammerApplication() { // Set up the frame. // super("Basic Diagrammer Application"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setLocation(100, 100); setSize(400, 300); // Create the IlvDiagrammer instance. // IlvDiagrammer diagrammer = new IlvDiagrammer(); // Allow selection. // diagrammer.setSelectMode(true); // Add the IlvDiagrammer instance. // getContentPane().setLayout(new BorderLayout()); getContentPane().add(diagrammer, BorderLayout.CENTER); // Add a predefined toolbar for controlling the view // north of the frame. // getContentPane().add(new IlvDiagrammerViewBar(), BorderLayout.NORTH); try { // Load a project file. // diagrammer.setDataFile(new URL("file:data/basic.idpr")); } catch (Exception e) { e.printStackTrace(); } } /** * The main method of the application. */ public static void main(String[] args) { // Create an instance of the application, and // show it. // new BasicDiagrammerApplication().setVisible(true); } }