Changeset 602
- Timestamp:
- 12/11/13 11:13:21 (11 years ago)
- Location:
- trunk/src/org/expeditee/gui
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/Frame.java
r579 r602 960 960 if (bReparse) { 961 961 FrameUtils.Parse(this, false, false); 962 FrameGraphics.requestRefresh(false);963 962 } else { 964 963 notifyObservers(bRecalculate); 965 964 } 965 // always request a refresh otherwise filled shapes 966 // that were broken by a deletion and then reconnected by the undo 967 // don't get filled until the user otherwise causes them to redraw 968 FrameGraphics.requestRefresh(false); 966 969 FrameGraphics.Repaint(); 967 970 ItemUtils.EnclosedCheck(_body); -
trunk/src/org/expeditee/gui/FrameGraphics.java
r570 r602 22 22 23 23 import org.expeditee.items.Circle; 24 import org.expeditee.items.Dot; 24 25 import org.expeditee.items.Item; 25 26 import org.expeditee.items.ItemUtils; … … 27 28 import org.expeditee.items.UserAppliedPermission; 28 29 import org.expeditee.items.XRayable; 30 import org.expeditee.items.Item.HighlightMode; 29 31 import org.expeditee.items.widgets.InteractiveWidget; 30 32 import org.expeditee.items.widgets.WidgetEdge; … … 740 742 i = toDisconnect; 741 743 } else { 742 Collection<Item> connected = i.getAllConnected(); 743 for (Item conn : connected) { 744 conn.setHighlightMode(Item.HighlightMode.Connected); 745 } 744 if(FrameMouseActions.isShiftDown()) { 745 for(Item j : i.getAllConnected()) { 746 if(j instanceof Dot && !j.equals(i)) { 747 j.setHighlightMode(HighlightMode.Connected); 748 } 749 } 750 } else { 751 for(Item j : i.getAllConnected()) { 752 if(j instanceof Dot && !j.equals(i)) { 753 j.setHighlightMode(HighlightMode.None); 754 } 755 } 756 l.getStartItem().setHighlightMode(HighlightMode.Connected); 757 l.getEndItem().setHighlightMode(HighlightMode.Connected); 758 } 759 // Collection<Item> connected = i.getAllConnected(); 760 // for (Item conn : connected) { 761 // conn.setHighlightMode(Item.HighlightMode.Connected); 762 // } 746 763 } 747 764 } else if (i instanceof Circle) { … … 749 766 } else if (!i.isVisible()) { 750 767 changeHighlightMode(i, Item.HighlightMode.Connected, null); 751 } else { 768 } else if (i instanceof Dot) { 769 // highlight the dot 770 if (i.hasPermission(UserAppliedPermission.full)) { 771 changeHighlightMode(i, Item.HighlightMode.Normal, Item.HighlightMode.None); 772 } else { 773 changeHighlightMode(i, Item.HighlightMode.Connected, Item.HighlightMode.Connected); 774 } 775 // highlight connected dots, but only if there aren't items being carried on the cursor 776 if(FreeItems.getInstance().size() == 0) { 777 if(FrameMouseActions.isShiftDown()) { 778 for(Item j : i.getAllConnected()) { 779 if(j instanceof Dot && !j.equals(i)) { 780 j.setHighlightMode(HighlightMode.Connected); 781 } 782 } 783 } else { 784 for(Item j : i.getAllConnected()) { 785 if(j instanceof Dot && !j.equals(i)) { 786 j.setHighlightMode(HighlightMode.None); 787 } 788 } 789 for(Line l : i.getLines()) { 790 Item j = l.getOppositeEnd(i); 791 j.setHighlightMode(HighlightMode.Connected); 792 } 793 } 794 } 795 } else { 752 796 // FrameGraphics.ChangeSelectionMode(i, 753 797 // Item.SelectedMode.Normal); -
trunk/src/org/expeditee/gui/FrameMouseActions.java
r599 r602 2421 2421 _offY = getY() - anchored.getY() + anchored.getOffset().y; 2422 2422 } else { 2423 // delete the entire shape attached to the line, unlessshift is pressed2424 if( !isShiftDown()) {2423 // delete the entire shape attached to the line, if shift is pressed 2424 if(isShiftDown()) { 2425 2425 List<Item> tmp = new ArrayList<Item>(FreeItems.getInstance()); 2426 2426 for(Item i : tmp) { … … 2526 2526 Collection<Item> toUndo = null; 2527 2527 if (toDelete.isLineEnd()) { 2528 // delete the entire connected shape unlessshift is down2529 if( !isShiftDown()) {2528 // delete the entire connected shape if shift is down 2529 if(isShiftDown()) { 2530 2530 List<Item> tmp = new ArrayList<Item>(); 2531 2531 tmp.add(toDelete); … … 2542 2542 toUndo = deleteLineEnd(toDelete); 2543 2543 } 2544 // delete the entire connected shape unless we're hovering the end of the line, or shift is down2545 } else if (toDelete instanceof Line 2546 && toDelete.getHighlightMode() == Item.HighlightMode.Disconnect || isShiftDown()) {2544 // delete the entire connected shape if shift is down, unless we're hovering the end of the line 2545 } else if (toDelete instanceof Line && !isShiftDown() || 2546 toDelete.getHighlightMode() == Item.HighlightMode.Disconnect) { 2547 2547 Line line = (Line) toDelete; 2548 2548 Item start = line.getStartItem(); … … 3326 3326 public static void shift(KeyEvent e) { 3327 3327 _shiftDown = e.isShiftDown(); 3328 getInstance().refreshHighlights(); 3328 3329 } 3329 3330 } -
trunk/src/org/expeditee/gui/FrameUtils.java
r601 r602 42 42 import org.expeditee.items.UserAppliedPermission; 43 43 import org.expeditee.items.XRayable; 44 import org.expeditee.items.Item.HighlightMode; 44 45 import org.expeditee.items.widgets.InteractiveWidget; 45 46 import org.expeditee.items.widgets.InteractiveWidgetInitialisationFailedException; … … 1199 1200 List<InteractiveWidget> enclosedWidgets = new LinkedList<InteractiveWidget>(); 1200 1201 for (Item i : enclosed) { 1201 // Dont want to loose the highlighting from the current item 1202 if (i != currentItem && !enclosure.contains(i)) 1203 i.setHighlightMode(Item.HighlightMode.None); 1202 // Don't want to lose the highlighting from the current item 1203 if(i == currentItem || enclosure.contains(i)) { 1204 continue; 1205 } 1206 // Don't want to lose the highlighting of connected Dots 1207 if(i instanceof Dot && i.getHighlightMode() == HighlightMode.Connected) { 1208 for(Line l : i.getLines()) { 1209 if(l.getOppositeEnd(i).getHighlightMode() == HighlightMode.Normal) { 1210 continue; 1211 } 1212 } 1213 } 1204 1214 if (i instanceof WidgetCorner) { 1205 1215 if (!enclosedWidgets.contains(((WidgetCorner) i) … … 1207 1217 enclosedWidgets.add(((WidgetCorner) i).getWidgetSource()); 1208 1218 } 1219 i.setHighlightMode(Item.HighlightMode.None); 1209 1220 } 1210 1221
Note:
See TracChangeset
for help on using the changeset viewer.