|
| 1 | +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
| 2 | +"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 3 | +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| 4 | +<head> |
| 5 | +<title>org.eclipse.swt.examples.controlexample.ControlExample</title> |
| 6 | + <script type="text/javascript"> |
| 7 | + var nd = new Date (); |
| 8 | + </script> |
| 9 | +<!-- |
| 10 | + <script type="text/javascript" src="../net.sf.j2s.lib/j2slib/j2slib.z.js"></script> |
| 11 | +--> |
| 12 | + |
| 13 | +<script type="text/javascript" src="../net.sf.j2s.java.core/j2score/Class.js"></script> |
| 14 | +<script type="text/javascript" src="../net.sf.j2s.java.core/j2score/ClassExt.js"></script> |
| 15 | +<script type="text/javascript" src="../net.sf.j2s.java.core/j2score/ClassLoader.js"></script> |
| 16 | +<script type="text/javascript" src="../net.sf.j2s.java.core/j2score/Console.js"></script> |
| 17 | + |
| 18 | + <script type="text/javascript"> |
| 19 | + error (new Date ().getTime () - nd.getTime ());; |
| 20 | + </script> |
| 21 | +</head> |
| 22 | +<body> |
| 23 | +<script type="text/javascript"> |
| 24 | + var xx = null; |
| 25 | + var xxCount = 0; |
| 26 | + ClazzLoader.scriptLoading = function (file) { |
| 27 | + //log ("loading " + file + " ..."); |
| 28 | + xx = new Date (); |
| 29 | + }; |
| 30 | + |
| 31 | + ClazzLoader.scriptLoaded = function (file) { |
| 32 | + //alert (file + " loaded."); |
| 33 | + if (xx != null) |
| 34 | + xxCount += new Date ().getTime () - xx.getTime (); |
| 35 | + }; |
| 36 | + |
| 37 | + ClazzLoader.scriptInited = function (file) { |
| 38 | + // alert (file + " inited."); |
| 39 | + }; |
| 40 | +// ClazzLoader.setLoadingMode ("async.xhr"); |
| 41 | + |
| 42 | + //ClazzLoader.runtimeClasspath ("../net.sf.j2s.java.core/bin"); |
| 43 | + ClazzLoader.runtimeClasspath ("../net.sf.j2s.lib/j2slib"); |
| 44 | + ClazzLoader.swtClasspath ("../net.sf.j2s.java.org.eclipse.swt/bin"); |
| 45 | + //ClazzLoader.swtClasspath ("../../plugins/net.sf.j2s.lib_1.0.0/j2slib/"); |
| 46 | + ClazzLoader.ajaxClasspath ("../../plugins/net.sf.j2s.lib_1.0.0/j2slib/"); |
| 47 | + |
| 48 | + // ClazzLoader.packageClasspath ("org.eclipse.swt.examples.*", "../org.eclipse.swt.examples/bin"); |
| 49 | + |
| 50 | + Console.enableBuffering (true); |
| 51 | + Console.enablePinning (true); |
| 52 | + //Console.setMaxTotalLines (1500); |
| 53 | + |
| 54 | + ClazzLoader.setPrimaryFolder ("../org.eclipse.swt.examples/bin"); |
| 55 | + |
| 56 | + ClazzLoader.ignore ("$wt.SWT", "$.SWTError", "$.SWTException", "$wt.widgets.Dialog", "$.FontDialog", "$.ColorDialog", "$.PrintDialog", "$.Combo", "$.Table", "$.TableItem", "$.TableColumn", "$.Tray", "$.TrayItem", "$.Menu", "$.MenuItem", "$.ImageList", "$wt.graphics.GC", "$wt.accessibility.AccessibleAdapter", "$.AccessibleListener", "$.AccessibleControlAdapter", "$.AccessibleControlListener", |
| 57 | + /*"$wt.events.TreeEvent", "$.TraverseEvent", "$.VerifyEvent", "$.MouseEvent", "$.ModifyEvent", "$.KeyListener", "$.KeyEvent", "$.KeyAdapter", "$.HelpListener", "$.HelpEvent", "$.MenuEvent", "$.PaintEvent", "$.PaintListener", "$.FocusEvent", "$.ArmEvent",*/ "$wt.graphics.FontData", "$.Font", "$.Cursor", "$.ImageData"); |
| 58 | + |
| 59 | + ClazzLoader.ignore ("java.util.MissingResourceException", "java.lang.RuntimeException", "$.Exception", "$.Throwable", "$.StackTraceElement", "java.util.Enumeration", /*"java.lang.StringBuffer", */"java.lang.Encoding"); |
| 60 | + |
| 61 | + |
| 62 | + var xxx = new Date (); |
| 63 | + |
| 64 | +//if (false) |
| 65 | +{ |
| 66 | + var msg = document.createElement ("DIV"); |
| 67 | + msg.style.cssText = "position:absolute;top:0;width:100%;font-size:9pt;font-family:Arial, sans-serif;white-space:nowrap;overflow:visible;text-align:center;padding:0.25em 1em;font-weight:bold;color:yellow;background-color:darkred;"; |
| 68 | + document.body.appendChild (msg); |
| 69 | + msg.appendChild (document.createTextNode ("... Loading ....")); |
| 70 | + |
| 71 | + ClazzLoader.setLoadingMode (null, 1); |
| 72 | + |
| 73 | + var fileCount = 0; |
| 74 | + ClazzLoader.scriptLoaded = function (file, flush) { |
| 75 | + //fileCount++; |
| 76 | + //if (fileCount % 5 != 0 && flush != true) { |
| 77 | + // return ; |
| 78 | + //} |
| 79 | + for (var i = msg.childNodes.length - 1; i >= 0; i--) { |
| 80 | + msg.removeChild (msg.childNodes[i]); |
| 81 | + } |
| 82 | + //alert (file + " loaded."); |
| 83 | + msg.appendChild (document.createTextNode ("... " + file + " ...")); |
| 84 | + }; |
| 85 | + ClazzLoader.scriptInited = function (file) { |
| 86 | + //alert ("class in :" + file); |
| 87 | + }; |
| 88 | + ClazzLoader.loadClass ("org.eclipse.swt.examples.controlexample.ControlExample", function () { |
| 89 | + System.out.println ("Loading time:" + (new Date ().getTime () - xxx.getTime ())); |
| 90 | + ClazzLoader.scriptLoaded ("Initializing", true); |
| 91 | + |
| 92 | + window.setTimeout (function () { |
| 93 | + /* |
| 94 | + var el = document.createElement ("DIV"); |
| 95 | + el.style.cssText = "overflow:hidden;position:absolute;left:100px;top:20px;width:640px;height:560px;border:1px solid red;background-color:darkred;"; |
| 96 | + document.body.appendChild (el); |
| 97 | + var container = document.createElement ("DIV"); |
| 98 | + container.style.cssText = "position:absolute;"; |
| 99 | + el.appendChild (container); |
| 100 | + window.extraDisplay = function (display) { |
| 101 | + var monitor = display.getPrimaryMonitor (); |
| 102 | + monitor.handle = container; |
| 103 | + monitor.clientWith = 640; |
| 104 | + monitor.clientHeight = 560; |
| 105 | + monitor.width = 648; |
| 106 | + monitor.height = 572; |
| 107 | + }; |
| 108 | + */ |
| 109 | + org.eclipse.swt.examples.controlexample.ControlExample.main([]); |
| 110 | + System.out.println ("Loading time:" + (new Date ().getTime () - xxx.getTime ())); |
| 111 | + System.err.println ("Finished by " + xxCount); |
| 112 | + |
| 113 | + ClazzLoader.scriptLoaded ("Layouting", true); |
| 114 | + window.setTimeout (function () { |
| 115 | + document.body.removeChild (msg); |
| 116 | + }, 500); |
| 117 | + }, 10); |
| 118 | + }); |
| 119 | +} |
| 120 | +</script> |
| 121 | +</body> |
| 122 | +</html> |
0 commit comments