Changeset 580
- Timestamp:
- 12/06/13 14:08:52 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/FrameMouseActions.java
r570 r580 1009 1009 return; 1010 1010 } 1011 // otherwise if the user is pointing at something,pick it up 1012 } else if (clicked != null) { 1011 // otherwise if the user is pointing at something, pick it up unless shift is down 1012 } else if (clicked != null && !isShiftDown) { 1013 1013 1014 // check permissions 1014 1015 if (!clicked.hasPermission(UserAppliedPermission.full)) { … … 1099 1100 pickup(clicked); 1100 1101 } 1101 // otherwise create a line1102 } else if (clickedIn != null ) {1102 // if we're inside a shape, pick it up unless shift is down 1103 } else if (clickedIn != null && !isShiftDown) { 1103 1104 ArrayList<Item> toPickup = new ArrayList<Item>(clickedIn.size()); 1104 1105 for (Item ip : clickedIn) … … 1424 1425 } 1425 1426 } else { 1426 // if the user is pointing at something , this isa copy1427 if (clicked != null ) {1427 // if the user is pointing at something and shift isn't down, make a copy 1428 if (clicked != null && !isShiftDown()) { 1428 1429 // check permissions 1429 1430 if (clicked.isLineEnd()) { … … 1472 1473 pickup(copies); 1473 1474 } else { 1474 // if user is pointing in a closed shape , copythe items inside1475 if (clickedIn != null ) {1475 // if user is pointing in a closed shape and shift isn't down, make a copy of the items inside 1476 if (clickedIn != null && !isShiftDown()) { 1476 1477 // Set the selection mode for the items that were clicked in 1477 1478 Collection<Item> enclosed = getFullyEnclosedItems(clickedIn); … … 2411 2412 _offY = getY() - anchored.getY() + anchored.getOffset().y; 2412 2413 } else { 2414 // delete the entire shape attached to the line, unless shift is pressed 2415 if(!isShiftDown()) { 2416 List<Item> tmp = new ArrayList<Item>(FreeItems.getInstance()); 2417 for(Item i : tmp) { 2418 // remove entire rectangles instead of just the corner 2419 if(i instanceof Dot) { 2420 FreeItems.getInstance().addAll(i.getAllConnected()); 2421 for(Item j : i.getAllConnected()) { 2422 if(j instanceof Dot) { 2423 FreeItems.getInstance().addAll(j.getLines()); 2424 } 2425 } 2426 } 2427 } 2428 } 2413 2429 deleteItems(FreeItems.getInstance()); 2414 2430 } … … 2417 2433 // the user is not pointing at an item 2418 2434 } else if (toDelete == null) { 2419 2420 // if the user is pointing inside a closed shape, delete all 2421 // items inside it 2422 Collection<Item> items = FrameUtils.getCurrentItems(null); 2423 2435 2436 // if the user is pointing inside a closed shape, delete it 2437 2438 Collection<Item> items = null; 2439 // if shift is down, only delete the enclosing shape (ignore the items inside) 2440 if(isShiftDown()) { 2441 Collection<Item> tmp = FrameUtils.getEnclosingLineEnds(); 2442 if(tmp != null) { 2443 items = new ArrayList<Item>(); 2444 items.addAll(tmp); 2445 for(Item i : tmp) { 2446 if(i instanceof Dot) { 2447 items.addAll(((Dot)i).getLines()); 2448 } 2449 } 2450 } 2451 } else { 2452 items = FrameUtils.getCurrentItems(null); 2453 } 2454 2424 2455 if (items != null) { 2425 2456 Collection<Item> toRemove = new LinkedHashSet<Item>(items … … 2486 2517 Collection<Item> toUndo = null; 2487 2518 if (toDelete.isLineEnd()) { 2488 toUndo = deleteLineEnd(toDelete); 2519 // delete the entire connected shape unless shift is down 2520 if(!isShiftDown()) { 2521 List<Item> tmp = new ArrayList<Item>(); 2522 tmp.add(toDelete); 2523 // remove entire shape instead of just the corner 2524 tmp.addAll(toDelete.getAllConnected()); 2525 for(Item j : toDelete.getAllConnected()) { 2526 if(j instanceof Dot) { 2527 tmp.addAll(j.getLines()); 2528 } 2529 } 2530 deleteItems(tmp); 2531 return; 2532 } else { 2533 toUndo = deleteLineEnd(toDelete); 2534 } 2535 // delete the entire connected shape unless we're hovering the end of the line, or shift is down 2489 2536 } else if (toDelete instanceof Line 2490 && toDelete.getHighlightMode() == Item.HighlightMode.Disconnect ) {2537 && toDelete.getHighlightMode() == Item.HighlightMode.Disconnect || isShiftDown()) { 2491 2538 Line line = (Line) toDelete; 2492 2539 Item start = line.getStartItem();
Note:
See TracChangeset
for help on using the changeset viewer.