Changeset 356 for trunk/JFCMonitor/src/de/ugoe/cs
- Timestamp:
- 01/26/12 15:47:23 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JFCMonitor/src/de/ugoe/cs/eventbench/jfcmonitor/JFCListener.java
r355 r356 24 24 /** 25 25 * <p> 26 * Convenience variable.27 * </p>28 */29 final static private String ENDLINE = System.getProperty("line.separator");30 31 /**32 * <p>33 26 * Writer for logging events. 34 27 * </p> … … 49 42 try { 50 43 outputWriter.write("<?xml version=\"1.0\" encoding=\"UTF-16\"?>" 51 + ENDLINE);52 outputWriter.write("<sessions>" + ENDLINE);44 + StringTools.ENDLINE); 45 outputWriter.write("<sessions>" + StringTools.ENDLINE); 53 46 } catch (IOException e) { 54 47 System.err.println("JFCMONITOR -- Failure writing to log: " … … 72 65 MouseEvent mouseEvent = (MouseEvent) event; 73 66 if (!isMouseMovement(event.getID())) { 74 builder.append("<event id=\"" + event.getID() + "\">" + ENDLINE);67 builder.append("<event id=\"" + event.getID() + "\">" + StringTools.ENDLINE); 75 68 builder.append(" <param name=\"X\" value=\"" 76 + mouseEvent.getX() + "\" />" + ENDLINE);69 + mouseEvent.getX() + "\" />" + StringTools.ENDLINE); 77 70 builder.append(" <param name=\"Y\" value=\"" 78 + mouseEvent.getY() + "\" />" + ENDLINE);71 + mouseEvent.getY() + "\" />" + StringTools.ENDLINE); 79 72 builder.append(" <param name=\"Button\" value=\"" 80 + mouseEvent.getButton() + "\" />" + ENDLINE);73 + mouseEvent.getButton() + "\" />" + StringTools.ENDLINE); 81 74 builder.append(" <param name=\"Modifiers\" value=\"" 82 + mouseEvent.getModifiers() + "\" />" + ENDLINE);75 + mouseEvent.getModifiers() + "\" />" + StringTools.ENDLINE); 83 76 addSourceInfo(builder, event); 84 builder.append("</event>" + ENDLINE);77 builder.append("</event>" + StringTools.ENDLINE); 85 78 } 86 79 } … … 88 81 KeyEvent keyEvent = (KeyEvent) event; 89 82 if (keyEvent.getID() == KeyEvent.KEY_TYPED) { 90 builder.append("<event id=\"" + event.getID() + "\">" + ENDLINE);83 builder.append("<event id=\"" + event.getID() + "\">" + StringTools.ENDLINE); 91 84 builder.append(" <param name=\"KeyCode\" value=\"" 92 + keyEvent.getKeyCode() + "\" />" + ENDLINE);85 + keyEvent.getKeyCode() + "\" />" + StringTools.ENDLINE); 93 86 builder.append(" <param name=\"Modifiers\" value=\"" 94 + keyEvent.getModifiers() + "\" />" + ENDLINE);87 + keyEvent.getModifiers() + "\" />" + StringTools.ENDLINE); 95 88 addSourceInfo(builder, event); 96 builder.append("</event>" + ENDLINE);89 builder.append("</event>" + StringTools.ENDLINE); 97 90 } 98 91 } … … 119 112 */ 120 113 private void addSourceInfo(StringBuilder builder, AWTEvent event) { 121 builder.append(" <source>" + ENDLINE);114 builder.append(" <source>" + StringTools.ENDLINE); 122 115 builder.append(" <param name=\"toString\" value=\"" 123 116 + StringTools 124 117 .xmlEntityReplacement(event.getSource().toString()) 125 + "\" />" + ENDLINE);118 + "\" />" + StringTools.ENDLINE); 126 119 if (event.getSource() instanceof Component) { 127 120 Component source = (Component) event.getSource(); … … 131 124 } 132 125 } 133 builder.append(" </source>" + ENDLINE);126 builder.append(" </source>" + StringTools.ENDLINE); 134 127 } 135 128
Note: See TracChangeset
for help on using the changeset viewer.