Changeset 58
- Timestamp:
- 05/16/08 11:17:55 (16 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 5 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 -
trunk/src/org/expeditee/gui/DisplayIO.java
r55 r58 61 61 * The title to display in the Title bar. 62 62 */ 63 public static final String TITLE = "Exp1 5May2008A";63 public static final String TITLE = "Exp16May2008A"; 64 64 65 65 private DisplayIO() { -
trunk/src/org/expeditee/gui/FrameMouseActions.java
r50 r58 1312 1312 */ 1313 1313 private static boolean rubberBanding() { 1314 if (Frame.FreeItems.size() <2) {1314 if (Frame.FreeItems.size() != 2) { 1315 1315 return false; 1316 1316 } -
trunk/src/org/expeditee/io/ExpWriter.java
r50 r58 1 1 package org.expeditee.io; 2 2 3 import java.awt.Rectangle; 3 4 import java.io.File; 4 5 import java.io.FileWriter; … … 215 216 _stringWriter.append(toWrite); 216 217 } 217 218 218 219 // writes the given Item out to the file 219 220 // This method is not used to write out LINE items … … 221 222 if (_writer == null) 222 223 return; 224 225 // Dont save the item if it is off the screen 226 if (item.offScreen()) { 227 System.out.println("item offscreen!"); 228 return; 229 } 223 230 224 231 // Pictures are saved as the corresponding text items that created them … … 228 235 item = ((WidgetCorner) item).getWidgetSource().getSource(); 229 236 230 if (item. getLines().size() > 0)237 if (item.isLineEnd()) 231 238 writePoint(item); 232 239 else if (!(item instanceof Line)) -
trunk/src/org/expeditee/items/Item.java
r55 r58 1552 1552 } 1553 1553 } 1554 1555 /** 1556 * Checks if this item is off the left or top of the screen 1557 * @return 1558 */ 1559 public boolean offScreen() { 1560 Rectangle itemRect = getArea().getBounds(); 1561 //Check that the bottom right corner of this item is on the screen 1562 if (itemRect.x + itemRect.width >= 0 && itemRect.y + itemRect.height >= 0) 1563 return false; 1564 //Check if all the items it is connected to are offscreen 1565 for(Item i: getAllConnected()){ 1566 Rectangle iRect = i.getArea().getBounds(); 1567 //Check that the bottom right corner of this item is on the screen 1568 if (iRect.x + iRect.width >= 0 && iRect.y + iRect.height >= 0) { 1569 return false; 1570 } 1571 } 1572 return true; 1573 } 1554 1574 }
Note:
See TracChangeset
for help on using the changeset viewer.