-
Notifications
You must be signed in to change notification settings - Fork 68
/
Scene.scala
executable file
·747 lines (661 loc) · 24.5 KB
/
Scene.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
/*
* Copyright (c) 2011-2015, ScalaFX Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the ScalaFX Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE SCALAFX PROJECT OR ITS CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package scalafx.scene
import javafx.scene.{input => jfxsi, layout => jfxsl, paint => jfxsp}
import javafx.{collections => jfxc, event => jfxe, geometry => jfxg, scene => jfxs, util => jfxu}
import scala.language.implicitConversions
import scalafx.Includes._
import scalafx.beans.property.{ObjectProperty, ReadOnlyDoubleProperty, ReadOnlyObjectProperty}
import scalafx.collections._
import scalafx.delegate.SFXDelegate
import scalafx.geometry.NodeOrientation
import scalafx.scene.image.WritableImage
import scalafx.scene.input.{Dragboard, Mnemonic, TransferMode}
import scalafx.scene.paint.Paint
object Scene {
implicit def sfxScene2jfx(v: Scene): jfxs.Scene = if (v != null) v.delegate else null
}
/**
* Wraps [[http://docs.oracle.com/javase/8/javafx/api/javafx/scene/Scene.html]].
*
* @constructor Create a new ScalaFX Scene with JavaFX Scene as delegate.
* @param delegate JavaFX Scene delegated. Its default value is a JavaFX Scene with a
* [[http://docs.oracle.com/javase/8/javafx/api/javafx/scene/Group.html Group]] as root Node.
*/
class Scene(override val delegate: jfxs.Scene = new jfxs.Scene(new jfxs.Group()))
extends SFXDelegate[jfxs.Scene] {
/**
* Creates a Scene with a [[http://docs.oracle.com/javase/8/javafx/api/javafx/scene/Group.html Group]] as root Node with a
* specific size.
*
* @param width The width of the scene
* @param height The height of the scene
*/
def this(width: Double, height: Double) = this(new jfxs.Scene(new jfxs.Group(), width, height))
/**
* Creates a Scene for a specific root Node.
*
* @param parent The root node of the scene graph
*/
def this(parent: Parent) = this(new jfxs.Scene(parent))
/**
* Creates a Scene for a specific root Node with a specific size.
*
* @param parent The root node of the scene graph
* @param width The width of the scene
* @param height The height of the scene
*/
def this(parent: Parent, width: Double, height: Double) = this(new jfxs.Scene(parent, width, height))
/**
* Constructs a scene consisting of a root, with a dimension of width and height,
* and specifies whether a depth buffer is created for this scene.
*
* @param parent The root node of the scene graph
* @param width The width of the scene
* @param height The height of the scene
* @param depthBuffer The depth buffer flag
*/
def this(parent: Parent, width: Double, height: Double, depthBuffer: Boolean) =
this(new jfxs.Scene(parent, width, height, depthBuffer))
/**
* Creates a Scene with a `Group` as parent, with a dimension of width and height,
* and specifies whether a depth buffer is created for this scene.
*
* @param width The width of the scene
* @param height The height of the scene
* @param depthBuffer The depth buffer flag
*/
def this(width: Double, height: Double, depthBuffer: Boolean) =
this(new jfxs.Scene(new jfxs.Group(), width, height, depthBuffer))
/**
* Constructs a scene consisting of a root, with a dimension of width and height,
* specifies whether a depth buffer is created for this scene and specifies
* the required scene anti-aliasing.
*
* @param parent The root node of the scene graph
* @param width The width of the scene
* @param height The height of the scene
* @param depthBuffer The depth buffer flag
* @param antiAliasing The required scene anti-aliasing.
*/
def this(parent: Parent, width: Double, height: Double, depthBuffer: Boolean, antiAliasing: SceneAntialiasing) =
this(new jfxs.Scene(parent, width, height, depthBuffer, antiAliasing))
/**
* Creates a Scene with a `Group` as parent, with a dimension of width and height,
* specifies whether a depth buffer is created for this scene and specifies
* the required scene anti-aliasing.
*
* @param width The width of the scene
* @param height The height of the scene
* @param depthBuffer The depth buffer flag
* @param antiAliasing The required scene anti-aliasing.
*/
def this(width: Double, height: Double, depthBuffer: Boolean, antiAliasing: SceneAntialiasing) =
this(new jfxs.Scene(new jfxs.Group(), width, height, depthBuffer, antiAliasing))
/**
* Creates a Scene for a specific root Node with a specific size and fill.
* @param parent The root node of the scene graph
* @param width The width of the scene
* @param height The height of the scene
* @param fill The fill
*/
def this(parent: Parent, width: Double, height: Double, fill: Paint) =
this(new jfxs.Scene(parent, width, height, fill))
/**
* Creates a Scene for a specific root Node with a fill.
* @param parent The root node of the scene graph
* @param fill The fill
*/
def this(parent: Parent, fill: Paint) = this(new jfxs.Scene(parent, fill))
/**
* Returns the root Node of the scene graph
*/
def root: ObjectProperty[jfxs.Parent] = delegate.rootProperty
/**
* Sets the root Node of the scene graph
*/
def root_=(v: Parent) {
root() = v
}
/**
* Returns Nodes children from this Scene's `root`.
*/
def getChildren = root.value match {
case group: jfxs.Group => group.getChildren
case pane: jfxsl.Pane => pane.getChildren
case _ => throw new IllegalStateException("Cannot access children of root: " + root + "\n" +
"Use a class that extends Group or Pane, or override the getChildren method.")
}
/**
* Returns scene's antialiasing setting.
*/
def antialiasing: SceneAntialiasing = delegate.getAntiAliasing
/**
* Returns Content's Node children from this Scene's `root`.
*/
def content: jfxc.ObservableList[jfxs.Node] = getChildren
/**
* Sets the list of Nodes children from this Scene's `root`, replacing the prior content. If you want append to
* current content, use `add` or similar.
*
* @param c list of Nodes children from this Scene's `root` to replace prior content.
*/
def content_=(c: Iterable[Node]) {
fillSFXCollection(this.content, c)
}
/**
* Sets a Node child, replacing the prior content. If you want append to current content, use `add` or similar.
*
* @param n Node child to replace prior content.
*/
def content_=(n: Node) {
fillSFXCollectionWithOne(this.content, n)
}
/**
* Specifies the type of camera use for rendering this `Scene`.
*/
def camera: ObjectProperty[jfxs.Camera] = delegate.cameraProperty
def camera_=(v: Camera) {
camera() = v
}
/**
* Defines the mouse cursor for this `Scene`.
*/
def cursor: ObjectProperty[jfxs.Cursor] = delegate.cursorProperty
def cursor_=(v: Cursor) {
cursor() = v
}
/** The effective node orientation of a scene resolves the inheritance of node orientation, returning either left-to-right or right-to-left. */
def effectiveNodeOrientation: ReadOnlyObjectProperty[jfxg.NodeOrientation] = delegate.effectiveNodeOrientationProperty
/**
* Specifies the event dispatcher for this scene.
*/
def eventDispatcher: ObjectProperty[jfxe.EventDispatcher] = delegate.eventDispatcherProperty
def eventDispatcher_=(v: jfxe.EventDispatcher) {
eventDispatcher() = v
}
/**
* Defines the background fill of this Scene.
*/
def fill: ObjectProperty[jfxsp.Paint] = delegate.fillProperty
def fill_=(v: Paint) {
fill() = v
}
/**
* The height of this Scene
*/
def height: ReadOnlyDoubleProperty = delegate.heightProperty
/**
* The width of this Scene
*/
def width: ReadOnlyDoubleProperty = delegate.widthProperty
def nodeOrientation: ObjectProperty[jfxg.NodeOrientation] = delegate.nodeOrientationProperty
def nodeOrientation_=(v: NodeOrientation) {
ObjectProperty.fillProperty[jfxg.NodeOrientation](this.nodeOrientation, v)
}
/**
* Defines a function to be called when a mouse button has been clicked (pressed and released) on this `Scene`.
*/
def onContextMenuRequested = delegate.onContextMenuRequestedProperty
def onContextMenuRequested_=(v: jfxe.EventHandler[_ >: jfxsi.ContextMenuEvent]) {
onContextMenuRequested() = v
}
/**
* Defines a function to be called when drag gesture has been detected.
*/
def onDragDetected = delegate.onDragDetectedProperty
def onDragDetected_=(v: jfxe.EventHandler[_ >: jfxsi.MouseEvent]) {
onDragDetected() = v
}
/**
* Defines a function to be called when this `Scene` is a drag and drop gesture source after its data has been
* dropped on a drop target.
*/
def onDragDone = delegate.onDragDoneProperty
def onDragDone_=(v: jfxe.EventHandler[_ >: jfxsi.DragEvent]) {
onDragDone() = v
}
/**
* Defines a function to be called when the mouse button is released on this `Scene` during drag and drop gesture.
*/
def onDragDropped = delegate.onDragDroppedProperty
def onDragDropped_=(v: jfxe.EventHandler[_ >: jfxsi.DragEvent]) {
onDragDropped() = v
}
/**
* Defines a function to be called when drag gesture enters this Scene.
*/
def onDragEntered = delegate.onDragEnteredProperty
def onDragEntered_=(v: jfxe.EventHandler[_ >: jfxsi.DragEvent]) {
onDragEntered() = v
}
/**
* Defines a function to be called when drag gesture exits this Scene.
*/
def onDragExited = delegate.onDragExitedProperty
def onDragExited_=(v: jfxe.EventHandler[_ >: jfxsi.DragEvent]) {
onDragExited() = v
}
/**
* Defines a function to be called when drag gesture progresses within this `Scene`.
*/
def onDragOver = delegate.onDragOverProperty
def onDragOver_=(v: jfxe.EventHandler[_ >: jfxsi.DragEvent]) {
onDragOver() = v
}
/**
* Defines a function to be called when this `Node` has input focus and the input method text has changed.
*/
def onInputMethodTextChanged = delegate.onInputMethodTextChangedProperty
def onInputMethodTextChanged_=(v: jfxe.EventHandler[_ >: jfxsi.InputMethodEvent]) {
onInputMethodTextChanged() = v
}
/**
* Defines a function to be called when some `Node` of this `Scene` has input focus and a key has been pressed.
*/
def onKeyPressed = delegate.onKeyPressedProperty
def onKeyPressed_=(v: jfxe.EventHandler[_ >: jfxsi.KeyEvent]) {
onKeyPressed() = v
}
/**
* Defines a function to be called when some `Node` of this `Scene` has input focus and a key has been released.
*/
def onKeyReleased = delegate.onKeyReleasedProperty
def onKeyReleased_=(v: jfxe.EventHandler[_ >: jfxsi.KeyEvent]) {
onKeyReleased() = v
}
/**
* Defines a function to be called when some `Node` of this `Scene` has input focus and a key has been typed.
*/
def onKeyTyped = delegate.onKeyTypedProperty
def onKeyTyped_=(v: jfxe.EventHandler[_ >: jfxsi.KeyEvent]) {
onKeyTyped() = v
}
/**
* Defines a function to be called when a mouse button has been clicked (pressed and released) on this `Scene`.
*/
def onMouseClicked = delegate.onMouseClickedProperty
def onMouseClicked_=(v: jfxe.EventHandler[_ >: jfxsi.MouseEvent]) {
onMouseClicked() = v
}
/**
* Defines a function to be called when a mouse button is pressed on this `Scene` and then dragged.
*/
def onMouseDragged = delegate.onMouseDraggedProperty
def onMouseDragged_=(v: jfxe.EventHandler[_ >: jfxsi.MouseEvent]) {
onMouseDragged() = v
}
/**
* Defines a function to be called when a full press-drag-release gesture enters this `Scene`.
*/
def onMouseDragEntered = delegate.onMouseDragEnteredProperty
def onMouseDragEntered_=(v: jfxe.EventHandler[_ >: jfxsi.MouseDragEvent]) {
onMouseDragEntered() = v
}
/**
* Defines a function to be called when a full press-drag-release gesture exits this `Scene`.
*/
def onMouseDragExited = delegate.onMouseDragExitedProperty
def onMouseDragExited_=(v: jfxe.EventHandler[_ >: jfxsi.MouseDragEvent]) {
onMouseDragExited() = v
}
/**
* Defines a function to be called when a full press-drag-release gesture progresses within this `Scene`.
*/
def onMouseDragOver = delegate.onMouseDragOverProperty
def onMouseDragOver_=(v: jfxe.EventHandler[_ >: jfxsi.MouseDragEvent]) {
onMouseDragOver() = v
}
/**
* Defines a function to be called when a full press-drag-release gesture ends within this `Scene`.
*/
def onMouseDragReleased = delegate.onMouseDragReleasedProperty
def onMouseDragReleased_=(v: jfxe.EventHandler[_ >: jfxsi.MouseDragEvent]) {
onMouseDragReleased() = v
}
/**
* Defines a function to be called when the mouse enters this `Scene`.
*/
def onMouseEntered = delegate.onMouseEnteredProperty
def onMouseEntered_=(v: jfxe.EventHandler[_ >: jfxsi.MouseEvent]) {
onMouseEntered() = v
}
/**
* Defines a function to be called when the mouse exits this `Scene`.
*/
def onMouseExited = delegate.onMouseExitedProperty
def onMouseExited_=(v: jfxe.EventHandler[_ >: jfxsi.MouseEvent]) {
onMouseExited() = v
}
/**
* Defines a function to be called when mouse cursor moves within this `Scene` but no buttons have been pushed.
*/
def onMouseMoved = delegate.onMouseMovedProperty
def onMouseMoved_=(v: jfxe.EventHandler[_ >: jfxsi.MouseEvent]) {
onMouseMoved() = v
}
/**
* Defines a function to be called when a mouse button has been pressed on this `Scene`.
*/
def onMousePressed = delegate.onMousePressedProperty
def onMousePressed_=(v: jfxe.EventHandler[_ >: jfxsi.MouseEvent]) {
onMousePressed() = v
}
/**
* Defines a function to be called when a mouse button has been released on this `Scene`.
*/
def onMouseReleased = delegate.onMouseReleasedProperty
def onMouseReleased_=(v: jfxe.EventHandler[_ >: jfxsi.MouseEvent]) {
onMouseReleased() = v
}
/**
* Defines a function to be called when user performs a scrolling action.
*/
def onScroll = delegate.onScrollProperty
def onScroll_=(v: jfxe.EventHandler[_ >: jfxsi.ScrollEvent]) {
onScroll() = v
}
/**
* The URL of the user-agent stylesheet that will be used by this Scene in place of the the platform-default
* user-agent stylesheet. If the URL does not resolve to a valid location, the platform-default user-agent
* stylesheet will be used.
*
* For additional information about using CSS with the scene graph, see the
* [[http://docs.oracle.com/javase/8/javafx/api/javafx/scene/doc-files/cssref.html CSS Reference Guide]].
*
* @return The URL of the user-agent stylesheet that will be used by this SubScene, or null if has not been set.
*/
def userAgentStylesheet: ObjectProperty[String] = delegate.userAgentStylesheetProperty
/**
* Set the URL of the user-agent stylesheet that will be used by this Scene in place of the the platform-default
* user-agent stylesheet. If the URL does not resolve to a valid location, the platform-default user-agent
* stylesheet will be used.
*
* For additional information about using CSS with the scene graph, see the
* [[http://docs.oracle.com/javase/8/javafx/api/javafx/scene/doc-files/cssref.html CSS Reference Guide]].
*
* @param url The URL is a hierarchical URI of the form `[scheme:][//authority][path]`.
* If the URL does not have a `[scheme:]` component, the URL is considered to be the `[path]`
* component only. Any leading '/' character of the `[path]` is ignored and the `[path]` is
* treated as a path relative to the root of the application's classpath.
*/
def userAgentStylesheet_=(url: String) {
ObjectProperty.fillProperty[String](userAgentStylesheet, url)
}
/**
* The `Window` for this Scene
*/
def window: ReadOnlyObjectProperty[javafx.stage.Window] = delegate.windowProperty
/**
* The horizontal location of this `Scene` on the `Window`.
*/
def x: ReadOnlyDoubleProperty = delegate.xProperty
/**
* The vertical location of this `Scene` on the `Window`.
*/
def y: ReadOnlyDoubleProperty = delegate.yProperty
/**
* Retrieves the depth buffer attribute for this scene.
*/
def depthBuffer = delegate.isDepthBuffer
/**
* Gets an observable list of string URLs linking to the stylesheets to use with this Parent's contents.
*/
def stylesheets: jfxc.ObservableList[String] = delegate.getStylesheets
/**
* Sets the list of stylesheets URLs, replacing the prior content. If you want append to current content, use `add` or
* similar.
*
* @param c list of stylesheets URLs to replace prior content.
*/
def stylesheets_=(c: Iterable[String]) {
fillCollection(stylesheets, c)
}
/**
* Looks for any node within the scene graph based on the specified CSS selector.
*
* @param selector The css selector to look up
* @return A [[scala.Some]] containing the Node in the scene which matches the CSS selector, or [[scala.None]]
* if none is found.
*/
def lookup(selector: String): Option[Node] = Option(delegate.lookup(selector))
/**
* Registers the specified mnemonic.
*
* @param m The Mnemonic
*/
def addMnemonic(m: Mnemonic) {
delegate.addMnemonic(m)
}
/**
* Unregisters the specified mnemonic.
*
* @param m The Mnemonic to be removed.
*/
def removeMnemonic(m: Mnemonic) {
delegate.removeMnemonic(m)
}
/**
* Gets the list of mnemonics for this `Scene`.
*/
def getMnemonics: jfxc.ObservableMap[jfxsi.KeyCombination, jfxc.ObservableList[jfxsi.Mnemonic]] = delegate.getMnemonics
/**
* Gets the list of accelerators for this Scene.
*/
def accelerators: jfxc.ObservableMap[jfxsi.KeyCombination, Runnable] = delegate.getAccelerators
/**
* Confirms a potential drag and drop gesture that is recognized over this `Scene`.
*
* @param transferModes The supported `TransferMode`(s) of this `Node`
* @return A `Dragboard` to place this `Scene`'s data on
*/
def startDragAndDrop(transferModes: TransferMode*): Dragboard =
delegate.startDragAndDrop(transferModes.map(_.delegate): _*)
/**
* Starts a full press-drag-release gesture with this scene as gesture source.
*/
def startFullDrag() {
delegate.startFullDrag()
}
/**
* The scene's current focus owner node. This node's "focused" variable might be false if this scene has no window,
* or if the window is inactive (window.focused == false).
*
* @since 2.2
*/
def focusOwner: ReadOnlyObjectProperty[jfxs.Node] = delegate.focusOwnerProperty()
/**
* Defines a function to be called when user performs a rotation action.
*
* @since 2.2
*/
def onRotate = delegate.onRotateProperty
def onRotate_=(v: jfxe.EventHandler[_ >: jfxsi.RotateEvent]) {
onRotate() = v
}
/**
* Defines a function to be called when a rotation gesture ends.
*
* @since 2.2
*/
def onRotationFinished = delegate.onRotationFinishedProperty()
def onRotationFinished_=(v: jfxe.EventHandler[_ >: jfxsi.RotateEvent]) {
onRotationFinished() = v
}
/**
* Defines a function to be called when a rotation gesture starts.
*
* @since 2.2
*/
def onRotationStarted = delegate.onRotationFinishedProperty()
def onRotationStarted_=(v: jfxe.EventHandler[_ >: jfxsi.RotateEvent]) {
onRotationStarted() = v
}
/**
* Defines a function to be called when a Scroll gesture ends.
*
* @since 2.2
*/
def onScrollFinished = delegate.onScrollFinishedProperty()
def onScrollFinished_=(v: jfxe.EventHandler[_ >: jfxsi.ScrollEvent]) {
onScrollFinished() = v
}
/**
* Defines a function to be called when a Scroll gesture starts.
*
* @since 2.2
*/
def onScrollStarted = delegate.onScrollStartedProperty()
def onScrollStarted_=(v: jfxe.EventHandler[_ >: jfxsi.ScrollEvent]) {
onScrollStarted() = v
}
/**
* Defines a function to be called when a Swipe Down gesture starts.
*
* @since 2.2
*/
def onSwipeDown = delegate.onSwipeDownProperty()
def onSwipeDown_=(v: jfxe.EventHandler[_ >: jfxsi.SwipeEvent]) {
onSwipeDown() = v
}
/**
* Defines a function to be called when a Swipe Down gesture starts.
*
* @since 2.2
*/
def onSwipeLeft = delegate.onSwipeLeftProperty()
def onSwipeLeft_=(v: jfxe.EventHandler[_ >: jfxsi.SwipeEvent]) {
onSwipeLeft() = v
}
/**
* Defines a function to be called when a Swipe Up gesture starts.
*
* @since 2.2
*/
def onSwipeUp = delegate.onSwipeUpProperty()
def onSwipeUp_=(v: jfxe.EventHandler[_ >: jfxsi.SwipeEvent]) {
onSwipeUp() = v
}
/**
* Defines a function to be called when a Swipe Right gesture starts.
*
* @since 2.2
*/
def onSwipeRight = delegate.onSwipeRightProperty()
def onSwipeRight_=(v: jfxe.EventHandler[_ >: jfxsi.SwipeEvent]) {
onSwipeRight() = v
}
/**
* Defines a function to be called when user performs a Touch action.
*
* @since 2.2
*/
def onZoom = delegate.onZoomProperty()
def onZoom_=(v: jfxe.EventHandler[_ >: jfxsi.ZoomEvent]) {
onZoom() = v
}
/**
* Defines a function to be called when a Zoom gesture ends.
*
* @since 2.2
*/
def onZoomFinished = delegate.onZoomFinishedProperty()
def onZoomFinished_=(v: jfxe.EventHandler[_ >: jfxsi.ZoomEvent]) {
onZoomFinished() = v
}
/**
* Defines a function to be called when a Zoom gesture starts.
*
* @since 2.2
*/
def onZoomStarted = delegate.onZoomStartedProperty()
def onZoomStarted_=(v: jfxe.EventHandler[_ >: jfxsi.ZoomEvent]) {
onZoomStarted() = v
}
/**
* Defines a function to be called when user performs a Touch Moved action.
*
* @since 2.2
*/
def onTouchMoved = delegate.onTouchMovedProperty()
def onTouchMoved_=(v: jfxe.EventHandler[_ >: jfxsi.TouchEvent]) {
onTouchMoved() = v
}
/**
* Defines a function to be called when user performs a Touch Pressed action.
*
* @since 2.2
*/
def onTouchPressed = delegate.onTouchPressedProperty()
def onTouchPressed_=(v: jfxe.EventHandler[_ >: jfxsi.TouchEvent]) {
onTouchPressed() = v
}
/**
* Defines a function to be called when user performs a Touch Released action.
*
* @since 2.2
*/
def onTouchReleased = delegate.onTouchReleasedProperty()
def onTouchReleased_=(v: jfxe.EventHandler[_ >: jfxsi.TouchEvent]) {
onTouchReleased() = v
}
/**
* Defines a function to be called when user performs a Touch Stationary action.
*
* @since 2.2
*/
def onTouchStationary = delegate.onTouchStationaryProperty()
def onTouchStationary_=(v: jfxe.EventHandler[_ >: jfxsi.TouchEvent]) {
onTouchStationary() = v
}
/**
* Takes a snapshot of this scene and returns the rendered image when it is ready.
*
* @param image The writable image that will be used to hold the rendered scene.
* @return the rendered image
*
* @since 2.2
*/
def snapshot(image: WritableImage): WritableImage = delegate.snapshot(image)
/**
* Takes a snapshot of this scene at the next frame and calls the specified callback method when the image is ready.
*
* @param callback A function to be called when the image is ready.
* @param image The writable image that will be used to hold the rendered scene.
*
* @since 2.2
*/
def snapshot(callback: SnapshotResult => Unit, image: WritableImage) {
val javaCallback = new jfxu.Callback[jfxs.SnapshotResult, java.lang.Void] {
def call(result: jfxs.SnapshotResult): java.lang.Void = {
callback(new SnapshotResult(result))
null
}
}
delegate.snapshot(javaCallback, image)
}
}