Changeset 850
- Timestamp:
- 09/21/12 17:39:44 (12 years ago)
- Location:
- trunk/quest-jfcmonitor/src/main/java/de/ugoe/cs/quest/jfcmonitor
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/quest-jfcmonitor/src/main/java/de/ugoe/cs/quest/jfcmonitor/JFCComponent.java
r842 r850 4 4 import java.awt.Component; 5 5 import java.awt.Container; 6 import java.beans.PropertyChangeListener; 6 7 import java.io.File; 7 8 import java.lang.reflect.InvocationTargetException; 8 9 import java.lang.reflect.Method; 9 10 import java.security.InvalidParameterException; 11 import java.util.ArrayList; 10 12 import java.util.HashMap; 11 13 import java.util.LinkedList; … … 35 37 private static Map<Component, JFCComponent> knownComponents = 36 38 new HashMap<Component, JFCComponent>(); 39 40 /** 41 * <p> 42 * List of PropertyChangeListeners that are registered on the components. 43 * </p> 44 */ 45 46 private static List<PropertyChangeListener> propertyChangeListeners = 47 new ArrayList<PropertyChangeListener>(); 37 48 38 49 /** … … 47 58 public static void add(Component component) { 48 59 add(component, find(component.getParent())); 60 } 61 62 public static void addListener(PropertyChangeListener list){ 63 propertyChangeListeners.add(list); 49 64 } 50 65 … … 162 177 } 163 178 this.component = component; 179 180 AccessibleContext context = component.getAccessibleContext(); 181 if (context != null){ 182 for (PropertyChangeListener listener: propertyChangeListeners) 183 context.addPropertyChangeListener(listener); 184 } 185 164 186 this.parent = parent; 165 187 if (parent != null) { … … 201 223 builder.append(" <component"); 202 224 if (parent != null){ 203 builder.append(" parent= " + Integer.toHexString(parent.component.hashCode()));225 builder.append(" parent=\"" + Integer.toHexString(parent.component.hashCode()) + "\""); 204 226 } 205 227 builder.append(">"+ StringTools.ENDLINE); … … 351 373 } 352 374 } 353 354 375 } -
trunk/quest-jfcmonitor/src/main/java/de/ugoe/cs/quest/jfcmonitor/JFCListener.java
r842 r850 107 107 if (event.getSource() instanceof Component) { 108 108 Component source = (Component) event.getSource(); 109 builder.append(" hash= " + Integer.toHexString(source.hashCode()));109 builder.append(" hash=\"" + Integer.toHexString(source.hashCode()) + "\""); 110 110 } 111 111 builder.append(">" + StringTools.ENDLINE); -
trunk/quest-jfcmonitor/src/main/java/de/ugoe/cs/quest/jfcmonitor/JFCMonitorOutputWriter.java
r842 r850 34 34 public JFCMonitorOutputWriter(OutputStreamWriter outputWriter) { 35 35 this.outputWriter = outputWriter; 36 try { 37 outputWriter.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + StringTools.ENDLINE); 38 outputWriter.write("<sessions>" + StringTools.ENDLINE); 39 } 40 catch (IOException e) { 41 System.err.println("JFCMONITOR -- Failure writing to log: " + e.getMessage()); 42 } 36 write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + StringTools.ENDLINE); 37 write("<sessions>" + StringTools.ENDLINE); 43 38 } 44 39 -
trunk/quest-jfcmonitor/src/main/java/de/ugoe/cs/quest/jfcmonitor/Runner.java
r842 r850 64 64 Toolkit.getDefaultToolkit().addAWTEventListener(new WindowMonitor(jfcWriter), 65 65 AWTEvent.WINDOW_EVENT_MASK); 66 JFCComponent.addListener(new NameChangeListener(jfcWriter)); 66 67 67 68 if (stdOutputWrite) { … … 79 80 Toolkit.getDefaultToolkit().addAWTEventListener(new WindowMonitor(stdJfcWriter), 80 81 AWTEvent.WINDOW_EVENT_MASK); 82 JFCComponent.addListener(new NameChangeListener(stdJfcWriter)); 81 83 } 82 84 catch (UnsupportedEncodingException e) {
Note: See TracChangeset
for help on using the changeset viewer.