Changeset 156 for trunk/src/org/expeditee/agents
- Timestamp:
- 07/25/08 09:24:45 (16 years ago)
- Location:
- trunk/src/org/expeditee/agents
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/agents/ComputeTree.java
r154 r156 5 5 import org.expeditee.gui.AttributeUtils; 6 6 import org.expeditee.gui.Frame; 7 import org.expeditee.gui.FrameGraphics;8 7 import org.expeditee.gui.FrameIO; 9 8 import org.expeditee.items.Item; -
trunk/src/org/expeditee/agents/DisplayTree.java
r154 r156 3 3 import org.expeditee.gui.DisplayIO; 4 4 import org.expeditee.gui.Frame; 5 import org.expeditee.gui.FrameUtils;6 5 import org.expeditee.gui.MessageBay; 7 6 import org.expeditee.items.Item; -
trunk/src/org/expeditee/agents/Format.java
r154 r156 52 52 ArrayList<Item> columnHeads = new ArrayList<Item>(); 53 53 54 ArrayList<ArrayList< Item>> columns = new ArrayList<ArrayList<Item>>();54 ArrayList<ArrayList<Text>> columns = new ArrayList<ArrayList<Text>>(); 55 55 56 for ( Itemt : itemsToFormat) {56 for (Text t : itemsToFormat) { 57 57 int col = findColumn(columnHeads, t); 58 58 // if this is the head of a new column 59 59 if (col < 0) { 60 60 columnHeads.add(t); 61 columns.add(new ArrayList< Item>());61 columns.add(new ArrayList<Text>()); 62 62 // otherwise the column for this item has already been 63 63 // found set the column to be the one we just added... … … 92 92 93 93 // 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) { 96 96 if (o2.size() == 0) 97 97 return -10; … … 112 112 113 113 for (int i = 0; i < columns.size() - 1; i++) { 114 List< Item> list = columns.get(i);114 List<Text> list = columns.get(i); 115 115 116 116 int maxX = 0; -
trunk/src/org/expeditee/agents/SearchAgent.java
r143 r156 5 5 import org.expeditee.gui.FrameGraphics; 6 6 import org.expeditee.gui.FrameIO; 7 import org.expeditee.gui.FreeItems;8 import org.expeditee.gui.MessageBay;9 7 import org.expeditee.io.Conversion; 10 8 import org.expeditee.items.Item; … … 23 21 @Override 24 22 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(); 35 24 String resultFrameset = null; 25 26 //TODO use a results frame specified on the profile frame 36 27 if (item.getLink() == null) { 37 28 resultFrameset = frame.getFramesetName(); … … 40 31 false); 41 32 } 42 return initialise(frame .getFramesetName(), resultFrameset, null, pattern);33 return initialise(frame, item, frame.getFramesetName(), resultFrameset, null, pattern); 43 34 } 44 35 45 public boolean initialise( String startName, String resultsFrameset,36 public boolean initialise(Frame frame, Item item, String startName, String resultsFrameset, 46 37 String replacementString, String pattern) { 47 38 _pattern = pattern; … … 57 48 _end = _results.getFirstFrame(); 58 49 59 return super.initialise( null, null);50 return super.initialise(frame, item); 60 51 } 61 52 … … 86 77 if (frameToSearch == null) 87 78 return false; 88 for (Text itemToSearch : frameToSearch.get VisibleTextItems()) {79 for (Text itemToSearch : frameToSearch.getTextItems()) { 89 80 // Search for the item and add it to the results page if 90 81 // it is found -
trunk/src/org/expeditee/agents/SearchTree.java
r134 r156 42 42 overwriteMessage("Searching " + frameName); 43 43 44 for (Text itemToSearch : frameToSearch.get VisibleTextItems()) {44 for (Text itemToSearch : frameToSearch.getTextItems()) { 45 45 // Search for the item and add it to the results page if 46 46 // it is found
Note:
See TracChangeset
for help on using the changeset viewer.