Package research.figure

Examples of research.figure.TextAreaFigure


            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


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

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

        UndoActivity activity = (UndoActivity) getUndoActivity();
        int newSize = activity.getFont().getSize() + y - anchorY;
        if (newSize < 1)
            newSize = 1;
        textOwner.setFont(new Font(activity.getFont().getName(), activity.getFont().getStyle(), newSize));
    }
View Full Code Here

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

    public void invokeEnd(int x, int y, int anchorX, int anchorY, DrawingView view) {
        TextAreaFigure textOwner = (TextAreaFigure) 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

     * Factory method for undo activity
     */
    protected Undoable createUndoActivity(DrawingView newView) {

        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.TextAreaFigure

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.