PageRenderTime 23ms CodeModel.GetById 10ms app.highlight 10ms RepoModel.GetById 1ms app.codeStats 0ms

/webccr/src/com/emis/caesarui/webccr/ImagePopWindow.java

https://bitbucket.org/sanliou/synccr
Java | 75 lines | 64 code | 10 blank | 1 comment | 0 complexity | c441ef74e3d071b45e0c693533635b8f MD5 | raw file
 1package com.emis.caesarui.webccr;
 2
 3
 4import com.emis.caesar.emisComponents;
 5import com.emis.db.emisConnection;
 6import com.emis.db.emisDb;
 7import com.emis.db.emisDbRun;
 8import com.emis.util.emisUtil;
 9import com.vaadin.event.Action;
10import com.vaadin.event.ShortcutAction;
11import com.vaadin.ui.Button;
12import com.vaadin.ui.Component;
13import com.vaadin.ui.Image;
14import com.vaadin.ui.Label;
15import com.vaadin.ui.TextField;
16import com.vaadin.ui.VerticalLayout;
17import com.vaadin.ui.Window;
18
19public class ImagePopWindow extends Window {
20
21	Image m_Image; 
22	public ImagePopWindow() {
23		super();
24		m_Image = new Image();
25		emisUtil.setImageSrc(m_Image, "/images/WeChat_Join.JPG");
26		
27		this.addActionHandler(new Action.Handler() {
28			// 這邊 Caption 要和我們系統的 Function ID 定義一樣,才會 mapping
29            Action ENTER = new ShortcutAction("ENTER",ShortcutAction.KeyCode.ENTER, null);
30            Action BackSpace= new ShortcutAction("BACK",ShortcutAction.KeyCode.BACKSPACE, null);
31	        Action ESC = new ShortcutAction("ESC",ShortcutAction.KeyCode.ESCAPE,null);
32	        Action DEL = new ShortcutAction("DEL",ShortcutAction.KeyCode.DELETE,null);
33	        Action SPACE = new ShortcutAction("SPACE",ShortcutAction.KeyCode.SPACEBAR,null);
34
35            Action Num0 = new ShortcutAction("0",ShortcutAction.KeyCode.NUM0, null);
36            Action Num1 = new ShortcutAction("1",ShortcutAction.KeyCode.NUM1, null);
37            Action Num2 = new ShortcutAction("2",ShortcutAction.KeyCode.NUM2, null);
38            Action Num3 = new ShortcutAction("3",ShortcutAction.KeyCode.NUM3, null);
39            Action Num4 = new ShortcutAction("4",ShortcutAction.KeyCode.NUM4, null);
40            Action Num5 = new ShortcutAction("5",ShortcutAction.KeyCode.NUM5, null);
41            Action Num6 = new ShortcutAction("6",ShortcutAction.KeyCode.NUM6, null);
42            Action Num7 = new ShortcutAction("7",ShortcutAction.KeyCode.NUM7, null);
43            Action Num8 = new ShortcutAction("8",ShortcutAction.KeyCode.NUM8, null);
44            Action Num9 = new ShortcutAction("9",ShortcutAction.KeyCode.NUM9, null);
45            
46            Action PadNum0 = new ShortcutAction("0",96, null);
47            Action PadNum1 = new ShortcutAction("1",97, null);
48            Action PadNum2 = new ShortcutAction("2",98, null);
49            Action PadNum3 = new ShortcutAction("3",99, null);
50            Action PadNum4 = new ShortcutAction("4",100, null);
51            Action PadNum5 = new ShortcutAction("5",101, null);
52            Action PadNum6 = new ShortcutAction("6",102, null);
53            Action PadNum7 = new ShortcutAction("7",103, null);
54            Action PadNum8 = new ShortcutAction("8",104, null);
55            Action PadNum9 = new ShortcutAction("9",105, null);	        
56			@Override
57			public Action[] getActions(Object target, Object sender) {
58				return new Action[] {
59						ENTER, BackSpace, ESC ,DEL ,SPACE ,
60						Num0,Num1,Num2,Num3,Num4,Num5,Num6,Num7,Num8,Num9,
61						PadNum0,PadNum1,PadNum2,PadNum3,PadNum4,PadNum5,PadNum6,PadNum7,PadNum8,PadNum9
62					};
63			}
64
65			@Override
66			public void handleAction(Action action, Object sender, Object target) {
67					close();
68			}
69		});		
70		
71		this.center();
72		
73		setContent(m_Image);
74	}
75}