Changeset 48


Ignore:
Timestamp:
05/14/08 18:52:10 (16 years ago)
Author:
ra33
Message:

Made both types of messages (normal and overwrite mode) output the numbered prefix

Location:
trunk/src/org/expeditee
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/agents/Format.java

    r19 r48  
    165165        @Override
    166166        protected void finalise(Frame start) {
    167                 /*
    168                  * if(_success) message("Formating complete.");
    169                  */
     167                 if(_success) overwriteMessage("Formating complete.");
    170168        }
    171169
  • trunk/src/org/expeditee/gui/AttributeUtils.java

    r19 r48  
    6666                        _GetMethods = new LinkedList<Method>();
    6767                        _GetMethods.add(Item.class.getMethod("getDateCreated", param));
    68                         _GetMethods.add(Item.class.getMethod("getSize", param));
     68                       
    6969                        _GetMethods.add(Item.class.getMethod("getColor", param));
    7070                        _GetMethods.add(Item.class.getMethod("getBackgroundColor", param));
     
    7373                        _GetMethods.add(Item.class.getMethod("getFillColor", param));
    7474                        _GetMethods.add(Item.class.getMethod("getFillPattern", param));
    75 
     75                        _GetMethods.add(Item.class.getMethod("getThickness", param));
     76                       
    7677                        _GetMethods.add(Item.class.getMethod("getOwner", param));
    7778                        _GetMethods.add(Item.class.getMethod("getLinkMark", param));
     
    9899                        _GetMethods.add(Text.class.getMethod("getJustification", param));
    99100                        _GetMethods.add(Text.class.getMethod("getWidth", param));
     101                        _GetMethods.add(Text.class.getMethod("getSize", param));
    100102
    101103                        _GetMethods.add(Frame.class.getMethod("getOwner", param));
     
    238240                                        Object o = m.invoke(toExtract, (Object[]) null);
    239241                                        if (o != null) {
    240                                                 // Class[] param = {o.getClass()};
    241                                                 // convert the returned object to a string
    242                                                 // try {
    243                                                 /*
    244                                                  * //convert object types to primitives if(o.getClass() ==
    245                                                  * Integer.class) param[0] = int.class; else
    246                                                  * 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 an
    252                                                 // attribute
    253                                                 // (if it has no set method this will throw an
    254                                                 // exception)
    255                                                 // toExtract.getClass().getMethod("set" +
    256                                                 // m.getName().substring(3), param);
    257                                                 // Convert the values returned into human readable
    258                                                 // values
    259242                                                if (o instanceof Integer) {
    260243                                                        if (m.getName().endsWith("Justification")
     
    273256                                                } else if (o instanceof Float) {
    274257                                                        // -1 indicates default value
    275                                                         if (((Float) o) > -1)
     258                                                        if (((Float) o) > 0.0001)
    276259                                                                attributes.append(m.getName().substring(3))
    277260                                                                                .append(SEPARATOR_STRING).append(o)
     
    279262                                                } else if (o instanceof Double) {
    280263                                                        // -1 indicates default value
    281                                                         if (((Double) o) > -1)
     264                                                        if (((Double) o) > 0.0001)
    282265                                                                attributes.append(m.getName().substring(3))
    283266                                                                                .append(SEPARATOR_STRING).append(o)
  • trunk/src/org/expeditee/gui/FrameGraphics.java

    r37 r48  
    5050
    5151        // the number of messages currently shown (used for scrolling up)
    52         private static int _MessageCount = 1;
     52        private static int _MessageCount = 0;
    5353
    5454        // modes
     
    572572                for (int ind = Messages.length - 1; ind >= 0; ind--) {
    573573                        if (Messages[ind] != null) {
    574                                 Messages[ind].setText(message);
     574                                Messages[ind].setText(getMessagePrefix(false) + message);
    575575                                Repaint();
    576576                                return;
     
    641641                        for (int i = 0; i < Messages.length; i++) {
    642642                                if (Messages[i] == null) {
    643                                         Messages[i] = new Text(-1, "@" + _MessageCount++ + ": "
     643                                        Messages[i] = new Text(-1, getMessagePrefix(true)
    644644                                                        + message);
    645645                                        Messages[i].setPosition(20, pos);
     
    669669                Text last = Messages[Messages.length - 1];
    670670                last.setColor(color);
    671                 last.setText("@" + _MessageCount++ + ": " + message);
     671                last.setText(getMessagePrefix(true) + message);
    672672                last.setLink(link);
    673673
     
    676676                MessageLink.setLink(_creator.getCurrent());
    677677                Repaint();
     678        }
     679
     680        private static String getMessagePrefix(boolean incrementCounter) {
     681                if (incrementCounter)
     682                        _MessageCount++;
     683                return "@" + _MessageCount + ": ";
    678684        }
    679685
Note: See TracChangeset for help on using the changeset viewer.