Changeset 853 for trunk/quest-jfcmonitor/src/main/java/de/ugoe
- Timestamp:
- 10/02/12 11:43:50 (12 years ago)
- Location:
- trunk/quest-jfcmonitor/src/main/java/de/ugoe/cs/quest/jfcmonitor
- Files:
-
- 5 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/quest-jfcmonitor/src/main/java/de/ugoe/cs/quest/jfcmonitor/JFCComponent.java
r851 r853 26 26 * </p> 27 27 * 28 * @author Steffen Herbold, Fabian Glaser 28 * @author Steffen Herbold 29 * @author Fabian Glaser 29 30 * @version 1.0 30 31 */ … … 44 45 * </p> 45 46 */ 46 47 47 private static List<PropertyChangeListener> propertyChangeListeners = 48 48 new ArrayList<PropertyChangeListener>(); 49 49 50 /** 51 * <p> 52 * List of ContainerListeners that are registered on the components. 53 * </p> 54 */ 50 55 private static List<ContainerListener> containerListeners = 51 56 new ArrayList<ContainerListener>(); … … 64 69 } 65 70 71 /** 72 * <p> 73 * Adds a new PropertyChangeListener to the components. 74 * </p> 75 * @param list 76 * the PropertyChangeListener 77 */ 66 78 public static void addPropertyChangeListener(PropertyChangeListener list){ 67 79 propertyChangeListeners.add(list); 68 80 } 69 81 82 /** 83 * <p> 84 * Adds a new ContainerListener to the components. 85 * </p> 86 * @param list 87 * the ContainerListener 88 */ 70 89 public static void addContainerListener(ContainerListener list){ 71 90 containerListeners.add(list); 72 91 } 73 92 93 /** 94 * <p> 95 * Tests if a component is already known. 96 * </p> 97 * @param component to be tested 98 * @return true, if component is already known, false otherwise. 99 */ 74 100 public static boolean isKnown(Component component){ 75 101 if (knownComponents.containsKey(component)) … … 238 264 setTitle(); 239 265 StringBuilder builder = new StringBuilder(); 240 builder.append(" 266 builder.append("<component"); 241 267 if (parent != null){ 242 268 if (!JFCComponent.isKnown(parent.component)) … … 245 271 } 246 272 builder.append(">"+ StringTools.ENDLINE); 247 builder.append(" 248 builder.append(" 273 builder.append(" <param name=\"title\" value=\"" + title + "\" />" + StringTools.ENDLINE); 274 builder.append(" <param name=\"class\" value=\"" + componentClass + "\" />" + 249 275 StringTools.ENDLINE); 250 builder.append(" 251 builder.append(" 252 builder.append(" 276 builder.append(" <param name=\"icon\" value=\"" + icon + "\" />" + StringTools.ENDLINE); 277 builder.append(" <param name=\"index\" value=\"" + index + "\" />" + StringTools.ENDLINE); 278 builder.append(" <param name=\"hash\" value=\"" + 253 279 Integer.toHexString(component.hashCode()) + "\" />" + StringTools.ENDLINE); 254 builder.append(" </component>" + StringTools.ENDLINE); 280 builder.append(getInheritanceTree()); 281 builder.append("</component>" + StringTools.ENDLINE); 255 282 return builder.toString(); 256 283 } … … 392 419 } 393 420 } 421 422 /** 423 * <p> 424 * Constructs a string that represents inheritance of component. 425 * </p> 426 * @return 427 */ 428 private String getInheritanceTree(){ 429 StringBuilder builder = new StringBuilder(); 430 Class<? extends Object> classobject = component.getClass(); 431 while(classobject.getSuperclass() != null){ 432 classobject = classobject.getSuperclass(); 433 builder.append(" <ancestor name=\""); 434 builder.append(classobject.getName()); 435 builder.append("\" />" + StringTools.ENDLINE); 436 } 437 return builder.toString(); 438 } 394 439 } -
trunk/quest-jfcmonitor/src/main/java/de/ugoe/cs/quest/jfcmonitor/JFCListener.java
r850 r853 17 17 * </p> 18 18 * 19 * @author Steffen Herbold, Fabian Glaser 19 * @author Steffen Herbold 20 * @author Fabian Glaser 20 21 * @version 1.0 21 22 */ -
trunk/quest-jfcmonitor/src/main/java/de/ugoe/cs/quest/jfcmonitor/JFCMonitorOutputWriter.java
r850 r853 38 38 } 39 39 40 public void write(String str){ 40 /** 41 * <p> 42 * Writes a string to the internal OutputStreamWriter. 43 * </p> 44 * @param str 45 */ 46 public synchronized void write(String str){ 41 47 try { 42 48 outputWriter.write(str); -
trunk/quest-jfcmonitor/src/main/java/de/ugoe/cs/quest/jfcmonitor/JFCNameChangeListener.java
r851 r853 13 13 14 14 /** 15 * <p> 16 * Listener that listens on the name change of a component. 17 * </p> 15 18 * @author Fabian Glaser 16 * 19 * @version 1.0 17 20 */ 18 21 public class JFCNameChangeListener implements PropertyChangeListener { … … 22 25 * </p> 23 26 */ 24 final private JFCMonitorOutputWriter outputWriter; 27 final private JFCMonitorOutputWriter outputWriter; 25 28 29 /** 30 * <p> 31 * Constructor. Creates a new JFCNameChangeListener with a given 32 * {@link JFCMonitorOutputWriter} 33 * </p> 34 * @param outputWriter 35 */ 26 36 public JFCNameChangeListener(JFCMonitorOutputWriter outputWriter){ 27 37 this.outputWriter = outputWriter; -
trunk/quest-jfcmonitor/src/main/java/de/ugoe/cs/quest/jfcmonitor/JFCWindowMonitor.java
r852 r853 12 12 * </p> 13 13 * 14 * @author Steffen Herbold, Fabian Glaser 14 * @author Steffen Herbold 15 * @author Fabian Glaser 15 16 * @version 1.0 16 17 */ 17 public class WindowMonitor implements AWTEventListener {18 public class JFCWindowMonitor implements AWTEventListener { 18 19 /** 19 20 * <p> … … 25 26 /** 26 27 * <p> 27 * Constructor. Creates a new WindowMonitor with a given {@link JFCMonitorOutputWriter}, where the28 * Constructor. Creates a new JFCWindowMonitor with a given {@link JFCMonitorOutputWriter}, where the 28 29 * monitored information is logged. 29 30 * </p> … … 32 33 * writer for the logged information 33 34 */ 34 public WindowMonitor(JFCMonitorOutputWriter outputWriter) {35 public JFCWindowMonitor(JFCMonitorOutputWriter outputWriter) { 35 36 this.outputWriter = outputWriter; 36 37 } -
trunk/quest-jfcmonitor/src/main/java/de/ugoe/cs/quest/jfcmonitor/Runner.java
r851 r853 20 20 * </p> 21 21 * 22 * @author Steffen Herbold, Fabian Glaser 22 * @author Steffen Herbold 23 * @author Fabian Glaser 23 24 * @version 1.0 24 25 */ … … 62 63 Toolkit.getDefaultToolkit().addAWTEventListener(listenerFile, AWTEvent.MOUSE_EVENT_MASK); 63 64 Toolkit.getDefaultToolkit().addAWTEventListener(listenerFile, FocusEvent.FOCUS_EVENT_MASK); 64 Toolkit.getDefaultToolkit().addAWTEventListener(new WindowMonitor(jfcWriter),65 Toolkit.getDefaultToolkit().addAWTEventListener(new JFCWindowMonitor(jfcWriter), 65 66 AWTEvent.WINDOW_EVENT_MASK); 66 67 JFCComponent.addPropertyChangeListener(new JFCNameChangeListener(jfcWriter)); 68 JFCComponent.addContainerListener(new JFCContainerListener(jfcWriter)); 67 69 68 70 if (stdOutputWrite) { … … 78 80 Toolkit.getDefaultToolkit().addAWTEventListener(listenerStdOut, 79 81 FocusEvent.FOCUS_EVENT_MASK); 80 Toolkit.getDefaultToolkit().addAWTEventListener(new WindowMonitor(stdJfcWriter),82 Toolkit.getDefaultToolkit().addAWTEventListener(new JFCWindowMonitor(stdJfcWriter), 81 83 AWTEvent.WINDOW_EVENT_MASK); 82 84 JFCComponent.addPropertyChangeListener(new JFCNameChangeListener(stdJfcWriter));
Note: See TracChangeset
for help on using the changeset viewer.