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.Media 030@see javafx.scene.media.Media 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 MediaBuilder implements javafx.util.Builder<javafx.scene.media.Media> { 036 protected MediaBuilder() { 037 } 038 039 /** Creates a new instance of MediaBuilder. */ 040 @SuppressWarnings({"deprecation", "rawtypes", "unchecked"}) 041 public static javafx.scene.media.MediaBuilder create() { 042 return new javafx.scene.media.MediaBuilder(); 043 } 044 045 private int __set; 046 public void applyTo(javafx.scene.media.Media x) { 047 int set = __set; 048 if ((set & (1 << 0)) != 0) x.setOnError(this.onError); 049 if ((set & (1 << 1)) != 0) x.getTracks().addAll(this.tracks); 050 } 051 052 private java.lang.Runnable onError; 053 /** 054 Set the value of the {@link javafx.scene.media.Media#getOnError() onError} property for the instance constructed by this builder. 055 */ 056 public javafx.scene.media.MediaBuilder onError(java.lang.Runnable x) { 057 this.onError = x; 058 __set |= 1 << 0; 059 return this; 060 } 061 062 private java.lang.String source; 063 /** 064 Set the value of the {@link javafx.scene.media.Media#getSource() source} property for the instance constructed by this builder. 065 */ 066 public javafx.scene.media.MediaBuilder source(java.lang.String x) { 067 this.source = x; 068 return this; 069 } 070 071 private java.util.Collection<? extends javafx.scene.media.Track> tracks; 072 /** 073 Add the given items to the List of items in the {@link javafx.scene.media.Media#getTracks() tracks} property for the instance constructed by this builder. 074 */ 075 public javafx.scene.media.MediaBuilder tracks(java.util.Collection<? extends javafx.scene.media.Track> x) { 076 this.tracks = x; 077 __set |= 1 << 1; 078 return this; 079 } 080 081 /** 082 Add the given items to the List of items in the {@link javafx.scene.media.Media#getTracks() tracks} property for the instance constructed by this builder. 083 */ 084 public javafx.scene.media.MediaBuilder tracks(javafx.scene.media.Track... x) { 085 return tracks(java.util.Arrays.asList(x)); 086 } 087 088 /** 089 Make an instance of {@link javafx.scene.media.Media} based on the properties set on this builder. 090 */ 091 public javafx.scene.media.Media build() { 092 javafx.scene.media.Media x = new javafx.scene.media.Media(this.source); 093 applyTo(x); 094 return x; 095 } 096}