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.MediaView 030@see javafx.scene.media.MediaView 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 class MediaViewBuilder<B extends javafx.scene.media.MediaViewBuilder<B>> extends javafx.scene.NodeBuilder<B> implements javafx.util.Builder<javafx.scene.media.MediaView> { 036 protected MediaViewBuilder() { 037 } 038 039 /** Creates a new instance of MediaViewBuilder. */ 040 @SuppressWarnings({"deprecation", "rawtypes", "unchecked"}) 041 public static javafx.scene.media.MediaViewBuilder<?> create() { 042 return new javafx.scene.media.MediaViewBuilder(); 043 } 044 045 private int __set; 046 private void __set(int i) { 047 __set |= 1 << i; 048 } 049 public void applyTo(javafx.scene.media.MediaView x) { 050 super.applyTo(x); 051 int set = __set; 052 while (set != 0) { 053 int i = Integer.numberOfTrailingZeros(set); 054 set &= ~(1 << i); 055 switch (i) { 056 case 0: x.setFitHeight(this.fitHeight); break; 057 case 1: x.setFitWidth(this.fitWidth); break; 058 case 2: x.setMediaPlayer(this.mediaPlayer); break; 059 case 3: x.setOnError(this.onError); break; 060 case 4: x.setPreserveRatio(this.preserveRatio); break; 061 case 5: x.setSmooth(this.smooth); break; 062 case 6: x.setViewport(this.viewport); break; 063 case 7: x.setX(this.x); break; 064 case 8: x.setY(this.y); break; 065 } 066 } 067 } 068 069 private double fitHeight; 070 /** 071 Set the value of the {@link javafx.scene.media.MediaView#getFitHeight() fitHeight} property for the instance constructed by this builder. 072 */ 073 @SuppressWarnings("unchecked") 074 public B fitHeight(double x) { 075 this.fitHeight = x; 076 __set(0); 077 return (B) this; 078 } 079 080 private double fitWidth; 081 /** 082 Set the value of the {@link javafx.scene.media.MediaView#getFitWidth() fitWidth} property for the instance constructed by this builder. 083 */ 084 @SuppressWarnings("unchecked") 085 public B fitWidth(double x) { 086 this.fitWidth = x; 087 __set(1); 088 return (B) this; 089 } 090 091 private javafx.scene.media.MediaPlayer mediaPlayer; 092 /** 093 Set the value of the {@link javafx.scene.media.MediaView#getMediaPlayer() mediaPlayer} property for the instance constructed by this builder. 094 */ 095 @SuppressWarnings("unchecked") 096 public B mediaPlayer(javafx.scene.media.MediaPlayer x) { 097 this.mediaPlayer = x; 098 __set(2); 099 return (B) this; 100 } 101 102 private javafx.event.EventHandler<javafx.scene.media.MediaErrorEvent> onError; 103 /** 104 Set the value of the {@link javafx.scene.media.MediaView#getOnError() onError} property for the instance constructed by this builder. 105 */ 106 @SuppressWarnings("unchecked") 107 public B onError(javafx.event.EventHandler<javafx.scene.media.MediaErrorEvent> x) { 108 this.onError = x; 109 __set(3); 110 return (B) this; 111 } 112 113 private boolean preserveRatio; 114 /** 115 Set the value of the {@link javafx.scene.media.MediaView#isPreserveRatio() preserveRatio} property for the instance constructed by this builder. 116 */ 117 @SuppressWarnings("unchecked") 118 public B preserveRatio(boolean x) { 119 this.preserveRatio = x; 120 __set(4); 121 return (B) this; 122 } 123 124 private boolean smooth; 125 /** 126 Set the value of the {@link javafx.scene.media.MediaView#isSmooth() smooth} property for the instance constructed by this builder. 127 */ 128 @SuppressWarnings("unchecked") 129 public B smooth(boolean x) { 130 this.smooth = x; 131 __set(5); 132 return (B) this; 133 } 134 135 private javafx.geometry.Rectangle2D viewport; 136 /** 137 Set the value of the {@link javafx.scene.media.MediaView#getViewport() viewport} property for the instance constructed by this builder. 138 */ 139 @SuppressWarnings("unchecked") 140 public B viewport(javafx.geometry.Rectangle2D x) { 141 this.viewport = x; 142 __set(6); 143 return (B) this; 144 } 145 146 private double x; 147 /** 148 Set the value of the {@link javafx.scene.media.MediaView#getX() x} property for the instance constructed by this builder. 149 */ 150 @SuppressWarnings("unchecked") 151 public B x(double x) { 152 this.x = x; 153 __set(7); 154 return (B) this; 155 } 156 157 private double y; 158 /** 159 Set the value of the {@link javafx.scene.media.MediaView#getY() y} property for the instance constructed by this builder. 160 */ 161 @SuppressWarnings("unchecked") 162 public B y(double x) { 163 this.y = x; 164 __set(8); 165 return (B) this; 166 } 167 168 /** 169 Make an instance of {@link javafx.scene.media.MediaView} based on the properties set on this builder. 170 */ 171 public javafx.scene.media.MediaView build() { 172 javafx.scene.media.MediaView x = new javafx.scene.media.MediaView(); 173 applyTo(x); 174 return x; 175 } 176}