Changeset 853 for trunk/quest-jfcmonitor/src/main/java/de/ugoe/cs/quest/jfcmonitor/JFCComponent.java
- Timestamp:
- 10/02/12 11:43:50 (12 years ago)
- File:
-
- 1 edited
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 }
Note: See TracChangeset
for help on using the changeset viewer.