Changeset 185


Ignore:
Timestamp:
08/04/08 12:42:11 (16 years ago)
Author:
ra33
Message:
 
Location:
trunk/src/org/expeditee
Files:
8 edited

Legend:

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

    r181 r185  
    470470                                }
    471471                        }
    472 
    473472                } catch (ClassNotFoundException cnf) {
    474473                        _Agent = null;
  • trunk/src/org/expeditee/actions/Simple.java

    r181 r185  
    325325        }
    326326
    327         private static void RunFrame(Text current, boolean acceptKeyboardInput,
     327        private static void RunFrame(Frame frame, Text current, boolean acceptKeyboardInput,
    328328                        boolean step, int pause, Color color) {
    329329                try {
     
    336336                        _step = step;
    337337                        _consumeKeyboardInput = acceptKeyboardInput;
    338                         FrameIO.SaveFrame(DisplayIO.getCurrentFrame(), true);
     338                        FrameIO.SaveFrame(frame, true);
    339339
    340340                        // an item without a link signals to run the current frame
     
    342342                                // Make a copy but hide it
    343343                                current = current.copy();
    344                                 current.setLink(DisplayIO.getCurrentFrame().getName());
     344                                current.setLink(frame.getName());
    345345                        }
    346346
     
    354354        }
    355355
    356         public static void RunFrame(Text current, boolean acceptKeyboardInput) {
    357                 RunFrame(current, acceptKeyboardInput, false, 0, null);
    358         }
    359 
    360         public static void RunFrame(Text current) {
    361                 RunFrame(current, false);
     356        public static void RunFrame(Frame frame, Text current, boolean acceptKeyboardInput) {
     357                RunFrame(frame, current, acceptKeyboardInput, false, 0, null);
     358        }
     359
     360        public static void RunFrame(Frame frame, Text current) {
     361                RunFrame(frame, current, false);
    362362        }
    363363
     
    368368         * @param pause
    369369         */
    370         public static void DebugFrame(Text current, float pause, Color color) {
     370        public static void DebugFrame(Frame frame, Text current, float pause, Color color) {
    371371                if (isProgramRunning()) {
    372372                        stop();
    373373                }
    374                 RunFrame(current, false, true, Math.round(pause * 1000), color);
     374                RunFrame(frame, current, false, true, Math.round(pause * 1000), color);
    375375        }
    376376
     
    382382         *            the time to pause between
    383383         */
    384         public static void DebugFrame(Text current, float pause) {
    385                 DebugFrame(current, pause, null);
    386         }
    387 
    388         public static void DebugFrame(Text current) {
    389                 DebugFrame(current, -1.0F, null);
     384        public static void DebugFrame(Frame frame, Text current, float pause) {
     385                DebugFrame(frame, current, pause, null);
     386        }
     387
     388        public static void DebugFrame(Frame frame, Text current) {
     389                DebugFrame(frame, current, -1.0F, null);
    390390        }
    391391
  • trunk/src/org/expeditee/agents/Format.java

    r156 r185  
    4444        @Override
    4545        public Frame process(Frame start) {
     46                //TODO What will happen if user runs the SIMPLE form of this...
     47                //Does format box need to be disabled?!?!
    4648                //Check the position of the cursor and only format stuff inside the same box as the cursor
    4749                Collection<Text> itemsToFormat = FrameUtils.getCurrentTextItems();
    4850                if(itemsToFormat.size() < 1){
    49                         itemsToFormat = start.getBodyTextItems(true);
     51                        itemsToFormat = start.getBodyTextItems(false);
    5052                }
    5153               
  • trunk/src/org/expeditee/agents/Sort.java

    r130 r185  
    33import java.awt.Point;
    44import java.util.ArrayList;
     5import java.util.Collection;
    56import java.util.Collections;
    67import java.util.Comparator;
     
    89import org.expeditee.gui.Frame;
    910import org.expeditee.gui.FrameGraphics;
    10 import org.expeditee.items.Item;
     11import org.expeditee.gui.FrameUtils;
    1112import org.expeditee.items.Text;
    1213
     
    1819         */
    1920        public Frame process(Frame start) {
     21                // Check the position of the cursor and only format stuff inside the
     22                // same box as the cursor
     23                Collection<Text> itemsToSort = FrameUtils.getCurrentTextItems();
     24                if (itemsToSort.size() < 1) {
     25                        itemsToSort = start.getBodyTextItems(false);
     26                }
     27
    2028                ArrayList<Text> textItems = new ArrayList<Text>();
    21 
    22                 for (Item i : start.getItems())
    23                         if (i instanceof Text)
    24                                 // do not sort title and framename
    25                                 if (i.getID() > -1 && i != start.getTitleItem()
    26                                                 && !i.isAnnotation()) {
    27                                         textItems.add((Text) i);
    28                                 }
     29                textItems.addAll(itemsToSort);
    2930
    3031                // copy current positions of items
     
    3738                Collections.sort(textItems, new Comparator<Text>() {
    3839                        public int compare(Text a, Text b) {
    39                                 return String.CASE_INSENSITIVE_ORDER.compare(a.getText(),
    40                                                 b.getText());
     40                                return String.CASE_INSENSITIVE_ORDER.compare(a.getText(), b
     41                                                .getText());
    4142                        }
    4243                });
  • trunk/src/org/expeditee/gui/Frame.java

    r176 r185  
    15531553                                if (t.getText().toLowerCase().startsWith("@start")
    15541554                                                || t.getText().toLowerCase().equals("@start:")) {
    1555                                         t.stripFirstWord();
     1555                                        //Used to allow users the option of putting an initial bullet after the @start
     1556                                        //This was replaced by width
     1557                                        //t.stripFirstWord();
     1558                                        t.setText("");
    15561559
    15571560                                        if (t.getText().equals(""))
  • trunk/src/org/expeditee/gui/FrameMouseActions.java

    r184 r185  
    506506
    507507                // if the user is ranging-out text
    508                 if (lastRanged != null) {
    509                         if (e.getButton() == MouseEvent.BUTTON1) {
    510                                 return;
    511                         }
     508                if (lastRanged != null && e.getButton() != MouseEvent.BUTTON1) {
    512509
    513510                        Text ranged = lastRanged.copy();
  • trunk/src/org/expeditee/items/Item.java

    r184 r185  
    10291029                // action
    10301030                if (sourceFrame == null) {
    1031                         sourceFrame = getParentOrCurrentFrame();
     1031                        //For actions like format they rely on this being set to the current frame incase the item being activated is on an overlay
     1032                        sourceFrame = DisplayIO.getCurrentFrame();
    10321033                }
    10331034
  • trunk/src/org/expeditee/items/Text.java

    r176 r185  
    176176        @Override
    177177        public void setWidth(int width) {
     178                invalidateAll();
    178179                // 0 is the default
    179180                if (width == 0)
     
    182183                _maxWidth = width;
    183184                rebuild(true);
     185                invalidateAll();
    184186        }
    185187
Note: See TracChangeset for help on using the changeset viewer.