Changeset 86 for trunk/src/org/expeditee/gui/AttributeUtils.java
- Timestamp:
- 06/05/08 10:11:18 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/AttributeUtils.java
r80 r86 77 77 _AllowNull = new LinkedList<Method>(); 78 78 _AllowNull.add(Item.class.getMethod("getColor", param)); 79 _AllowNull.add(Item.class.getMethod("getBackgroundColor", param)); 79 80 80 81 _AllowNull.add(Frame.class.getMethod("getBackgroundColor", param)); … … 273 274 274 275 // Make sure the classes of the methods match the item 275 if (m.getDeclaringClass() == toExtract.getClass() 276 || m.getDeclaringClass() == toExtract.getClass() 277 .getSuperclass()) { 276 if (m.getDeclaringClass().isAssignableFrom(toExtract.getClass())) { 278 277 try { 279 278 Object o = m.invoke(toExtract, (Object[]) null); … … 440 439 // if no paris exist, we are done 441 440 if (values.size() == 0 442 || (values.size() == 1 && values.get(0).length() == 0)) 441 || (values.size() == 1 && values.get(0).length() == 0)) { 443 442 return false; 443 } 444 444 445 445 // loop through all attribute: value pairs … … 553 553 int i = 0; 554 554 while (_SetMethods.containsKey(attribute + i)) { 555 if (_SetMethods.get(attribute + i).getDeclaringClass() == toSet 556 .getClass() 557 || _SetMethods.get(attribute + i).getDeclaringClass() == toSet 558 .getClass().getSuperclass()) 555 if (_SetMethods.get(attribute + i).getDeclaringClass().isAssignableFrom(toSet.getClass())) 559 556 possibles.add(_SetMethods.get(attribute + i)); 560 557 i++; … … 564 561 Object current = null; 565 562 Object[] param = {}; 566 Class toSetClass = toSet.getClass();567 Class toSetSuperClass = toSetClass.getSuperclass();568 563 // find the corresponding get method for this set method 569 564 // and get the current value of the attribute 570 565 for (Method m : _GetMethods) { 571 if ((m.getDeclaringClass() == toSetClass || m 572 .getDeclaringClass() == toSetSuperClass) 566 if (m.getDeclaringClass().isAssignableFrom(toSet.getClass()) 573 567 && m.getName().substring(GET_LENGTH).equals( 574 568 possible.getName().substring(SET_LENGTH))) {
Note:
See TracChangeset
for help on using the changeset viewer.