summaryrefslogtreecommitdiffstats
path: root/tdejava/koala/examples/kscribble/Main.java
blob: bd6ee697e115f586fc457c1ef8ffe84190a00672 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/***************************************************************************
                          KScribble.java  -  KScribble using java bindings
                             -------------------
    begin                : Mon Jan 31 11:05:05 CET 2000
    copyright            : (C) 2000 by Ralf Nolden
    email                : Ralf.Nolden@post.rwth-aachen.de
    java translation     : Kenneth J. Pouncey
    email                : kjpou@hotmail.com
 ***************************************************************************/


import java.util.*;
import org.trinitydesktop.qt.*;
import org.trinitydesktop.koala.*;

/**
  * The base class for JavaApiTest application windows. It sets up the main
  * window and reads the config file as well as providing a menubar, toolbar
  * and statusbar. An instance of KBaseView creates your center view, which is connected
  * to the window's Doc object.
  * KBase reimplements the methods that TDEMainWindow provides for main window handling and supports
  * full session management as well as using TDEActions.
  * @see TDEMainWindow
  * @see TDEApplication
  * @see TDEConfig
  *
  * @author Source Framework Automatically Generated by KDevelop, (c) The KDevelop Team.
  * @version KDevelop version 1.2 code generation
  */
public class Main {

	static String description = "java KDE 3 example application";


   static String[][] options = {
      { "+[File]", "image file to open", null }
   };

static String VERSION = "0.1";

   public static void main(String[] cmdLineArgs) {

      TDEAboutData aboutData = new TDEAboutData( "kscribble", "KScribble",
         VERSION, description, TDEAboutData.License_GPL,
         "(C) 2000 by Ralf Nolden");
      TDECmdLineArgs.init( cmdLineArgs, aboutData );
      TDECmdLineArgs.addCmdLineOptions( options ); // Add our own options.

      TDEApplication app = new TDEApplication();
      KImageIO.registerFormats();
      KScribbleApp kscribbleapp = new KScribbleApp();

      if (app.isRestored()) {
         kscribbleapp.RESTORE("kscribbleapp");
      }
      else {
       kscribbleapp.show();
       TDECmdLineArgs args = TDECmdLineArgs.parsedArgs();

         if (args.count() > 0) {
           kscribbleapp.openDocumentFile(new KURL(args.arg(0)));
         }
         else {
           kscribbleapp.openDocumentFile();
         }
         args.clear();
      }

      app.exec();
      return;
   }

	static {
		qtjava.initialize();
		tdejava.initialize();
	}

}