Changeset 131
- Timestamp:
- 07/10/08 12:32:54 (16 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/FrameGraphics.java
r130 r131 24 24 import org.expeditee.items.ItemUtils; 25 25 import org.expeditee.items.Line; 26 import org.expeditee.items.Permission; 26 27 import org.expeditee.items.WidgetEdge; 27 28 import org.expeditee.items.XRayable; … … 599 600 int cmp = aArea.compareTo(bArea); 600 601 if (cmp == 0) { 601 return new Integer(a.getID()).compareTo(b.getID()); 602 //System.out.println(a.getEnclosureID() + " " + b.getID()); 603 return new Integer(a.getEnclosureID()).compareTo(b.getEnclosureID()); 602 604 } 603 605 return cmp * -1; … … 662 664 // For polygons need to make sure all other endpoints are 663 665 // unHighlighted 664 changeHighlightMode(i, Item.HighlightMode.Normal, 665 Item.HighlightMode.None); 666 if(i.hasPermission(Permission.full)) 667 changeHighlightMode(i, Item.HighlightMode.Normal, 668 Item.HighlightMode.None); 669 else 670 changeHighlightMode(i, Item.HighlightMode.Connected, 671 Item.HighlightMode.Connected); 666 672 } 667 673 Repaint(); -
trunk/src/org/expeditee/gui/FrameKeyboardActions.java
r130 r131 476 476 return; 477 477 478 String text = ""; 479 480 List<String> lines = ((Text) on).getTextList(); 481 for (String s : lines) 482 text += s + "\n"; 483 // remove the last '\n' 484 text = text.substring(0, text.length() - 1); 485 478 Text text = (Text)on; 479 String string = text.copySelectedText(); 480 481 if(string.length() == 0) 482 string = text.getText(); 483 486 484 // add the text of the item to the clipboard 487 StringSelection selection = new StringSelection( text);485 StringSelection selection = new StringSelection(string); 488 486 Toolkit.getDefaultToolkit().getSystemClipboard().setContents(selection, 489 487 null); … … 589 587 List<Item> clipboard = new ArrayList<Item>(); 590 588 clipboard.add(text); 591 Collection<Item> left =FrameMouseActions.merge(clipboard,589 FrameMouseActions.merge(clipboard, 592 590 clicked); 593 FrameMouseActions.anchor(left);591 text.delete(); 594 592 } else { 595 593 … … 665 663 } 666 664 copyItemToClipboard(current); 665 if(current instanceof Text && ((Text)current).hasSelection()){ 666 ((Text)current).cutSelectedText(); 667 ((Text)current).clearSelection(); 668 }else{ 667 669 FrameMouseActions.delete(current); 670 } 668 671 return; 669 672 } else if (key == KeyEvent.VK_M) { -
trunk/src/org/expeditee/gui/FrameMouseActions.java
r130 r131 387 387 388 388 if (depressTime < MINIMUM_RANGE_DEPRESS_TIME 389 || lastRanged.getSelect edSize() <= 0) {// Text.MINIMUM_RANGED_CHARS)389 || lastRanged.getSelectionSize() <= 0) {// Text.MINIMUM_RANGED_CHARS) 390 390 // { 391 391 lastRanged.clearSelection(); … … 516 516 } 517 517 // if the entire text is selected then pickup the item 518 if (lastRanged.getSelect edSize() == lastRanged.getLength()) {518 if (lastRanged.getSelectionSize() == lastRanged.getLength()) { 519 519 pickup(lastRanged); 520 520 lastRanged.clearSelection(); -
trunk/src/org/expeditee/items/Item.java
r130 r131 760 760 761 761 protected Color getPaintHighlightColor() { 762 Color highlightColor = _highlightColor; 763 if (getPaintBackgroundColor().equals(highlightColor)) 764 highlightColor = ALTERNATE_HIGHLIGHT; 762 765 if (getParent() != null 763 && getParent().getPaintBackgroundColor() 764 .equals(_highlightColor)) 765 return getParent().getPaintForegroundColor(); 766 767 return _highlightColor; 766 && getParent().getPaintBackgroundColor().equals(highlightColor)) 767 highlightColor = getParent().getPaintForegroundColor(); 768 769 return highlightColor; 768 770 } 769 771 … … 1111 1113 1112 1114 public void setActionMark(boolean val) { 1115 if (!val) 1116 invalidateCommonTrait(ItemAppearence.LinkChanged); 1113 1117 _poly = null; 1114 1118 _actionMark = val; 1115 invalidateCommonTrait(ItemAppearence.LinkChanged); 1119 if (val) 1120 invalidateCommonTrait(ItemAppearence.LinkChanged); 1116 1121 } 1117 1122 … … 1891 1896 invalidateCommonTrait(ItemAppearence.LinkChanged); 1892 1897 } 1893 if (_actions == null || _actions.size() == 0) {1898 if (_actions == null || _actions.size() == 0) { 1894 1899 _poly = null; 1895 1900 _actions = new LinkedList<String>(); 1896 } else{1901 } else { 1897 1902 _actions.clear(); 1898 1903 } … … 2079 2084 return box.getWidth() * box.getHeight(); 2080 2085 } 2086 2087 public int getEnclosureID(){ 2088 return _enclosure.hashCode(); 2089 } 2081 2090 2082 2091 /** -
trunk/src/org/expeditee/items/Line.java
r130 r131 21 21 import org.expeditee.gui.Frame; 22 22 23 import sun.misc.Perf.GetPerfAction; 24 23 25 /** 24 26 * Implements a line that is drawn on the screen. A line is represented as two … … 494 496 495 497 public Item getEndPointToDisconnect(int x, int y) { 498 if(!hasPermission(Permission.full)) 499 return null; 500 496 501 Item start = getStartItem(); 497 502 Item end = getEndItem(); -
trunk/src/org/expeditee/items/Text.java
r130 r131 490 490 } 491 491 492 public int getSelect edSize() {492 public int getSelectionSize() { 493 493 if (_selectionEnd < 0 || _selectionStart < 0) 494 494 return 0; … … 1760 1760 return ItemUtils.startsWithTag(this, "@ao") ||ItemUtils.startsWithTag(this, "@v"); 1761 1761 } 1762 1763 public boolean hasSelection() { 1764 return getSelectionSize() > 0; 1765 } 1762 1766 }
Note:
See TracChangeset
for help on using the changeset viewer.