Package research.figure

Examples of research.figure.TextFigure0


        setUndoActivity(createUndoActivity(view));
        getUndoActivity().setAffectedFigures(new SingleFigureEnumerator(owner()));
    }

    public void invokeStep(InputEvent inputEvent, int x, int y, int anchorX, int anchorY, DrawingView view) {
        TextFigure0 textOwner = (TextFigure0) owner();

        UndoActivity activity = (UndoActivity) getUndoActivity();

        double scale = view.getScale();
        double realDeltaY = (y - anchorY) / scale;
        int visualDeltaY = (int) realDeltaY;
        System.out.println("visualDeltaY = " + visualDeltaY);

        int newSize = activity.getFont().getSize() + visualDeltaY;
        if (newSize < 1)
            newSize = 1;

        textOwner.setFont(new Font(activity.getFont().getName(), activity.getFont().getStyle(), newSize));
    }
View Full Code Here


        textOwner.setFont(new Font(activity.getFont().getName(), activity.getFont().getStyle(), newSize));
    }

    public void invokeEnd(int x, int y, int anchorX, int anchorY, DrawingView view) {
        TextFigure0 textOwner = (TextFigure0) owner();
        UndoActivity activity = (UndoActivity) getUndoActivity();
        // there has been no change so there is nothing to undo
        if (textOwner.getFont().getSize() == activity.getOldFontSize()) {
            setUndoActivity(null);
        } else {
            activity.setFont(textOwner.getFont());
        }
    }
View Full Code Here

            TextFigure textOwner = (TextFigure) owner();
            return new UndoActivity(newView, textOwner.getFont());
        }

        if (owner() instanceof TextFigure0) {
            TextFigure0 textOwner = (TextFigure0) owner();
            return new UndoActivity(newView, textOwner.getFont());
        }

        if (owner() instanceof TextAreaFigure) {
            TextAreaFigure textOwner = (TextAreaFigure) owner();
            return new UndoActivity(newView, textOwner.getFont());
        }

        return null;
    }
View Full Code Here

TOP

Related Classes of research.figure.TextFigure0

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.