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.stage; 027 028/** 029Builder class for javafx.stage.Stage 030@see javafx.stage.Stage 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 StageBuilder<B extends javafx.stage.StageBuilder<B>> extends javafx.stage.WindowBuilder<B> implements javafx.util.Builder<javafx.stage.Stage> { 036 protected StageBuilder() { 037 } 038 039 /** Creates a new instance of StageBuilder. */ 040 @SuppressWarnings({"deprecation", "rawtypes", "unchecked"}) 041 public static javafx.stage.StageBuilder<?> create() { 042 return new javafx.stage.StageBuilder(); 043 } 044 045 private int __set; 046 private void __set(int i) { 047 __set |= 1 << i; 048 } 049 public void applyTo(javafx.stage.Stage 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.setFullScreen(this.fullScreen); break; 057 case 1: x.setIconified(this.iconified); break; 058 case 2: x.getIcons().addAll(this.icons); break; 059 case 3: x.setMaxHeight(this.maxHeight); break; 060 case 4: x.setMaxWidth(this.maxWidth); break; 061 case 5: x.setMinHeight(this.minHeight); break; 062 case 6: x.setMinWidth(this.minWidth); break; 063 case 7: x.setResizable(this.resizable); break; 064 case 8: x.setScene(this.scene); break; 065 case 9: x.setTitle(this.title); break; 066 } 067 } 068 } 069 070 private boolean fullScreen; 071 /** 072 Set the value of the {@link javafx.stage.Stage#isFullScreen() fullScreen} property for the instance constructed by this builder. 073 */ 074 @SuppressWarnings("unchecked") 075 public B fullScreen(boolean x) { 076 this.fullScreen = x; 077 __set(0); 078 return (B) this; 079 } 080 081 private boolean iconified; 082 /** 083 Set the value of the {@link javafx.stage.Stage#isIconified() iconified} property for the instance constructed by this builder. 084 */ 085 @SuppressWarnings("unchecked") 086 public B iconified(boolean x) { 087 this.iconified = x; 088 __set(1); 089 return (B) this; 090 } 091 092 private java.util.Collection<? extends javafx.scene.image.Image> icons; 093 /** 094 Add the given items to the List of items in the {@link javafx.stage.Stage#getIcons() icons} property for the instance constructed by this builder. 095 */ 096 @SuppressWarnings("unchecked") 097 public B icons(java.util.Collection<? extends javafx.scene.image.Image> x) { 098 this.icons = x; 099 __set(2); 100 return (B) this; 101 } 102 103 /** 104 Add the given items to the List of items in the {@link javafx.stage.Stage#getIcons() icons} property for the instance constructed by this builder. 105 */ 106 public B icons(javafx.scene.image.Image... x) { 107 return icons(java.util.Arrays.asList(x)); 108 } 109 110 private double maxHeight; 111 /** 112 Set the value of the {@link javafx.stage.Stage#getMaxHeight() maxHeight} property for the instance constructed by this builder. 113 */ 114 @SuppressWarnings("unchecked") 115 public B maxHeight(double x) { 116 this.maxHeight = x; 117 __set(3); 118 return (B) this; 119 } 120 121 private double maxWidth; 122 /** 123 Set the value of the {@link javafx.stage.Stage#getMaxWidth() maxWidth} property for the instance constructed by this builder. 124 */ 125 @SuppressWarnings("unchecked") 126 public B maxWidth(double x) { 127 this.maxWidth = x; 128 __set(4); 129 return (B) this; 130 } 131 132 private double minHeight; 133 /** 134 Set the value of the {@link javafx.stage.Stage#getMinHeight() minHeight} property for the instance constructed by this builder. 135 */ 136 @SuppressWarnings("unchecked") 137 public B minHeight(double x) { 138 this.minHeight = x; 139 __set(5); 140 return (B) this; 141 } 142 143 private double minWidth; 144 /** 145 Set the value of the {@link javafx.stage.Stage#getMinWidth() minWidth} property for the instance constructed by this builder. 146 */ 147 @SuppressWarnings("unchecked") 148 public B minWidth(double x) { 149 this.minWidth = x; 150 __set(6); 151 return (B) this; 152 } 153 154 private boolean resizable; 155 /** 156 Set the value of the {@link javafx.stage.Stage#isResizable() resizable} property for the instance constructed by this builder. 157 */ 158 @SuppressWarnings("unchecked") 159 public B resizable(boolean x) { 160 this.resizable = x; 161 __set(7); 162 return (B) this; 163 } 164 165 private javafx.scene.Scene scene; 166 /** 167 Set the value of the {@link javafx.stage.Stage#getScene() scene} property for the instance constructed by this builder. 168 */ 169 @SuppressWarnings("unchecked") 170 public B scene(javafx.scene.Scene x) { 171 this.scene = x; 172 __set(8); 173 return (B) this; 174 } 175 176 private javafx.stage.StageStyle style = javafx.stage.StageStyle.DECORATED; 177 /** 178 Set the value of the {@link javafx.stage.Stage#getStyle() style} property for the instance constructed by this builder. 179 */ 180 @SuppressWarnings("unchecked") 181 public B style(javafx.stage.StageStyle x) { 182 this.style = x; 183 return (B) this; 184 } 185 186 private java.lang.String title; 187 /** 188 Set the value of the {@link javafx.stage.Stage#getTitle() title} property for the instance constructed by this builder. 189 */ 190 @SuppressWarnings("unchecked") 191 public B title(java.lang.String x) { 192 this.title = x; 193 __set(9); 194 return (B) this; 195 } 196 197 /** 198 Make an instance of {@link javafx.stage.Stage} based on the properties set on this builder. 199 */ 200 public javafx.stage.Stage build() { 201 javafx.stage.Stage x = new javafx.stage.Stage(this.style); 202 applyTo(x); 203 return x; 204 } 205}