Changeset 48 for trunk/src/org/expeditee/gui/AttributeUtils.java
- Timestamp:
- 05/14/08 18:52:10 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/AttributeUtils.java
r19 r48 66 66 _GetMethods = new LinkedList<Method>(); 67 67 _GetMethods.add(Item.class.getMethod("getDateCreated", param)); 68 _GetMethods.add(Item.class.getMethod("getSize", param));68 69 69 _GetMethods.add(Item.class.getMethod("getColor", param)); 70 70 _GetMethods.add(Item.class.getMethod("getBackgroundColor", param)); … … 73 73 _GetMethods.add(Item.class.getMethod("getFillColor", param)); 74 74 _GetMethods.add(Item.class.getMethod("getFillPattern", param)); 75 75 _GetMethods.add(Item.class.getMethod("getThickness", param)); 76 76 77 _GetMethods.add(Item.class.getMethod("getOwner", param)); 77 78 _GetMethods.add(Item.class.getMethod("getLinkMark", param)); … … 98 99 _GetMethods.add(Text.class.getMethod("getJustification", param)); 99 100 _GetMethods.add(Text.class.getMethod("getWidth", param)); 101 _GetMethods.add(Text.class.getMethod("getSize", param)); 100 102 101 103 _GetMethods.add(Frame.class.getMethod("getOwner", param)); … … 238 240 Object o = m.invoke(toExtract, (Object[]) null); 239 241 if (o != null) { 240 // Class[] param = {o.getClass()};241 // convert the returned object to a string242 // try {243 /*244 * //convert object types to primitives if(o.getClass() ==245 * Integer.class) param[0] = int.class; else246 * if(o.getClass() == LinkedList.class) param[0] =247 * List.class; else if(o.getClass() == Float.class)248 * param[0] = float.class; else if(o.getClass() ==249 * Double.class) param[0] = double.class;250 */251 // the class must have both set and get methods for an252 // attribute253 // (if it has no set method this will throw an254 // exception)255 // toExtract.getClass().getMethod("set" +256 // m.getName().substring(3), param);257 // Convert the values returned into human readable258 // values259 242 if (o instanceof Integer) { 260 243 if (m.getName().endsWith("Justification") … … 273 256 } else if (o instanceof Float) { 274 257 // -1 indicates default value 275 if (((Float) o) > -1)258 if (((Float) o) > 0.0001) 276 259 attributes.append(m.getName().substring(3)) 277 260 .append(SEPARATOR_STRING).append(o) … … 279 262 } else if (o instanceof Double) { 280 263 // -1 indicates default value 281 if (((Double) o) > -1)264 if (((Double) o) > 0.0001) 282 265 attributes.append(m.getName().substring(3)) 283 266 .append(SEPARATOR_STRING).append(o)
Note:
See TracChangeset
for help on using the changeset viewer.