98 /*
99 * Store the singleton instance of the WindowHelper subclass corresponding
100 * to the subclass of this instance of Window
101 */
102 private WindowHelper windowHelper = null;
103
104 static {
105 WindowHelper.setWindowAccessor(
106 new WindowHelper.WindowAccessor() {
107 @Override
108 public WindowHelper getHelper(Window window) {
109 return window.windowHelper;
110 }
111
112 @Override
113 public void setHelper(Window window, WindowHelper windowHelper) {
114 window.windowHelper = windowHelper;
115 }
116
117 @Override
118 public String doGetMXWindowType(Window window) {
119 return window.doGetMXWindowType();
120 }
121
122 @Override
123 public void doVisibleChanging(Window window, boolean visible) {
124 window.doVisibleChanging(visible);
125 }
126
127 @Override
128 public void doVisibleChanged(Window window, boolean visible) {
129 window.doVisibleChanged(visible);
130 }
131
132 @Override
133 public TKStage getPeer(Window window) {
134 return window.getPeer();
135 }
136
137 @Override
138 public void setPeer(Window window, TKStage peer) {
139 window.setPeer(peer);
140 }
141
142 @Override
253 * The peer of this Stage. All external access should be
254 * made though getPeer(). Implementors note: Please ensure that this
255 * variable is defined *after* style and *before* the other variables so
256 * that style has been initialized prior to this call, and so that
257 * peer is initialized prior to subsequent initialization.
258 */
259 private TKStage peer;
260
261 private TKBoundsConfigurator peerBoundsConfigurator =
262 new TKBoundsConfigurator();
263
264 /*
265 * Get Stage's peer
266 */
267 TKStage getPeer() {
268 return peer;
269 }
270
271 void setPeer(TKStage peer) {
272 this.peer = peer;
273 }
274
275 /*
276 * Note: This method MUST only be called via its accessor method.
277 */
278 private String doGetMXWindowType() {
279 return getClass().getSimpleName();
280 }
281
282 /**
283 * Indicates if a user requested the window to be sized to match the scene
284 * size.
285 */
286 private boolean sizeToScene = false;
287 /**
288 * Set the width and height of this Window to match the size of the content
289 * of this Window's Scene.
290 */
291 public void sizeToScene() {
292 if (getScene() != null && peer != null) {
293 SceneHelper.preferredSize(getScene());
294 adjustSize(false);
295 } else {
296 // Remember the request to reapply it later if needed
297 sizeToScene = true;
298 }
299 }
|
98 /*
99 * Store the singleton instance of the WindowHelper subclass corresponding
100 * to the subclass of this instance of Window
101 */
102 private WindowHelper windowHelper = null;
103
104 static {
105 WindowHelper.setWindowAccessor(
106 new WindowHelper.WindowAccessor() {
107 @Override
108 public WindowHelper getHelper(Window window) {
109 return window.windowHelper;
110 }
111
112 @Override
113 public void setHelper(Window window, WindowHelper windowHelper) {
114 window.windowHelper = windowHelper;
115 }
116
117 @Override
118 public void doVisibleChanging(Window window, boolean visible) {
119 window.doVisibleChanging(visible);
120 }
121
122 @Override
123 public void doVisibleChanged(Window window, boolean visible) {
124 window.doVisibleChanged(visible);
125 }
126
127 @Override
128 public TKStage getPeer(Window window) {
129 return window.getPeer();
130 }
131
132 @Override
133 public void setPeer(Window window, TKStage peer) {
134 window.setPeer(peer);
135 }
136
137 @Override
248 * The peer of this Stage. All external access should be
249 * made though getPeer(). Implementors note: Please ensure that this
250 * variable is defined *after* style and *before* the other variables so
251 * that style has been initialized prior to this call, and so that
252 * peer is initialized prior to subsequent initialization.
253 */
254 private TKStage peer;
255
256 private TKBoundsConfigurator peerBoundsConfigurator =
257 new TKBoundsConfigurator();
258
259 /*
260 * Get Stage's peer
261 */
262 TKStage getPeer() {
263 return peer;
264 }
265
266 void setPeer(TKStage peer) {
267 this.peer = peer;
268 }
269
270 /**
271 * Indicates if a user requested the window to be sized to match the scene
272 * size.
273 */
274 private boolean sizeToScene = false;
275 /**
276 * Set the width and height of this Window to match the size of the content
277 * of this Window's Scene.
278 */
279 public void sizeToScene() {
280 if (getScene() != null && peer != null) {
281 SceneHelper.preferredSize(getScene());
282 adjustSize(false);
283 } else {
284 // Remember the request to reapply it later if needed
285 sizeToScene = true;
286 }
287 }
|