Changeset 48
- Timestamp:
- 05/14/08 18:52:10 (16 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/agents/Format.java
r19 r48 165 165 @Override 166 166 protected void finalise(Frame start) { 167 /* 168 * if(_success) message("Formating complete."); 169 */ 167 if(_success) overwriteMessage("Formating complete."); 170 168 } 171 169 -
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) -
trunk/src/org/expeditee/gui/FrameGraphics.java
r37 r48 50 50 51 51 // the number of messages currently shown (used for scrolling up) 52 private static int _MessageCount = 1;52 private static int _MessageCount = 0; 53 53 54 54 // modes … … 572 572 for (int ind = Messages.length - 1; ind >= 0; ind--) { 573 573 if (Messages[ind] != null) { 574 Messages[ind].setText( message);574 Messages[ind].setText(getMessagePrefix(false) + message); 575 575 Repaint(); 576 576 return; … … 641 641 for (int i = 0; i < Messages.length; i++) { 642 642 if (Messages[i] == null) { 643 Messages[i] = new Text(-1, "@" + _MessageCount++ + ": "643 Messages[i] = new Text(-1, getMessagePrefix(true) 644 644 + message); 645 645 Messages[i].setPosition(20, pos); … … 669 669 Text last = Messages[Messages.length - 1]; 670 670 last.setColor(color); 671 last.setText( "@" + _MessageCount++ + ": "+ message);671 last.setText(getMessagePrefix(true) + message); 672 672 last.setLink(link); 673 673 … … 676 676 MessageLink.setLink(_creator.getCurrent()); 677 677 Repaint(); 678 } 679 680 private static String getMessagePrefix(boolean incrementCounter) { 681 if (incrementCounter) 682 _MessageCount++; 683 return "@" + _MessageCount + ": "; 678 684 } 679 685
Note:
See TracChangeset
for help on using the changeset viewer.