zeta
1. Àо±â ¶ÀÌ ÆäÀÌÁöÀÇ ³»¿ëÀº Zeta ÆÐÅ°Áö¿¡ Æ÷ÇÔµÈ docs/README ¹®¼ÀÇ ³»¿ë°ú °°½À´Ï´Ù.
´ë°³ À§Å° ÆäÀÌÁöÀÇ ³»¿ëÀÌ ´õ ÃÖ½ÅÀ̸ç, ´õ dzºÎÇÕ´Ï´Ù.
1.1. °³¿ä ¶Zeta´Â ÀÛÀº ¹Ì´Ï ÀÀ¿ëÇÁ·Î±×·¥À» ¸¸µé°í ±¸µ¿½Ãų ¼ö ÀÖ´Â ÅøÀÔ´Ï´Ù. Àͼ÷ÇÑ ÀÚ¹Ù
¾ð¾î¿Í SWT·Î ¼Õ½±°Ô ÇÁ·Î±×·¥À» ¸¸µé ¼ö ÀÖÀ¸¸ç, XML¸¸À» »ç¿ëÇÒ ¼öµµ ÀÖ½À´Ï´Ù.
Á¦ÀÛ ¹æ¹ýÀº ȨÆäÀÌÁö¿Í demo µð·ºÅ͸®ÀÇ ¿¹Á¦µéÀ» Âü°íÇϼ¼¿ä. Zeta Pure´Â JDK¿Í
SWT°¡ Áö¿øµÇ´Â ¸ðµç Ç÷§Æû¿¡¼ »ç¿ë °¡´ÉÇϸç, À©µµ¿ì¿ëÀ¸·Î´Â GCJ·Î ÄÄÆÄÀϵÈ
¹ÙÀ̳ʸ®¸¦ ¹èÆ÷ÇÕ´Ï´Ù.
ÇöÀç ÀÌ ÇÁ·ÎÁ§Æ®´Â GCJ, SWT, BeanShell, CookXMLÀ» ÀÌ¿ëÇϸç, ÃßÈÄ Groovy, Jython,
JavascriptµîÀ» ±âº» Áö¿øÇÒ ¿¹Á¤ÀÔ´Ï´Ù.
1.4. °³¹ß ȯ°æ ¶Zeta 0.1 - 0.2 :
1.6. ´Þ¶óÁø Á¡ ¶0.1 : ÃÖÃÊ °ø°³ ¹öÀü.
0.2 :
2. Zeta¿ë ÇÁ·Î±×·¥ Á¦ÀÛ ¶ÇöÀç bsh¿Í cookswt¸¦ »ç¿ëÇÑ xml·Î ¸¸µé ¼ö ÀÖ½À´Ï´Ù.
»ç¿ë¹ýÀº Æ®·¹ÀÌÀÇ zeta ¾ÆÀÌÄÜÀÇ ¸Þ´º¸¦ ¿¾î Load¸¦ ¼±ÅÃÇÑ µÚ ÆÄÀÏÀ» ¼±ÅÃÇÏ¸é µË´Ï´Ù.
ÄܼÖÀ» ¿¸é ÇÁ·ÒÇÁÆ®¿¡¼ ºó¼Ð ½ºÅ©¸³Æà ¹× ¿¹¿Ü ¹ß»ý µî¿¡ ´ëÇÑ ±â·ÏÀ» º¼ ¼ö ÀÖÀ¸¸ç,
¿©·¯ ¼ÐÀ» ¶ç¿î »óÅ¿¡¼ zeta ¾ÆÀÌÄÜÀ» Ŭ¸¯ÇÏ´Â °ÍÀ¸·Î
consoleÀ» Á¦¿ÜÇÑ ¸ðµç ¼ÐÀ» º¸ÀÌ°Ô Çϰųª °¨Ãâ ¼ö ÀÖ½À´Ï´Ù.
2.1.1. demo/HelloWorld1.bsh ¶zeta´Â bsh ÆÄÀÏÀ» ÀоîµéÀÏ ¼ö ÀÖ½À´Ï´Ù.
´ÙÀ½Àº SWT·Î °£´ÜÇÑ Ã¢À» Ãâ·ÂÇÏ´Â bsh ½ºÅ©¸³Æ®ÀÔ´Ï´Ù.
class Hello{
public Hello(){ Display d = Display.getCurrent(); Shell s = new Shell(d, SWT.SHELL_TRIM | SWT.TOOL); Label l = new Label(s, SWT.CENTER); s.setLayout(new FillLayout()); String str = "Hello, Zeta!"; l.setText(str); s.setText(str); s.pack(); s.open(); } } new Hello(); 2.1.2. demo/HelloWorld4.xml ¶zeta´Â xml ÆÄÀÏÀ» cookswt¸¦ ÀÌ¿ëÇØ ÆĽÌÇÕ´Ï´Ù.
´ÙÀ½°ú °°ÀÌ ½ºÅ©¸³Æ®¸¦ xml¿¡ ³»ÀåÇÒ ¼ö ÀÖ½À´Ï´Ù.
<!-- original source by http://cookxml.sourceforge.net/cookbsh/ -->
<shell style="SHELL_TRIM | TOOL" text="Hello World!" size="320,240"> <filllayout type="VERTICAL"> <clabel id="label" style="BORDER | CENTER" text="Hello, Zeta! 4"/> <button text="Click!"> <bsh func="addSelectionListener"> import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.events.SelectionEvent; widgetSelected( e ) { label.setText(e.source.getText () + " Pressed"); } widgetDefaultSelected( e ) { } return (SelectionListener)this; </bsh> </button> <!-- calling an external BSH code (identical to the bsh code above) --> <!--button text="Button 2"> <bsh func="addActionListener" src="examples/cookbsh/action.bsh"/> </button--> </filllayout> </shell> 2.1.3. PropertyCat.xml ¶ÀÚ¹ÙÀÇ ÇÁ·ÎÆÛƼµéÀ» Ãâ·ÂÇÏ´Â °£´ÜÇÑ ¿¹Á¦.
<shell style="SHELL_TRIM | TOOL" text="PropertyCat" size="320,240">
<filllayout type="VERTICAL"> <textarea style="BORDER | MULTI | V_SCROLL | H_SCROLL"> <bsh setas="text"> String getProperty(){ java.util.Properties p = System.getProperties(); java.util.Enumeration e = System.getProperties().propertyNames(); StringBuilder sb = new StringBuilder(); while(e.hasMoreElements()){ String str = e.nextElement().toString(); sb.append(str); sb.append(" : "); sb.append(p.getProperty(str)); sb.append("\n"); } return sb.toString(); } return getProperty(); </bsh> </textarea> </filllayout> </shell> 2.1.4. GlobalHook.bsh ¶SWT ³»ºÎ Ŭ·¡½º¸¦ ÀÌ¿ëÇÑ À©µµ¿ì ¸Þ½ÃÁö ÈÅ ¿¹Á¦ÀÔ´Ï´Ù.
W2K À̻󿡼 µ¿ÀÛÇϸç, ½ÇÇàÇϸé À©µµ»ó¿¡¼ÀÇ ¸ðµç Å°º¸µå ÀÔ·ÂÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.
import org.eclipse.swt.internal.Callback;
import org.eclipse.swt.internal.win32.OS; import org.eclipse.swt.internal.win32.MSG; class GlobalHook { static Shell s = new Shell(Display.getCurrent()); static Text t = new Text(s, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); static int hHook = 0; Shell show(){ s.setText("GlobalHook"); s.setLayout(new FillLayout()); s.setSize(500, 500); startHook(); return s; } static int getMsgProc(int code, int wParam, int lParam) { MSG msg = new MSG(); OS.MoveMemory(msg, lParam, MSG.sizeof); t.append(msg.message + "\n"); return OS.CallNextHookEx(hHook, code, wParam, lParam); } void startHook(){ Callback callback = new Callback(GlobalHook.class, "getMsgProc", 3); int address = callback.getAddress(); int threadId = OS.GetCurrentThreadId(); hHook = OS.SetWindowsHookEx(13, address, OS.GetLibraryHandle(), 0); if (hHook == 0) { callback.dispose(); return; } } } new GlobalHook().show(); 2.1.5. KLDP_Reader.bsh ¶informa¸¦ »ç¿ëÇÑ °£´ÜÇÑ RssReader ¿¹Á¦.
JRE»ó¿¡¼ ±¸µ¿µÇ´Â Zeta/Pure¿¡¼´Â ´ÙÀ½°ú °°ÀÌ ¿ÜºÎ ÆÐÅ°Áö¸¦ ºÒ·¯¿Ã ¼ö ÀÖ½À´Ï´Ù.
addClassPath("demo/informa_0.6.5.jar");
addClassPath("demo/commons-logging.jar"); addClassPath("demo/jdom.jar"); import de.nava.informa.core.ChannelIF; import de.nava.informa.core.ItemIF; import de.nava.informa.impl.basic.ChannelBuilder; import de.nava.informa.parsers.FeedParser; Shell s = new Shell(Display.getCurrent(), SWT.SHELL_TRIM | SWT.TOOL); s.setText("KLDP Reader"); s.setLayout(new FillLayout(SWT.VERTICAL)); ChannelIF channel = FeedParser.parse( new ChannelBuilder(), new URL("http://kldp.org/node/feed")); Iterator i = channel.getItems().iterator(); Button btn; while(i.hasNext()){ ItemIF item = (ItemIF)i.next(); btn = new Button(s, SWT.PUSH); btn.setText(item.getTitle()); btn.addListener(SWT.Selection, new Listener(){ URL url = item.getLink(); public void handleEvent(Event event) { Program.launch(url.toString()); } }); } s.pack(); s.open(); 3. ½ºÅ©¸°¼¦ ¶
[PNG image (146.2 KB)]
[PNG image (67.41 KB)] |
You are farsighted, a good planner, an ardent lover, and a faithful friend. |