Spec-Zone .ru
спецификации, руководства, описания, API
001/* 
002 * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
003 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004 *
005 * This code is free software; you can redistribute it and/or modify it
006 * under the terms of the GNU General Public License version 2 only, as
007 * published by the Free Software Foundation.  Oracle designates this
008 * particular file as subject to the "Classpath" exception as provided
009 * by Oracle in the LICENSE file that accompanied this code.
010 *
011 * This code is distributed in the hope that it will be useful, but WITHOUT
012 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
014 * version 2 for more details (a copy is included in the LICENSE file that
015 * accompanied this code).
016 *
017 * You should have received a copy of the GNU General Public License version
018 * 2 along with this work; if not, write to the Free Software Foundation,
019 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020 *
021 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
022 * or visit www.oracle.com if you need additional information or have any
023 * questions.
024 */
025
026package javafx.scene.shape;
027
028/**
029Builder class for javafx.scene.shape.Shape
030@see javafx.scene.shape.Shape
031@deprecated This class is deprecated and will be removed in the next version
032*/
033@javax.annotation.Generated("Generated by javafx.builder.processor.BuilderProcessor")
034@Deprecated
035public abstract class ShapeBuilder<B extends javafx.scene.shape.ShapeBuilder<B>> extends javafx.scene.NodeBuilder<B> {
036    protected ShapeBuilder() {
037    }
038    
039    
040    private int __set;
041    private void __set(int i) {
042        __set |= 1 << i;
043    }
044    public void applyTo(javafx.scene.shape.Shape x) {
045        super.applyTo(x);
046        int set = __set;
047        while (set != 0) {
048            int i = Integer.numberOfTrailingZeros(set);
049            set &= ~(1 << i);
050            switch (i) {
051                case 0: x.setFill(this.fill); break;
052                case 1: x.setSmooth(this.smooth); break;
053                case 2: x.setStroke(this.stroke); break;
054                case 3: x.getStrokeDashArray().addAll(this.strokeDashArray); break;
055                case 4: x.setStrokeDashOffset(this.strokeDashOffset); break;
056                case 5: x.setStrokeLineCap(this.strokeLineCap); break;
057                case 6: x.setStrokeLineJoin(this.strokeLineJoin); break;
058                case 7: x.setStrokeMiterLimit(this.strokeMiterLimit); break;
059                case 8: x.setStrokeType(this.strokeType); break;
060                case 9: x.setStrokeWidth(this.strokeWidth); break;
061            }
062        }
063    }
064    
065    private javafx.scene.paint.Paint fill;
066    /**
067    Set the value of the {@link javafx.scene.shape.Shape#getFill() fill} property for the instance constructed by this builder.
068    */
069    @SuppressWarnings("unchecked")
070    public B fill(javafx.scene.paint.Paint x) {
071        this.fill = x;
072        __set(0);
073        return (B) this;
074    }
075    
076    private boolean smooth;
077    /**
078    Set the value of the {@link javafx.scene.shape.Shape#isSmooth() smooth} property for the instance constructed by this builder.
079    */
080    @SuppressWarnings("unchecked")
081    public B smooth(boolean x) {
082        this.smooth = x;
083        __set(1);
084        return (B) this;
085    }
086    
087    private javafx.scene.paint.Paint stroke;
088    /**
089    Set the value of the {@link javafx.scene.shape.Shape#getStroke() stroke} property for the instance constructed by this builder.
090    */
091    @SuppressWarnings("unchecked")
092    public B stroke(javafx.scene.paint.Paint x) {
093        this.stroke = x;
094        __set(2);
095        return (B) this;
096    }
097    
098    private java.util.Collection<? extends java.lang.Double> strokeDashArray;
099    /**
100    Add the given items to the List of items in the {@link javafx.scene.shape.Shape#getStrokeDashArray() strokeDashArray} property for the instance constructed by this builder.
101    */
102    @SuppressWarnings("unchecked")
103    public B strokeDashArray(java.util.Collection<? extends java.lang.Double> x) {
104        this.strokeDashArray = x;
105        __set(3);
106        return (B) this;
107    }
108    
109    /**
110    Add the given items to the List of items in the {@link javafx.scene.shape.Shape#getStrokeDashArray() strokeDashArray} property for the instance constructed by this builder.
111    */
112    public B strokeDashArray(java.lang.Double... x) {
113        return strokeDashArray(java.util.Arrays.asList(x));
114    }
115    
116    private double strokeDashOffset;
117    /**
118    Set the value of the {@link javafx.scene.shape.Shape#getStrokeDashOffset() strokeDashOffset} property for the instance constructed by this builder.
119    */
120    @SuppressWarnings("unchecked")
121    public B strokeDashOffset(double x) {
122        this.strokeDashOffset = x;
123        __set(4);
124        return (B) this;
125    }
126    
127    private javafx.scene.shape.StrokeLineCap strokeLineCap;
128    /**
129    Set the value of the {@link javafx.scene.shape.Shape#getStrokeLineCap() strokeLineCap} property for the instance constructed by this builder.
130    */
131    @SuppressWarnings("unchecked")
132    public B strokeLineCap(javafx.scene.shape.StrokeLineCap x) {
133        this.strokeLineCap = x;
134        __set(5);
135        return (B) this;
136    }
137    
138    private javafx.scene.shape.StrokeLineJoin strokeLineJoin;
139    /**
140    Set the value of the {@link javafx.scene.shape.Shape#getStrokeLineJoin() strokeLineJoin} property for the instance constructed by this builder.
141    */
142    @SuppressWarnings("unchecked")
143    public B strokeLineJoin(javafx.scene.shape.StrokeLineJoin x) {
144        this.strokeLineJoin = x;
145        __set(6);
146        return (B) this;
147    }
148    
149    private double strokeMiterLimit;
150    /**
151    Set the value of the {@link javafx.scene.shape.Shape#getStrokeMiterLimit() strokeMiterLimit} property for the instance constructed by this builder.
152    */
153    @SuppressWarnings("unchecked")
154    public B strokeMiterLimit(double x) {
155        this.strokeMiterLimit = x;
156        __set(7);
157        return (B) this;
158    }
159    
160    private javafx.scene.shape.StrokeType strokeType;
161    /**
162    Set the value of the {@link javafx.scene.shape.Shape#getStrokeType() strokeType} property for the instance constructed by this builder.
163    */
164    @SuppressWarnings("unchecked")
165    public B strokeType(javafx.scene.shape.StrokeType x) {
166        this.strokeType = x;
167        __set(8);
168        return (B) this;
169    }
170    
171    private double strokeWidth;
172    /**
173    Set the value of the {@link javafx.scene.shape.Shape#getStrokeWidth() strokeWidth} property for the instance constructed by this builder.
174    */
175    @SuppressWarnings("unchecked")
176    public B strokeWidth(double x) {
177        this.strokeWidth = x;
178        __set(9);
179        return (B) this;
180    }
181    
182}