Package com.eagerlogic.cubee.client.properties

Source Code of com.eagerlogic.cubee.client.properties.BackgroundProperty

package com.eagerlogic.cubee.client.properties;

import com.eagerlogic.cubee.client.style.styles.ABackground;
import com.eagerlogic.cubee.client.style.styles.Color;
import com.eagerlogic.cubee.client.style.styles.ColorBackground;
import com.eagerlogic.cubee.shared.utils.AValidator;

/**
*
* @author dipacs
*/
public class BackgroundProperty extends Property<ABackground> {

    public BackgroundProperty() {
    }

    public BackgroundProperty(ABackground defaultValue) {
        super(defaultValue);
    }

    public BackgroundProperty(ABackground defaultValue, boolean nullable) {
        super(defaultValue, nullable);
    }

    public BackgroundProperty(ABackground defaultValue, AValidator<ABackground> validator) {
        super(defaultValue, validator);
    }

    public BackgroundProperty(ABackground defaultValue, boolean nullable, boolean readonly) {
        super(defaultValue, nullable, readonly);
    }

    public BackgroundProperty(ABackground defaultValue, boolean nullable, boolean readonly, AValidator<ABackground> validator) {
        super(defaultValue, nullable, readonly, validator);
    }

    @Override
    public ABackground animate(double pos, ABackground startValue, ABackground endValue) {
        if (startValue == null) {
            startValue = new ColorBackground(Color.TRANSPARENT);
        }
        if (endValue == null) {
            endValue = new ColorBackground(Color.TRANSPARENT);
        }

        if ((startValue instanceof ColorBackground) && (endValue instanceof ColorBackground)) {
            return new ColorBackground(Color.fadeColors(((ColorBackground) startValue).getColor(), ((ColorBackground) endValue).getColor(), pos));
        } else {
            // TODO implementálni
            return super.animate(pos, startValue, endValue);
        }
    }

}
TOP

Related Classes of com.eagerlogic.cubee.client.properties.BackgroundProperty

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.