Changeset 70 for trunk/src/org/expeditee/items/Item.java
- Timestamp:
- 05/21/08 09:40:52 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/items/Item.java
r67 r70 162 162 163 163 dest.setParent(source.getParent()); 164 // Add the copied item to the frame 165 if (source.getParent() != null) { 166 dest.setID(source.getParent().getNextItemID()); 167 } else { 168 dest.setID(source.getID()); 169 } 164 dest.setID(source.getParentOrCurrentFrame().getNextItemID()); 170 165 } 171 166 … … 906 901 * @param merger 907 902 * The Item to merge with 908 * @param mouseX909 * The X coordinate of the mouse when performing this merge910 * operation911 * @param mouseY912 * The Y coordinate of the mouse when performing this merge913 * operation914 903 * @return any Item that should remain on the cursor 915 904 */ … … 1285 1274 // frame 1286 1275 if (!other.isFloating()) { 1287 if (c.getType() == Constraint.HORIZONTAL 1288 && other.getY() != getY()) 1289 other.setY(getY()); 1290 1291 if (c.getType() == Constraint.VERTICAL 1292 && other.getX() != getX()) 1293 other.setX(getX()); 1276 if (c.getType() == Constraint.HORIZONTAL) { 1277 if (other.getY() != y) 1278 other.setY(y); 1279 } 1280 if (c.getType() == Constraint.VERTICAL) { 1281 if (other.getX() != x) 1282 other.setX(x); 1283 } 1294 1284 } 1295 1285 } … … 1429 1419 return _visible; 1430 1420 } 1431 1432 /** 1433 * Raised whenever the item is removed, added, no longer in view (That is, when it is 1434 * not on any of the current frames, of overlays of the current frames) or 1435 * has become visible. That is, when it is either on a current frames, or an overlay of a current frame. 1436 * @param e The event 1437 */ 1438 public void onParentStateChanged(ItemParentStateChangedEvent e) {} 1439 1421 1422 /** 1423 * Raised whenever the item is removed, added, no longer in view (That is, 1424 * when it is not on any of the current frames, of overlays of the current 1425 * frames) or has become visible. That is, when it is either on a current 1426 * frames, or an overlay of a current frame. 1427 * 1428 * @param e 1429 * The event 1430 */ 1431 public void onParentStateChanged(ItemParentStateChangedEvent e) { 1432 } 1433 1440 1434 public void setSelectedMode(SelectedMode mode, Color color) { 1441 1435 setSelectionColor(color); … … 1552 1546 } 1553 1547 } 1554 1548 1555 1549 /** 1556 1550 * Checks if this item is off the left or top of the screen 1551 * 1557 1552 * @return 1558 1553 */ 1559 1554 public boolean offScreen() { 1560 1555 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) 1556 // Check that the bottom right corner of this item is on the screen 1557 if (itemRect.x + itemRect.width >= 0 1558 && itemRect.y + itemRect.height >= 0) 1563 1559 return false; 1564 // Check if all the items it is connected to are offscreen1565 for (Item i: getAllConnected()){1560 // Check if all the items it is connected to are offscreen 1561 for (Item i : getAllConnected()) { 1566 1562 Rectangle iRect = i.getArea().getBounds(); 1567 // Check that the bottom right corner of this item is on the screen1563 // Check that the bottom right corner of this item is on the screen 1568 1564 if (iRect.x + iRect.width >= 0 && iRect.y + iRect.height >= 0) { 1569 1565 return false;
Note:
See TracChangeset
for help on using the changeset viewer.