Changeset 137
- Timestamp:
- 07/14/08 10:05:43 (16 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/Browser.java
r121 r137 80 80 81 81 UserSettings.Init(); 82 82 83 UserSettings.Username = FrameIO.ConvertToValidFramesetName(System 83 84 .getProperty("user.name")); … … 94 95 } 95 96 } 97 96 98 FrameUtils.ParseProfile(profile); 97 99 -
trunk/src/org/expeditee/gui/DisplayIO.java
r128 r137 61 61 * The title to display in the Title bar. 62 62 */ 63 public static final String TITLE = "Exp 02Jul2008A";63 public static final String TITLE = "Exp10Jul2008A"; 64 64 65 65 private DisplayIO() { -
trunk/src/org/expeditee/gui/FrameGraphics.java
r131 r137 34 34 35 35 // the maximum size that can be used to paint on 36 private static Dimension _MaxSize ;36 private static Dimension _MaxSize = new Dimension(1000,1000); 37 37 38 38 // modes -
trunk/src/org/expeditee/gui/FrameMouseActions.java
r133 r137 229 229 // System.out.println("MousePressed " + e.getX() + "," + e.getY() + " " 230 230 // + e.getWhen()); 231 231 232 232 // Auto-hide popups when user clicks into expeditee world 233 233 PopupManager.hideAllPopups(); … … 2420 2420 if (i.hasVector()) { 2421 2421 bReparse = true; 2422 // Frame overlayFrame = FrameIO.LoadFrame(i.getAbsoluteLink()); 2423 // Collection<Item> copies = ItemUtils.CopyItems(overlayFrame 2424 // .getNonAnnotationItems(), i.getVector()); 2425 // FreeItems.getInstance().addAll(copies); 2426 // TODO add the copies to the free items so they are visible 2427 // when the cursor is moving around but are not anchored 2422 2423 Frame overlayFrame = FrameIO.LoadFrame(i.getAbsoluteLink()); 2424 Collection<Item> copies = ItemUtils.CopyItems(overlayFrame 2425 .getNonAnnotationItems(), i.getVector()); 2426 for(Item copy: copies){ 2427 FreeItems.getInstance().add(copy); 2428 copy.setFloating(true); 2429 copy.setParent(null); 2430 } 2428 2431 } 2429 2432 } … … 2508 2511 2509 2512 public static void anchor(Item toAnchor, boolean checkEnclosure) { 2513 //Only anchor items we have full permission over... ie dont anchor vector items 2514 if(!toAnchor.hasPermission(Permission.full)) 2515 return; 2516 2510 2517 toAnchor.anchor(); 2511 2518 -
trunk/src/org/expeditee/gui/MessageBay.java
r130 r137 124 124 125 125 public static void invalidateFullBay() { 126 if(_messageBuffer == null) 127 return; 128 126 129 _dirtyAreas.clear(); 127 130 addDirtyArea(new Rectangle(0, FrameGraphics.getMaxFrameSize().height, -
trunk/src/org/expeditee/items/Item.java
r133 r137 175 175 176 176 dest.setParent(source.getParent()); 177 dest._overlay = source._overlay; 177 178 dest._mode = source._mode;// SelectedMode.None; 178 179 dest._visible = source._visible; … … 1696 1697 public void setHighlightMode(HighlightMode mode, Color color) { 1697 1698 setHighlightColor(color); 1698 if (_mode != mode) { 1699 _mode = mode; 1700 this.invalidateCommonTrait(ItemAppearence.HighlightModeChanged); 1699 if (hasPermission(Permission.followLinks)) { 1700 if (_mode != mode) { 1701 _mode = mode; 1702 this.invalidateCommonTrait(ItemAppearence.HighlightModeChanged); 1703 } 1701 1704 } 1702 1705 } … … 1893 1896 return _actions != null && _actions.size() > 0; 1894 1897 } 1895 1898 1896 1899 public void setAction(String action) { 1897 1900 // Want to resize the highlight box for text items if actions are been … … 1928 1931 boolean hasLink = getLink() != null; 1929 1932 boolean hasAction = hasAction(); 1930 1933 1931 1934 if (hasLink || hasAction) { 1932 1935 g.setStroke(HIGHLIGHT_STROKE); -
trunk/src/org/expeditee/items/Text.java
r131 r137 38 38 public class Text extends Item { 39 39 public static String LINE_SEPARATOR = System.getProperty("line.separator"); 40 public static char[] BULLETS = {'\u2219' , '\u2218', '\u2217'}; 40 41 public static char[] BULLETS = { '\u2219', '\u2218', '\u2217' }; 42 41 43 private static char DEFAULT_BULLET = BULLETS[2]; 44 42 45 private static String DEFAULT_BULLET_STRING = DEFAULT_BULLET + " "; 43 46 44 47 private String[] _processedText = null; 45 48 … … 97 100 98 101 private int _selectionEnd = -1; 99 102 100 103 // text is broken up into lines 101 104 private StringBuffer _text = new StringBuffer(); … … 125 128 setID(id); 126 129 } 127 130 128 131 /** 129 132 * Creates a text item which is not added to the frame. 133 * 130 134 * @param text 131 135 */ … … 190 194 } 191 195 192 193 196 /** 194 197 * Sets the justification of this Text item. The given integer should … … 277 280 */ 278 281 public void removeText(String text) { 279 282 280 283 if (_text.length() > 0 && _text.indexOf(text) == 0) { 281 // invalidateAll();284 // invalidateAll(); 282 285 _text.delete(0, text.length()); 283 286 } 284 285 287 286 288 } … … 289 291 int length = _text.length(); 290 292 if (length > 0) { 291 // invalidateAll();293 // invalidateAll(); 292 294 int pos = _text.indexOf(textToRemove); 293 295 int textToRemoveLength = textToRemove.length(); … … 296 298 } 297 299 } 298 300 299 301 } 300 302 … … 366 368 */ 367 369 private char getNextBullet(char bullet) { 368 for (int i = 0; i < BULLETS.length - 1; i++){369 if (BULLETS[i]== bullet)370 return BULLETS[i +1];370 for (int i = 0; i < BULLETS.length - 1; i++) { 371 if (BULLETS[i] == bullet) 372 return BULLETS[i + 1]; 371 373 } 372 374 return BULLETS[0]; … … 374 376 375 377 private char getPreviousBullet(char bullet) { 376 for (int i = 1; i < BULLETS.length; i++){377 if (BULLETS[i]== bullet)378 for (int i = 1; i < BULLETS.length; i++) { 379 if (BULLETS[i] == bullet) 378 380 return BULLETS[i - 1]; 379 381 } … … 470 472 if (_selectionStart < 0 || _selectionEnd < 0) 471 473 return null; 472 474 473 475 invalidateAll(); 474 476 475 477 if (_selectionEnd > _text.length()) 476 478 _selectionEnd = _text.length(); … … 484 486 _text.insert(left, newText); 485 487 rebuild(true); 486 488 487 489 invalidateAll(); 488 490 … … 520 522 TextLayout current = null; 521 523 int line; 522 524 523 525 invalidateAll(); 524 526 … … 617 619 } 618 620 619 if (_text.length() == 0) {621 if (_text.length() == 0) { 620 622 rebuild(false); 621 623 return new Point2D.Float(this._x, this._y); … … 664 666 x, 665 667 (getX() - Item.MARGIN_RIGHT - (2 * getGravity()) + getBoundsWidth())); 666 668 667 669 invalidateAll(); 668 670 669 671 return new Point2D.Float(Math.round(x), Math.round(getY() + y 670 672 + caret[1])); … … 813 815 // rejustify(); 814 816 rebuild(false); 815 817 816 818 invalidateAll(); 817 819 } … … 1133 1135 private void rebuild(boolean limitWidth) { 1134 1136 // if there is no text, there is nothing to do 1135 if (_text == null || _text.length() == 0) {1136 //Frame parent = getParent();1137 //if(parent != null)1138 //parent.removeItem(this);1137 if (_text == null || _text.length() == 0) { 1138 // Frame parent = getParent(); 1139 // if(parent != null) 1140 // parent.removeItem(this); 1139 1141 return; 1140 1142 } 1141 1143 1142 1144 AttributedString paragraphText = new AttributedString(_text.toString()); 1143 1145 paragraphText.addAttribute(TextAttribute.FONT, getPaintFont()); … … 1188 1190 1189 1191 updatePolygon(); 1190 1192 1191 1193 } 1192 1194 … … 1314 1316 return; 1315 1317 } 1316 1318 1319 // check if its a vector item and paint all the vector stuff too if this 1320 // item is a free item 1321 // This will allow for dragging vectors around the place! 1322 if (hasVector() && isFloating()) { 1323 FrameGraphics.requestRefresh(false); 1324 // TODO make this use a more efficient paint method... 1325 // Have the text item return a bigger repaint area if it has an 1326 // associated vector 1327 } 1328 1317 1329 // the background is only cleared if required 1318 1330 if (getBackgroundColor() != null) { … … 1418 1430 paintLink(g); 1419 1431 } 1420 1432 1421 1433 @Override 1422 1434 protected Rectangle getLinkDrawArea() { // TODO: Revise … … 1493 1505 if (isAnnotation()) 1494 1506 return; 1495 if (!isLineEnd() && _text.length() > 0 && _text.charAt(0) == DEFAULT_BULLET) { 1507 if (!isLineEnd() && _text.length() > 0 1508 && _text.charAt(0) == DEFAULT_BULLET) { 1496 1509 newPoint.setLocation(insertText("" 1497 1510 + (char) KeyEvent.VK_BACK_SPACE, mouseX, mouseY, 1)); … … 1510 1523 newPoint.setLocation(insertText("" 1511 1524 + (char) KeyEvent.VK_BACK_SPACE, mouseX, mouseY, 1)); 1512 newPoint 1513 .setLocation(insertText( DEFAULT_BULLET_STRING,newPoint.x, newPoint.y, 0));1525 newPoint.setLocation(insertText(DEFAULT_BULLET_STRING, 1526 newPoint.x, newPoint.y, 0)); 1514 1527 } else { 1515 1528 newPoint.setLocation(insertText("" … … 1557 1570 _lineBreaker.deleteChar(inserting.getIterator(), pos); 1558 1571 } 1559 1560 1561 1572 1562 1573 } 1563 1574 … … 1727 1738 @Override 1728 1739 protected int getLinkYOffset() { 1729 if (_textLayouts.size() == 0) return 0; 1740 if (_textLayouts.size() == 0) 1741 return 0; 1730 1742 return Math.round(-(_textLayouts.get(0).getAscent() / 2)); 1731 1743 } … … 1748 1760 1749 1761 public static boolean isBulletChar(char c) { 1750 for (int i = 0; i < BULLETS.length; i++){1751 if (BULLETS[i]== c)1762 for (int i = 0; i < BULLETS.length; i++) { 1763 if (BULLETS[i] == c) 1752 1764 return true; 1753 1765 } 1754 return c == '*' || c == '+' || c == '>' || c == '-' || c == 'o';1755 } 1756 1766 return c == '*' || c == '+' || c == '>' || c == '-' || c == 'o'; 1767 } 1768 1757 1769 public boolean hasOverlay() { 1758 if (!isAnnotation() || getLink()==null)1770 if (!isAnnotation() || getLink() == null) 1759 1771 return false; 1760 return ItemUtils.startsWithTag(this, "@ao") ||ItemUtils.startsWithTag(this, "@v"); 1772 return ItemUtils.startsWithTag(this, "@ao") 1773 || ItemUtils.startsWithTag(this, "@v"); 1761 1774 } 1762 1775
Note:
See TracChangeset
for help on using the changeset viewer.