/*
 * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.  Oracle designates this
 * particular file as subject to the "Classpath" exception as provided
 * by Oracle in the LICENSE file that accompanied this code.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */

package javafx.scene.text;

/**
Builder class for javafx.scene.text.Text
@see javafx.scene.text.Text
@deprecated This class is deprecated and will be removed in the next version
* @since JavaFX 2.0
*/
@javax.annotation.Generated("Generated by javafx.builder.processor.BuilderProcessor")
@Deprecated
public class TextBuilder<B extends javafx.scene.text.TextBuilder<B>> extends javafx.scene.shape.ShapeBuilder<B> implements javafx.util.Builder<javafx.scene.text.Text> {
    protected TextBuilder() {
    }

    /** Creates a new instance of TextBuilder. */
    @SuppressWarnings({"deprecation", "rawtypes", "unchecked"})
    public static javafx.scene.text.TextBuilder<?> create() {
        return new javafx.scene.text.TextBuilder();
    }

    private int __set;
    private void __set(int i) {
        __set |= 1 << i;
    }
    public void applyTo(javafx.scene.text.Text x) {
        super.applyTo(x);
        int set = __set;
        while (set != 0) {
            int i = Integer.numberOfTrailingZeros(set);
            set &= ~(1 << i);
            switch (i) {
                case 0: x.setBoundsType(this.boundsType); break;
                case 1: x.setFont(this.font); break;
                case 2: x.setFontSmoothingType(this.fontSmoothingType); break;
                case 3: x.setImpl_caretBias(this.impl_caretBias); break;
                case 4: x.setImpl_caretPosition(this.impl_caretPosition); break;
                case 6: x.setImpl_selectionEnd(this.impl_selectionEnd); break;
                case 8: x.setImpl_selectionStart(this.impl_selectionStart); break;
                case 9: x.setStrikethrough(this.strikethrough); break;
                case 10: x.setText(this.text); break;
                case 11: x.setTextAlignment(this.textAlignment); break;
                case 12: x.setTextOrigin(this.textOrigin); break;
                case 13: x.setUnderline(this.underline); break;
                case 14: x.setWrappingWidth(this.wrappingWidth); break;
                case 15: x.setX(this.x); break;
                case 16: x.setY(this.y); break;
            }
        }
    }

    private javafx.scene.text.TextBoundsType boundsType;
    /**
    Set the value of the {@link javafx.scene.text.Text#getBoundsType() boundsType} property for the instance constructed by this builder.
    */
    @SuppressWarnings("unchecked")
    public B boundsType(javafx.scene.text.TextBoundsType x) {
        this.boundsType = x;
        __set(0);
        return (B) this;
    }

    private javafx.scene.text.Font font;
    /**
    Set the value of the {@link javafx.scene.text.Text#getFont() font} property for the instance constructed by this builder.
    */
    @SuppressWarnings("unchecked")
    public B font(javafx.scene.text.Font x) {
        this.font = x;
        __set(1);
        return (B) this;
    }

    private javafx.scene.text.FontSmoothingType fontSmoothingType;
    /**
    Set the value of the {@link javafx.scene.text.Text#getFontSmoothingType() fontSmoothingType} property for the instance constructed by this builder.
    * @since JavaFX 2.1
    */
    @SuppressWarnings("unchecked")
    public B fontSmoothingType(javafx.scene.text.FontSmoothingType x) {
        this.fontSmoothingType = x;
        __set(2);
        return (B) this;
    }

    private boolean impl_caretBias;
    /**
    Set the value of the {@link javafx.scene.text.Text#isImpl_caretBias() impl_caretBias} property for the instance constructed by this builder.
    @treatAsPrivate
    @deprecated This is an internal API that is not intended for use and will be removed in the next version
    */
    @SuppressWarnings("unchecked") @Deprecated
    public B impl_caretBias(boolean x) {
        this.impl_caretBias = x;
        __set(3);
        return (B) this;
    }

    private int impl_caretPosition;
    /**
    Set the value of the {@link javafx.scene.text.Text#getImpl_caretPosition() impl_caretPosition} property for the instance constructed by this builder.
    @treatAsPrivate
    @deprecated This is an internal API that is not intended for use and will be removed in the next version
    */
    @SuppressWarnings("unchecked") @Deprecated
    public B impl_caretPosition(int x) {
        this.impl_caretPosition = x;
        __set(4);
        return (B) this;
    }

    private int impl_selectionEnd;
    /**
    Set the value of the {@link javafx.scene.text.Text#getImpl_selectionEnd() impl_selectionEnd} property for the instance constructed by this builder.
    @treatAsPrivate
    @deprecated This is an internal API that is not intended for use and will be removed in the next version
    */
    @SuppressWarnings("unchecked") @Deprecated
    public B impl_selectionEnd(int x) {
        this.impl_selectionEnd = x;
        __set(6);
        return (B) this;
    }

    private int impl_selectionStart;
    /**
    Set the value of the {@link javafx.scene.text.Text#getImpl_selectionStart() impl_selectionStart} property for the instance constructed by this builder.
    @treatAsPrivate
    @deprecated This is an internal API that is not intended for use and will be removed in the next version
    */
    @SuppressWarnings("unchecked") @Deprecated
    public B impl_selectionStart(int x) {
        this.impl_selectionStart = x;
        __set(8);
        return (B) this;
    }

    private boolean strikethrough;
    /**
    Set the value of the {@link javafx.scene.text.Text#isStrikethrough() strikethrough} property for the instance constructed by this builder.
    */
    @SuppressWarnings("unchecked")
    public B strikethrough(boolean x) {
        this.strikethrough = x;
        __set(9);
        return (B) this;
    }

    private java.lang.String text;
    /**
    Set the value of the {@link javafx.scene.text.Text#getText() text} property for the instance constructed by this builder.
    */
    @SuppressWarnings("unchecked")
    public B text(java.lang.String x) {
        this.text = x;
        __set(10);
        return (B) this;
    }

    private javafx.scene.text.TextAlignment textAlignment;
    /**
    Set the value of the {@link javafx.scene.text.Text#getTextAlignment() textAlignment} property for the instance constructed by this builder.
    */
    @SuppressWarnings("unchecked")
    public B textAlignment(javafx.scene.text.TextAlignment x) {
        this.textAlignment = x;
        __set(11);
        return (B) this;
    }

    private javafx.geometry.VPos textOrigin;
    /**
    Set the value of the {@link javafx.scene.text.Text#getTextOrigin() textOrigin} property for the instance constructed by this builder.
    */
    @SuppressWarnings("unchecked")
    public B textOrigin(javafx.geometry.VPos x) {
        this.textOrigin = x;
        __set(12);
        return (B) this;
    }

    private boolean underline;
    /**
    Set the value of the {@link javafx.scene.text.Text#isUnderline() underline} property for the instance constructed by this builder.
    */
    @SuppressWarnings("unchecked")
    public B underline(boolean x) {
        this.underline = x;
        __set(13);
        return (B) this;
    }

    private double wrappingWidth;
    /**
    Set the value of the {@link javafx.scene.text.Text#getWrappingWidth() wrappingWidth} property for the instance constructed by this builder.
    */
    @SuppressWarnings("unchecked")
    public B wrappingWidth(double x) {
        this.wrappingWidth = x;
        __set(14);
        return (B) this;
    }

    private double x;
    /**
    Set the value of the {@link javafx.scene.text.Text#getX() x} property for the instance constructed by this builder.
    */
    @SuppressWarnings("unchecked")
    public B x(double x) {
        this.x = x;
        __set(15);
        return (B) this;
    }

    private double y;
    /**
    Set the value of the {@link javafx.scene.text.Text#getY() y} property for the instance constructed by this builder.
    */
    @SuppressWarnings("unchecked")
    public B y(double x) {
        this.y = x;
        __set(16);
        return (B) this;
    }

    /**
    Make an instance of {@link javafx.scene.text.Text} based on the properties set on this builder.
    */
    public javafx.scene.text.Text build() {
        javafx.scene.text.Text x = new javafx.scene.text.Text();
        applyTo(x);
        return x;
    }
}
