Ignore:
Timestamp:
07/25/08 09:24:45 (16 years ago)
Author:
ra33
Message:

Added calculate action

Location:
trunk/src/org/expeditee/agents
Files:
5 edited

Legend:

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

    r154 r156  
    55import org.expeditee.gui.AttributeUtils;
    66import org.expeditee.gui.Frame;
    7 import org.expeditee.gui.FrameGraphics;
    87import org.expeditee.gui.FrameIO;
    98import org.expeditee.items.Item;
  • trunk/src/org/expeditee/agents/DisplayTree.java

    r154 r156  
    33import org.expeditee.gui.DisplayIO;
    44import org.expeditee.gui.Frame;
    5 import org.expeditee.gui.FrameUtils;
    65import org.expeditee.gui.MessageBay;
    76import org.expeditee.items.Item;
  • trunk/src/org/expeditee/agents/Format.java

    r154 r156  
    5252                ArrayList<Item> columnHeads = new ArrayList<Item>();
    5353
    54                 ArrayList<ArrayList<Item>> columns = new ArrayList<ArrayList<Item>>();
     54                ArrayList<ArrayList<Text>> columns = new ArrayList<ArrayList<Text>>();
    5555
    56                 for (Item t : itemsToFormat) {
     56                for (Text t : itemsToFormat) {
    5757                        int col = findColumn(columnHeads, t);
    5858                        // if this is the head of a new column
    5959                        if (col < 0) {
    6060                                columnHeads.add(t);
    61                                 columns.add(new ArrayList<Item>());
     61                                columns.add(new ArrayList<Text>());
    6262                                // otherwise the column for this item has already been
    6363                                // found set the column to be the one we just added...
     
    9292
    9393                // sort lists by their X axis
    94                 Collections.sort(columns, new Comparator<ArrayList<Item>>() {
    95                         public int compare(ArrayList<Item> o1, ArrayList<Item> o2) {
     94                Collections.sort(columns, new Comparator<ArrayList<Text>>() {
     95                        public int compare(ArrayList<Text> o1, ArrayList<Text> o2) {
    9696                                if (o2.size() == 0)
    9797                                        return -10;
     
    112112
    113113                for (int i = 0; i < columns.size() - 1; i++) {
    114                         List<Item> list = columns.get(i);
     114                        List<Text> list = columns.get(i);
    115115
    116116                        int maxX = 0;
  • trunk/src/org/expeditee/agents/SearchAgent.java

    r143 r156  
    55import org.expeditee.gui.FrameGraphics;
    66import org.expeditee.gui.FrameIO;
    7 import org.expeditee.gui.FreeItems;
    8 import org.expeditee.gui.MessageBay;
    97import org.expeditee.io.Conversion;
    108import org.expeditee.items.Item;
     
    2321        @Override
    2422        public boolean initialise(Frame frame, Item item) {
    25                 if (FreeItems.getInstance().size() != 1) {
    26                         MessageBay
    27                                         .displayMessage("Attach search pattern to the end of the cursor");
    28                         return false;
    29                 }
    30                 Item cursorItem = Frame.getItemAttachedToCursor();
    31                 if (!(cursorItem instanceof Text))
    32                         return false;
    33 
    34                 String pattern = ((Text) cursorItem).getText();
     23                String pattern = item.getText();
    3524                String resultFrameset = null;
     25               
     26                //TODO use a results frame specified on the profile frame
    3627                if (item.getLink() == null) {
    3728                        resultFrameset = frame.getFramesetName();
     
    4031                                        false);
    4132                }
    42                 return initialise(frame.getFramesetName(), resultFrameset, null, pattern);
     33                return initialise(frame, item, frame.getFramesetName(), resultFrameset, null, pattern);
    4334        }
    4435
    45         public boolean initialise(String startName, String resultsFrameset,
     36        public boolean initialise(Frame frame, Item item, String startName, String resultsFrameset,
    4637                        String replacementString, String pattern) {
    4738                _pattern = pattern;
     
    5748                _end = _results.getFirstFrame();
    5849               
    59                 return super.initialise(null, null);
     50                return super.initialise(frame, item);
    6051        }
    6152       
     
    8677                if (frameToSearch == null)
    8778                        return false;
    88                 for (Text itemToSearch : frameToSearch.getVisibleTextItems()) {
     79                for (Text itemToSearch : frameToSearch.getTextItems()) {
    8980                        // Search for the item and add it to the results page if
    9081                        // it is found
  • trunk/src/org/expeditee/agents/SearchTree.java

    r134 r156  
    4242                overwriteMessage("Searching " + frameName);
    4343
    44                 for (Text itemToSearch : frameToSearch.getVisibleTextItems()) {
     44                for (Text itemToSearch : frameToSearch.getTextItems()) {
    4545                        // Search for the item and add it to the results page if
    4646                        // it is found
Note: See TracChangeset for help on using the changeset viewer.