Package com.aquafx_project.controls.skin

Source Code of com.aquafx_project.controls.skin.AquaTextAreaSkin

package com.aquafx_project.controls.skin;

import javafx.scene.control.TextArea;

import com.aquafx_project.controls.skin.effects.FocusBorder;
import com.sun.javafx.scene.control.skin.TextAreaSkin;


public class AquaTextAreaSkin extends TextAreaSkin implements AquaSkin{

    public AquaTextAreaSkin(TextArea textarea) {
        super(textarea);

        if (getSkinnable().isFocused()) {
            setFocusBorder();
        }
       
        registerChangeListener(textarea.focusedProperty(), "FOCUSED");
    }

    private void setFocusBorder() {
        getSkinnable().setEffect(new FocusBorder());
    }

    @Override protected void handleControlPropertyChanged(String p) {
        super.handleControlPropertyChanged(p);

        if (p == "FOCUSED") {
            if (getSkinnable().isFocused()) {
                setFocusBorder();
            } else {
                getSkinnable().setEffect(null);
            }
        }
    }
}
TOP

Related Classes of com.aquafx_project.controls.skin.AquaTextAreaSkin

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.