- Timestamp:
- 09/09/11 06:23:36 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/windows/HandlerCreate.java
r156 r171 3 3 import de.ugoe.cs.eventbench.windows.data.WindowTree; 4 4 5 /** 6 * <p> 7 * Message handler for {@code WM_CREATE} messages. The handler maintains the 8 * {@link WindowTree}. 9 * </p> 10 * 11 * @author Steffen Herbold 12 * @version 1.0 13 */ 5 14 public class HandlerCreate extends MessageHandler { 6 15 16 /** 17 * <p> 18 * Constructor. Creates a new HandlerCreate. 19 * </p> 20 */ 7 21 public HandlerCreate() { 8 22 super(); 9 23 } 10 24 25 /** 26 * <p> 27 * Name of the created window. 28 * </p> 29 */ 11 30 private String windowName; 31 32 /** 33 * <p> 34 * HWND of the created window. 35 * </p> 36 */ 12 37 private int hwnd; 38 39 /** 40 * <p> 41 * HWND of the created window's parent. 42 * </p> 43 */ 13 44 private int parentHwnd; 45 46 /** 47 * <p> 48 * Resource Id of the created window. 49 * </p> 50 */ 14 51 private int resourceId; 52 53 /** 54 * <p> 55 * Window class of the created window. 56 * </p> 57 */ 15 58 private String className; 59 60 /** 61 * <p> 62 * Modality of the created window. 63 * </p> 64 */ 16 65 private boolean isModal; 17 66 67 /* 68 * (non-Javadoc) 69 * 70 * @see de.ugoe.cs.eventbench.windows.MessageHandler#onEndElement() 71 */ 18 72 @Override 19 73 public void onEndElement() { 20 if( hwnd!=0 ) { 21 WindowTree.getInstance().add(parentHwnd, hwnd, windowName, resourceId, className, isModal); 74 if (hwnd != 0) { 75 WindowTree.getInstance().add(parentHwnd, hwnd, windowName, 76 resourceId, className, isModal); 22 77 } 23 78 } 24 79 80 /* 81 * (non-Javadoc) 82 * 83 * @see 84 * de.ugoe.cs.eventbench.windows.MessageHandler#onParameter(java.lang.String 85 * , java.lang.String) 86 */ 25 87 @Override 26 88 public void onParameter(String name, String value) { 27 if ( name.equals("window.hwnd")) {89 if (name.equals("window.hwnd")) { 28 90 hwnd = Integer.parseInt(value); 29 } 30 else if( name.equals("window.name") ) { 91 } else if (name.equals("window.name")) { 31 92 windowName = value; 32 } 33 else if( name.equals("window.parent.hwnd") ) { 93 } else if (name.equals("window.parent.hwnd")) { 34 94 parentHwnd = Integer.parseInt(value); 35 } 36 else if( name.equals("window.resourceId") ) { 95 } else if (name.equals("window.resourceId")) { 37 96 resourceId = Integer.parseInt(value); 38 } 39 else if( name.equals("window.class") ) { 40 if( value.startsWith("Afx:") ) { 97 } else if (name.equals("window.class")) { 98 if (value.startsWith("Afx:")) { 41 99 className = "Afx:"; 42 100 } else { 43 101 className = value; 44 102 } 45 } 46 else if( name.equals("window.ismodal") ) { 47 if( value.equals("true") || value.equals("1") ) { 103 } else if (name.equals("window.ismodal")) { 104 if (value.equals("true") || value.equals("1")) { 48 105 isModal = true; 49 106 } … … 51 108 } 52 109 110 /* 111 * (non-Javadoc) 112 * 113 * @see de.ugoe.cs.eventbench.windows.MessageHandler#onStartElement() 114 */ 53 115 @Override 54 116 public void onStartElement() {
Note: See TracChangeset
for help on using the changeset viewer.