Ignore:
Timestamp:
10/10/08 11:05:28 (16 years ago)
Author:
ra33
Message:

Added Spell Checker
Added word count stats
Fixed some mail stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/items/Text.java

    r348 r362  
    184184                invalidateAll();
    185185                // 0 is the default
    186                 if (width == 0)
     186                if (width <= 0) {
    187187                        width = -1;
     188                        setJustification(Justification.left);
     189                }
    188190
    189191                _maxWidth = width;
     
    219221         */
    220222        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
    221231                _justification = just;
    222232                rebuild(true);
     233                invalidateAll();
    223234        }
    224235
     
    378389         */
    379390        public Point2D.Float insertChar(char ch, float mouseX, float mouseY) {
    380                 if (ch != '\t') /* && ch != '\n'*/
     391                if (ch != '\t') /* && ch != '\n' */
    381392                        return insertText("" + ch, mouseX, mouseY);
    382393
     
    967978
    968979        public void toggleFontStyle() {
     980                invalidateAll();
    969981                Font currentFont = getPaintFont();
    970982                if (currentFont.isPlain())
     
    976988                else
    977989                        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();
    9781020        }
    9791021
     
    17541796        public void resetTitlePosition() {
    17551797                setPosition(MARGIN_LEFT, MARGIN_LEFT + getBoundsHeight());
     1798                setRightMargin(getParentOrCurrentFrame().getNameItem().getX()
     1799                                - MARGIN_LEFT);
    17561800        }
    17571801
Note: See TracChangeset for help on using the changeset viewer.