01: /*
02: * @(#)init.java 1.3 05/01/14
03: *
04: * Copyright (c) 2001-2004 Sun Microsystems, Inc. All Rights Reserved.
05: *
06: * See the file "LICENSE.txt" for information on usage and redistribution
07: * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
08: */
09: package pnuts.awt;
10:
11: import pnuts.lang.Runtime;
12: import pnuts.lang.Package;
13: import pnuts.lang.Context;
14: import pnuts.ext.ModuleBase;
15:
16: /**
17: * Initialization of the pnuts.awt module
18: */
19: public class init extends ModuleBase {
20:
21: static String[] javaFunctions = { "useEventThread" };
22:
23: static String[] files = { "pnuts/awt/lout", "pnuts/awt/key",
24: "pnuts/awt/frame", "pnuts/awt/toolkit", "pnuts/awt/menu",
25: "pnuts/awt/image", "pnuts/awt/clipboard" };
26:
27: static String[][] functions = {
28: { "layout", },
29: { "defineKey", "getKeyStroke" },
30: { "frame", "dialog", "centerPosition",
31: "getWindowCloseOperation",
32: "setWindowCloseOperation" },
33: { "getToolkit" },
34: { "menubar", "menu", "getMenuItem" },
35: { "makeImage", "readImage", "writeImage", "resizeImage",
36: "showImage", "filterImage", "cropImage",
37: "shearImage", "rotateImage", "flipImage",
38: "scaleImage", "grayImage" },
39: { "getClipboard", "setClipboard" } };
40:
41: static String[] requiredModules = { "pnuts.lib", "pnuts.io",
42: "pnuts.beans" };
43:
44: protected String[] getRequiredModules() {
45: return requiredModules;
46: }
47:
48: public Object execute(Context context) {
49: for (int i = 0; i < files.length; i++) {
50: autoload(functions[i], files[i], context);
51: }
52: for (int i = 0; i < javaFunctions.length; i++) {
53: autoloadFunction(javaFunctions[i], context);
54: }
55: return null;
56: }
57: }
|