Changeset 362 for trunk/src/org/expeditee/items/Text.java
- Timestamp:
- 10/10/08 11:05:28 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/items/Text.java
r348 r362 184 184 invalidateAll(); 185 185 // 0 is the default 186 if (width == 0)186 if (width <= 0) { 187 187 width = -1; 188 setJustification(Justification.left); 189 } 188 190 189 191 _maxWidth = width; … … 219 221 */ 220 222 public void setJustification(Justification just) { 223 invalidateAll(); 224 225 // Only justification left works with 0 width 226 if (just != Justification.left && getWidth() <= 0) { 227 // TODO Tighten this up so it subtracts the margin widths 228 setWidth(getBoundsWidth()); 229 } 230 221 231 _justification = just; 222 232 rebuild(true); 233 invalidateAll(); 223 234 } 224 235 … … 378 389 */ 379 390 public Point2D.Float insertChar(char ch, float mouseX, float mouseY) { 380 if (ch != '\t') /* && ch != '\n' */391 if (ch != '\t') /* && ch != '\n' */ 381 392 return insertText("" + ch, mouseX, mouseY); 382 393 … … 967 978 968 979 public void toggleFontStyle() { 980 invalidateAll(); 969 981 Font currentFont = getPaintFont(); 970 982 if (currentFont.isPlain()) … … 976 988 else 977 989 setFont(currentFont.deriveFont(Font.ITALIC + Font.BOLD)); 990 rebuild(true); 991 invalidateAll(); 992 } 993 994 public void toggleBold() { 995 invalidateAll(); 996 Font currentFont = getPaintFont(); 997 int newStyle = currentFont.getStyle(); 998 if (currentFont.isBold()) { 999 newStyle -= Font.BOLD; 1000 } else { 1001 newStyle += Font.BOLD; 1002 } 1003 setFont(currentFont.deriveFont(newStyle)); 1004 rebuild(true); 1005 invalidateAll(); 1006 } 1007 1008 public void toggleItalics() { 1009 invalidateAll(); 1010 Font currentFont = getPaintFont(); 1011 int newStyle = currentFont.getStyle(); 1012 if (currentFont.isItalic()) { 1013 newStyle -= Font.ITALIC; 1014 } else { 1015 newStyle += Font.ITALIC; 1016 } 1017 setFont(currentFont.deriveFont(newStyle)); 1018 rebuild(true); 1019 invalidateAll(); 978 1020 } 979 1021 … … 1754 1796 public void resetTitlePosition() { 1755 1797 setPosition(MARGIN_LEFT, MARGIN_LEFT + getBoundsHeight()); 1798 setRightMargin(getParentOrCurrentFrame().getNameItem().getX() 1799 - MARGIN_LEFT); 1756 1800 } 1757 1801
Note:
See TracChangeset
for help on using the changeset viewer.