Package org.joshy.sketch.actions

Source Code of org.joshy.sketch.actions.TextActions

package org.joshy.sketch.actions;

import org.joshy.sketch.model.SNode;
import org.joshy.sketch.model.SText;
import org.joshy.sketch.modes.vector.VectorDocContext;

/**
* Created by IntelliJ IDEA.
* User: joshmarinacci
* Date: 4/7/11
* Time: 8:29 PM
* To change this template use File | Settings | File Templates.
*/
public class TextActions {
    public static class ResetTextSize extends NodeActions.NodeAction {
        public ResetTextSize(VectorDocContext context) {
            super(context);
        }
        @Override
        public CharSequence getDisplayName() {
            return "Reset Text Size";
        }

        @Override
        public void execute() throws Exception {
            if(context.getSelection().isEmpty()) return;
            SNode first = context.getSelection().firstItem();
            if(first instanceof SText) {
                ((SText)first).setAutoSize(true);
                ((SText)first).refresh();
            }

        }
    }
}
TOP

Related Classes of org.joshy.sketch.actions.TextActions

TOP
Copyright © 2018 www.massapi.com. 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.