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.media;
027
028/**
029Builder class for javafx.scene.media.MediaPlayer
030@see javafx.scene.media.MediaPlayer
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 final class MediaPlayerBuilder implements javafx.util.Builder<javafx.scene.media.MediaPlayer> {
036    protected MediaPlayerBuilder() {
037    }
038    
039    /** Creates a new instance of MediaPlayerBuilder. */
040    @SuppressWarnings({"deprecation", "rawtypes", "unchecked"})
041    public static javafx.scene.media.MediaPlayerBuilder create() {
042        return new javafx.scene.media.MediaPlayerBuilder();
043    }
044    
045    private int __set;
046    private void __set(int i) {
047        __set |= 1 << i;
048    }
049    public void applyTo(javafx.scene.media.MediaPlayer x) {
050        int set = __set;
051        while (set != 0) {
052            int i = Integer.numberOfTrailingZeros(set);
053            set &= ~(1 << i);
054            switch (i) {
055                case 0: x.setAudioSpectrumInterval(this.audioSpectrumInterval); break;
056                case 1: x.setAudioSpectrumListener(this.audioSpectrumListener); break;
057                case 2: x.setAudioSpectrumNumBands(this.audioSpectrumNumBands); break;
058                case 3: x.setAudioSpectrumThreshold(this.audioSpectrumThreshold); break;
059                case 4: x.setAutoPlay(this.autoPlay); break;
060                case 5: x.setBalance(this.balance); break;
061                case 6: x.setCycleCount(this.cycleCount); break;
062                case 7: x.setMute(this.mute); break;
063                case 8: x.setOnEndOfMedia(this.onEndOfMedia); break;
064                case 9: x.setOnError(this.onError); break;
065                case 10: x.setOnHalted(this.onHalted); break;
066                case 11: x.setOnMarker(this.onMarker); break;
067                case 12: x.setOnPaused(this.onPaused); break;
068                case 13: x.setOnPlaying(this.onPlaying); break;
069                case 14: x.setOnReady(this.onReady); break;
070                case 15: x.setOnRepeat(this.onRepeat); break;
071                case 16: x.setOnStalled(this.onStalled); break;
072                case 17: x.setOnStopped(this.onStopped); break;
073                case 18: x.setRate(this.rate); break;
074                case 19: x.setStartTime(this.startTime); break;
075                case 20: x.setStopTime(this.stopTime); break;
076                case 21: x.setVolume(this.volume); break;
077            }
078        }
079    }
080    
081    private double audioSpectrumInterval;
082    /**
083    Set the value of the {@link javafx.scene.media.MediaPlayer#getAudioSpectrumInterval() audioSpectrumInterval} property for the instance constructed by this builder.
084    */
085    public javafx.scene.media.MediaPlayerBuilder audioSpectrumInterval(double x) {
086        this.audioSpectrumInterval = x;
087        __set(0);
088        return this;
089    }
090    
091    private javafx.scene.media.AudioSpectrumListener audioSpectrumListener;
092    /**
093    Set the value of the {@link javafx.scene.media.MediaPlayer#getAudioSpectrumListener() audioSpectrumListener} property for the instance constructed by this builder.
094    */
095    public javafx.scene.media.MediaPlayerBuilder audioSpectrumListener(javafx.scene.media.AudioSpectrumListener x) {
096        this.audioSpectrumListener = x;
097        __set(1);
098        return this;
099    }
100    
101    private int audioSpectrumNumBands;
102    /**
103    Set the value of the {@link javafx.scene.media.MediaPlayer#getAudioSpectrumNumBands() audioSpectrumNumBands} property for the instance constructed by this builder.
104    */
105    public javafx.scene.media.MediaPlayerBuilder audioSpectrumNumBands(int x) {
106        this.audioSpectrumNumBands = x;
107        __set(2);
108        return this;
109    }
110    
111    private int audioSpectrumThreshold;
112    /**
113    Set the value of the {@link javafx.scene.media.MediaPlayer#getAudioSpectrumThreshold() audioSpectrumThreshold} property for the instance constructed by this builder.
114    */
115    public javafx.scene.media.MediaPlayerBuilder audioSpectrumThreshold(int x) {
116        this.audioSpectrumThreshold = x;
117        __set(3);
118        return this;
119    }
120    
121    private boolean autoPlay;
122    /**
123    Set the value of the {@link javafx.scene.media.MediaPlayer#isAutoPlay() autoPlay} property for the instance constructed by this builder.
124    */
125    public javafx.scene.media.MediaPlayerBuilder autoPlay(boolean x) {
126        this.autoPlay = x;
127        __set(4);
128        return this;
129    }
130    
131    private double balance;
132    /**
133    Set the value of the {@link javafx.scene.media.MediaPlayer#getBalance() balance} property for the instance constructed by this builder.
134    */
135    public javafx.scene.media.MediaPlayerBuilder balance(double x) {
136        this.balance = x;
137        __set(5);
138        return this;
139    }
140    
141    private int cycleCount;
142    /**
143    Set the value of the {@link javafx.scene.media.MediaPlayer#getCycleCount() cycleCount} property for the instance constructed by this builder.
144    */
145    public javafx.scene.media.MediaPlayerBuilder cycleCount(int x) {
146        this.cycleCount = x;
147        __set(6);
148        return this;
149    }
150    
151    private javafx.scene.media.Media media;
152    /**
153    Set the value of the {@link javafx.scene.media.MediaPlayer#getMedia() media} property for the instance constructed by this builder.
154    */
155    public javafx.scene.media.MediaPlayerBuilder media(javafx.scene.media.Media x) {
156        this.media = x;
157        return this;
158    }
159    
160    private boolean mute;
161    /**
162    Set the value of the {@link javafx.scene.media.MediaPlayer#isMute() mute} property for the instance constructed by this builder.
163    */
164    public javafx.scene.media.MediaPlayerBuilder mute(boolean x) {
165        this.mute = x;
166        __set(7);
167        return this;
168    }
169    
170    private java.lang.Runnable onEndOfMedia;
171    /**
172    Set the value of the {@link javafx.scene.media.MediaPlayer#getOnEndOfMedia() onEndOfMedia} property for the instance constructed by this builder.
173    */
174    public javafx.scene.media.MediaPlayerBuilder onEndOfMedia(java.lang.Runnable x) {
175        this.onEndOfMedia = x;
176        __set(8);
177        return this;
178    }
179    
180    private java.lang.Runnable onError;
181    /**
182    Set the value of the {@link javafx.scene.media.MediaPlayer#getOnError() onError} property for the instance constructed by this builder.
183    */
184    public javafx.scene.media.MediaPlayerBuilder onError(java.lang.Runnable x) {
185        this.onError = x;
186        __set(9);
187        return this;
188    }
189    
190    private java.lang.Runnable onHalted;
191    /**
192    Set the value of the {@link javafx.scene.media.MediaPlayer#getOnHalted() onHalted} property for the instance constructed by this builder.
193    */
194    public javafx.scene.media.MediaPlayerBuilder onHalted(java.lang.Runnable x) {
195        this.onHalted = x;
196        __set(10);
197        return this;
198    }
199    
200    private javafx.event.EventHandler<javafx.scene.media.MediaMarkerEvent> onMarker;
201    /**
202    Set the value of the {@link javafx.scene.media.MediaPlayer#getOnMarker() onMarker} property for the instance constructed by this builder.
203    */
204    public javafx.scene.media.MediaPlayerBuilder onMarker(javafx.event.EventHandler<javafx.scene.media.MediaMarkerEvent> x) {
205        this.onMarker = x;
206        __set(11);
207        return this;
208    }
209    
210    private java.lang.Runnable onPaused;
211    /**
212    Set the value of the {@link javafx.scene.media.MediaPlayer#getOnPaused() onPaused} property for the instance constructed by this builder.
213    */
214    public javafx.scene.media.MediaPlayerBuilder onPaused(java.lang.Runnable x) {
215        this.onPaused = x;
216        __set(12);
217        return this;
218    }
219    
220    private java.lang.Runnable onPlaying;
221    /**
222    Set the value of the {@link javafx.scene.media.MediaPlayer#getOnPlaying() onPlaying} property for the instance constructed by this builder.
223    */
224    public javafx.scene.media.MediaPlayerBuilder onPlaying(java.lang.Runnable x) {
225        this.onPlaying = x;
226        __set(13);
227        return this;
228    }
229    
230    private java.lang.Runnable onReady;
231    /**
232    Set the value of the {@link javafx.scene.media.MediaPlayer#getOnReady() onReady} property for the instance constructed by this builder.
233    */
234    public javafx.scene.media.MediaPlayerBuilder onReady(java.lang.Runnable x) {
235        this.onReady = x;
236        __set(14);
237        return this;
238    }
239    
240    private java.lang.Runnable onRepeat;
241    /**
242    Set the value of the {@link javafx.scene.media.MediaPlayer#getOnRepeat() onRepeat} property for the instance constructed by this builder.
243    */
244    public javafx.scene.media.MediaPlayerBuilder onRepeat(java.lang.Runnable x) {
245        this.onRepeat = x;
246        __set(15);
247        return this;
248    }
249    
250    private java.lang.Runnable onStalled;
251    /**
252    Set the value of the {@link javafx.scene.media.MediaPlayer#getOnStalled() onStalled} property for the instance constructed by this builder.
253    */
254    public javafx.scene.media.MediaPlayerBuilder onStalled(java.lang.Runnable x) {
255        this.onStalled = x;
256        __set(16);
257        return this;
258    }
259    
260    private java.lang.Runnable onStopped;
261    /**
262    Set the value of the {@link javafx.scene.media.MediaPlayer#getOnStopped() onStopped} property for the instance constructed by this builder.
263    */
264    public javafx.scene.media.MediaPlayerBuilder onStopped(java.lang.Runnable x) {
265        this.onStopped = x;
266        __set(17);
267        return this;
268    }
269    
270    private double rate;
271    /**
272    Set the value of the {@link javafx.scene.media.MediaPlayer#getRate() rate} property for the instance constructed by this builder.
273    */
274    public javafx.scene.media.MediaPlayerBuilder rate(double x) {
275        this.rate = x;
276        __set(18);
277        return this;
278    }
279    
280    private javafx.util.Duration startTime;
281    /**
282    Set the value of the {@link javafx.scene.media.MediaPlayer#getStartTime() startTime} property for the instance constructed by this builder.
283    */
284    public javafx.scene.media.MediaPlayerBuilder startTime(javafx.util.Duration x) {
285        this.startTime = x;
286        __set(19);
287        return this;
288    }
289    
290    private javafx.util.Duration stopTime;
291    /**
292    Set the value of the {@link javafx.scene.media.MediaPlayer#getStopTime() stopTime} property for the instance constructed by this builder.
293    */
294    public javafx.scene.media.MediaPlayerBuilder stopTime(javafx.util.Duration x) {
295        this.stopTime = x;
296        __set(20);
297        return this;
298    }
299    
300    private double volume;
301    /**
302    Set the value of the {@link javafx.scene.media.MediaPlayer#getVolume() volume} property for the instance constructed by this builder.
303    */
304    public javafx.scene.media.MediaPlayerBuilder volume(double x) {
305        this.volume = x;
306        __set(21);
307        return this;
308    }
309    
310    /**
311    Make an instance of {@link javafx.scene.media.MediaPlayer} based on the properties set on this builder.
312    */
313    public javafx.scene.media.MediaPlayer build() {
314        javafx.scene.media.MediaPlayer x = new javafx.scene.media.MediaPlayer(this.media);
315        applyTo(x);
316        return x;
317    }
318}