Changeset 58 for trunk/src/org/expeditee/agents/Format.java
- Timestamp:
- 05/16/08 11:17:55 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/agents/Format.java
r48 r58 10 10 import org.expeditee.gui.FrameUtils; 11 11 import org.expeditee.items.Item; 12 import org.expeditee.items.Text; 12 13 13 14 /** … … 38 39 e.printStackTrace(); 39 40 } 40 41 41 } 42 42 … … 46 46 47 47 ArrayList<ArrayList<Item>> columns = new ArrayList<ArrayList<Item>>(); 48 for (int j = 0; j < start.getItems().size(); j++) {49 Item i = start.getItems().get(j);50 48 51 if (j > 0 && start.isNormalTextItem(i)) { 52 int col = findColumn(columnHeads, i); 53 // if this is the head of a new column 54 if (col < 0) { 55 columnHeads.add(i); 56 columns.add(new ArrayList<Item>()); 57 // otherwise the column for this item has already been 58 // found set the column to be the one we just added... 59 col = columns.size() - 1; 60 } else 61 columns.get(col).add(i); 62 } 49 for (Text t : start.getBodyTextItems(true)) { 50 int col = findColumn(columnHeads, t); 51 // if this is the head of a new column 52 if (col < 0) { 53 columnHeads.add(t); 54 columns.add(new ArrayList<Item>()); 55 // otherwise the column for this item has already been 56 // found set the column to be the one we just added... 57 col = columns.size() - 1; 58 } else 59 columns.get(col).add(t); 63 60 } 64 61 … … 165 162 @Override 166 163 protected void finalise(Frame start) { 167 if(_success) overwriteMessage("Formating complete."); 164 if (_success) 165 overwriteMessage("Formating complete."); 168 166 } 169 167
Note:
See TracChangeset
for help on using the changeset viewer.