Changeset 19


Ignore:
Timestamp:
05/06/08 18:15:05 (16 years ago)
Author:
ra33
Message:
 
Location:
trunk/src/org/expeditee
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/actions/Misc.java

    r7 r19  
    7777                 */
    7878                FrameIO.SaveFrame(DisplayIO.getCurrentFrame());
     79               
     80                while(FrameIO.DeleteFrameset("messages"))
     81                        ;
    7982
    8083                StatsLogger.WriteStatsFile();
  • trunk/src/org/expeditee/actions/Simple.java

    r7 r19  
    574574                                Text valueItem = null;
    575575                                // Begin the search
    576                                 for (Text text : targetFrame.getBodyTextItems()) {
     576                                for (Text text : targetFrame.getBodyTextItems(true)) {
    577577                                        String s = text.getTextNoList().toLowerCase();
     578                                       
    578579                                        if (s.startsWith(targetAttribute)) {
    579580                                                attributeItem = text;
     
    588589                                        Point endPoint = attributeItem.getEndParagraphPosition();
    589590
    590                                         for (Text text : targetFrame.getBodyTextItems()) {
     591                                        for (Text text : targetFrame.getBodyTextItems(true)) {
    591592                                                Point startPoint = text.getPosition();
    592593                                                if (Math.abs(startPoint.y - endPoint.y) < 10
     
    804805                                        Text valueItem = null;
    805806                                        // Begin the search
    806                                         for (Text text : targetFrame.getBodyTextItems()) {
     807                                        for (Text text : targetFrame.getBodyTextItems(true)) {
    807808                                                String s = text.getTextNoList().toLowerCase();
    808809                                                if (s.startsWith(targetAttribute)) {
     
    821822                                                                .getEndParagraphPosition();
    822823
    823                                                 for (Text text : targetFrame.getBodyTextItems()) {
     824                                                for (Text text : targetFrame.getBodyTextItems(true)) {
    824825                                                        Point startPoint = text.getPosition();
    825826                                                        if (Math.abs(startPoint.y - endPoint.y) < 10
  • trunk/src/org/expeditee/agents/ComputeTree.java

    r7 r19  
    6767                Double result = null;
    6868
    69                 for (Item i : frame.getBodyTextItems()) {
     69                for (Item i : frame.getBodyTextItems(false)) {
    7070
    7171                        Double value = null;
  • trunk/src/org/expeditee/agents/Format.java

    r4 r19  
    4949                        Item i = start.getItems().get(j);
    5050
    51                         if (j > 1 && start.isNormalTextItem(i)) {
     51                        if (j > 0 && start.isNormalTextItem(i)) {
    5252                                int col = findColumn(columnHeads, i);
    5353                                // if this is the head of a new column
  • trunk/src/org/expeditee/agents/SwitchyardTree.java

    r4 r19  
    3131                startTime = System.currentTimeMillis();
    3232
    33                 for (Text textItem : frame.getBodyTextItems()) {
     33                for (Text textItem : frame.getBodyTextItems(false)) {
    3434                        // Delete all non-annotations with more that one letter
    3535                        if (textItem.getTextNoList().length() > 1)
     
    4242                                        if (childFrame != null) {
    4343                                                Point lastItemEnd = textItem.getEndParagraphPosition();
    44                                                 for (Text childItem : childFrame.getBodyTextItems()) {
     44                                                for (Text childItem : childFrame.getBodyTextItems(false)) {
    4545                                                        // look for red items
    4646                                                        if (childItem.getColor().equals(Color.RED)) {
  • trunk/src/org/expeditee/gui/AttributeUtils.java

    r4 r19  
    637637        public static void setSingleValue(Text text, String value) {
    638638                assert (value != null);
    639 
     639               
    640640                String oldText = text.getTextNoList();
    641641                String attribute = stripAttribute(oldText);
  • trunk/src/org/expeditee/gui/Frame.java

    r13 r19  
    219219         * @return the list of body text items.
    220220         */
    221         public List<Text> getBodyTextItems() {
     221        public List<Text> getBodyTextItems(boolean includeAnnotations) {
    222222                List<Text> bodyTextItems = new ArrayList<Text>();
    223223                Text frameTitle = getTitle();
     
    225225                for (Item i : getItems()) {
    226226                        // only add up normal body text items
    227                         if ((i instanceof Text) && i != frameTitle && !i.isAnnotation()) {
     227                        if ((i instanceof Text) && i != frameTitle &&
     228                                        (includeAnnotations || !i.isAnnotation())) {
    228229                                bodyTextItems.add((Text) i);
    229230                        }
     
    351352                        if (childFrame != null) {
    352353                                // read in attribute value pairs
    353                                 for (Text attribute : childFrame.getBodyTextItems()) {
     354                                for (Text attribute : childFrame.getBodyTextItems(false)) {
    354355                                        AttributeUtils.SetAttribute(t, attribute);
    355356                                }
     
    12011202                        if (it instanceof Text) {
    12021203                                Text t = (Text) it;
    1203                                 if (t.getTextNoList().toLowerCase().startsWith("@start:")
    1204                                                 || t.getTextNoList().toLowerCase().equals("@start")) {
     1204                                if (t.getTextNoList().toLowerCase().startsWith("@start")
     1205                                                || t.getTextNoList().toLowerCase().equals("@start:")) {
    12051206                                        t.stripFirstWord();
    12061207
  • trunk/src/org/expeditee/gui/FrameCreator.java

    r7 r19  
    22
    33import java.awt.Color;
     4import java.util.List;
    45
    56import org.expeditee.items.Item;
     
    4142                _name = name;
    4243                _lastY += toUse.getTitle().getPosition().y;
     44               
     45                //Check for @Start
     46                for (Item it : toUse.getItems()) {
     47                        if (it instanceof Text) {
     48                                Text t = (Text) it;
     49                                if (t.getTextNoList().toLowerCase().equals("@start") ||
     50                                                t.getTextNoList().toLowerCase().startsWith("@start:")) {
     51                                        t.stripFirstWord();
     52
     53                                        if (t.getTextNoList().equals("")){
     54                                                _lastY = t.getY();
     55                                                _lastX = t.getX();
     56                                                t.delete();
     57                                                break;
     58                                        }
     59                                }
     60                        }
     61                }
    4362                _current = toUse;
    4463
     
    118137
    119138        public void addText(String toAdd) {
    120                 /*
    121                  * Text text = _current.createNewText(); text.setText(toAdd);
    122                  *
    123                  * addItem(text);
    124                  */
    125139                addText(toAdd, null);
    126140        }
  • trunk/src/org/expeditee/gui/FrameGraphics.java

    r13 r19  
    4141
    4242        // messages shown in the message window
    43         public static Text[] Messages = new Text[3];
     43        public static Text[] Messages = new Text[4];
    4444
    4545        // buffer of the message window
     
    598598
    599599                // if the message slots have not all been used yet
    600                 if (_MessageCount < 4) {
     600                if (_MessageCount <= Messages.length) {
    601601                        int pos = 15;
    602602                        // find the next empty slot, and create the new message
    603603                        for (int i = 0; i < Messages.length; i++) {
    604604                                if (Messages[i] == null) {
    605                                         Messages[i] = new Text(-1, _MessageCount++ + ": " + message);
     605                                        Messages[i] = new Text(-1, "@" + _MessageCount++ + ": " + message);
    606606                                        Messages[i].setPosition(20, pos);
    607607                                        Messages[i].setOffset(0, -_MaxSize.height);
     
    630630                Text last = Messages[Messages.length - 1];
    631631                last.setColor(color);
    632                 last.setText(_MessageCount++ + ": " + message);
     632                last.setText("@" + _MessageCount++ + ": " + message);
    633633                last.setLink(link);
    634634
  • trunk/src/org/expeditee/gui/FrameKeyboardActions.java

    r13 r19  
    273273        private void navigateFrame(int direction) {
    274274                Frame next = null;
    275                 switch(direction){
     275                switch (direction) {
    276276                case Text.RIGHT:
    277277                case Text.PAGE_UP:
     
    734734                        String autoBullet = getAutoBullet(dummyItem.getTextNoList());
    735735
    736                         if (autoBullet.length() > 0) {
    737                                 dummyItem.stripFirstWord();
    738                         }
     736                        if (autoBullet.length() > 0)
     737                                newItemText = "";
    739738                        dummyItem.setText(newItemText + dummyItem.getTextNoList());
    740739                }
    741 
    742740                dummyItem = createText();
    743741                dummyItem.setText(newItemText);
    744 
    745742                // If the only item on the frame is the title and the frame name just
    746743                // drop a specified distance below the title
     
    753750                        DisplayIO.setCursorPosition(xPos, yPos);
    754751                } else {
    755 
    756752                        int yPos = column.get(0).getY() + 1;
    757 
    758753                        // Either position the new item below the title or just above
    759754                        // the first item below the title
     
    763758                                                                + title.getBoundsHeight()
    764759                                                                + dummyItem.getBoundsHeight());
    765 
    766760                        dummyItem.setPosition(column.get(0).getX(), yPos);
    767761                        column.add(dummyItem);
    768 
    769762                        FrameUtils.Align(column, false, 0);
    770763                        // Check if it will be outside the frame area
     
    787780                                                Drop(moreTitle);
    788781                                        }
    789 
    790782                                        // Add the bullet text to the item
    791783                                        dummyItem.setPosition(DisplayIO.getMouseX(), DisplayIO
     
    810802                                int deltaX = firstItem.getX() - dummyItem.getX();
    811803                                int deltaY = firstItem.getY() - dummyItem.getY();
    812                                
    813                                 for(Item i: Frame.FreeItems) {
    814                                         i.setPosition(i.getX()-deltaX,
    815                                                 i.getY() - deltaY);
     804
     805                                for (Item i : Frame.FreeItems) {
     806                                        i.setPosition(i.getX() - deltaX, i.getY() - deltaY);
    816807                                }
    817808                        } else {
  • trunk/src/org/expeditee/gui/FrameUtils.java

    r10 r19  
    930930                                possibles.add(FrameGraphics.MessageLink);
    931931                        }
     932                        y -= FrameGraphics.getMaxFrameSize().getHeight();
    932933                        // otherwise, the mouse is on the frame
    933934                } else {
Note: See TracChangeset for help on using the changeset viewer.