View Javadoc

1   /*
2    * ToolMain.java
3    *
4    * Created on 28. mars 2005, 19:54
5    */
6   
7   /***
8    *
9    * @author  studajb
10   */
11  package com.vikash.firsttool;
12  
13  import java.awt.*;
14  import java.awt.event.*;
15  import java.awt.geom.*;
16  
17  import java.net.URL;
18  
19  
20  import javax.swing.*;
21  import javax.swing.tree.*;
22  
23  import org.jgraph.graph.*;
24  import com.vikash.firsttool.UI.MainFrame;
25  public class ToolMain {
26      
27      
28     static MainFrame frame;
29      /*** Creates a new instance of ToolMain */
30      public static void main(String[] args) {
31          //create a new project
32          newProject(false); //open a new project 
33          
34          
35          
36      }
37      public static void newProject(boolean isOldProject){
38          if(!isOldProject){ // if there is no opened project create a new one
39              frame=new MainFrame();
40              frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
41              frame.show();
42          }
43          else{
44              //if the project has no elements and diagrams do nothing
45              if(frame.saveBeforeExit()){
46                  frame.refreshComponents();  
47              
48              }
49          }
50          
51      }
52      
53  }
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64