Changeset 277


Ignore:
Timestamp:
12/06/11 11:46:11 (12 years ago)
Author:
sherbold
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JFCMonitor/src/de/ugoe/cs/eventbench/jfcmonitor/JFCListener.java

    r271 r277  
    101101         */ 
    102102        private void addSourceInfo(StringBuilder builder, AWTEvent event) { 
    103                 builder.append(" <param name=\"Source\" value=\"" 
     103                builder.append(" <source>" + ENDLINE); 
     104                builder.append("  <param name=\"toString\" value=\"" 
    104105                                + event.getSource().toString() + "\" />" + ENDLINE); 
    105106                if (event.getSource() instanceof Component) { 
    106107                        Component source = (Component) event.getSource(); 
    107                         addComponentInfo(builder, source, "Source"); 
    108                         addComponentInfo(builder, source.getParent(), "Parent"); 
     108                        addComponentInfo(builder, source); 
     109                        builder.append(" <parent>" + ENDLINE); 
     110                        addComponentInfo(builder, source.getParent()); 
     111                        builder.append(" </parent>" + ENDLINE); 
    109112                } 
     113                builder.append(" </source>" + ENDLINE); 
    110114        } 
    111115 
     
    120124         * @param component 
    121125         *            component whose information is appended 
    122          * @param prefix 
    123          *            prefix to give further information about the component 
    124126         */ 
    125         private void addComponentInfo(StringBuilder builder, Component component, 
    126                         String prefix) { 
    127                 builder.append(" <param name=\"" + prefix + "Name\" value=\"" 
     127        private void addComponentInfo(StringBuilder builder, Component component) { 
     128                builder.append("  <param name=\"getName\" value=\"" 
    128129                                + component.getName() + "\" />" + ENDLINE); 
    129130                for (Method method : component.getClass().getMethods()) { 
     
    132133                                        String text = (String) method.invoke(component, 
    133134                                                        new Object[] {}); 
    134                                         builder.append(" <param name=\"" + prefix 
    135                                                         + "Text\" value=\"" + text + "\" />" + ENDLINE); 
     135                                        builder.append("  <param name=\"getText\" value=\"" + text + "\" />" + ENDLINE); 
    136136                                } 
    137137                                if (method.getName() == "getTitle") { 
    138138                                        String title = (String) method.invoke(component, 
    139139                                                        new Object[] {}); 
    140                                         builder.append(" <param name=\"" + prefix 
    141                                                         + "Title\" value=\"" + title + "\" />" + ENDLINE); 
     140                                        builder.append("  <param name=\"getTitle\" value=\"" + title + "\" />" + ENDLINE); 
    142141                                } 
    143142                        } catch (IllegalArgumentException e) { 
Note: See TracChangeset for help on using the changeset viewer.