EventIncludes

Contains implicit methods to convert from `javafx.event` Classes to their ScalaFX counterparts.

Contains implicit methods to convert from `javafx.event` Classes to their ScalaFX counterparts.

Companion
object
class Object
trait Matchable
class Any
trait Includes
object Includes

Value members

Deprecated methods

@deprecated("Starting with Scala 2.12 `handle{...}` can be replaced with idiomatic Scala code `_ => {...}`", "R19")
def handle[J <: Event, R](handler: => R): EventHandler[J]

NOTE: use of handle is deprecated in Scala 2.12 and newer, you can use standard Scala syntax:

NOTE: use of handle is deprecated in Scala 2.12 and newer, you can use standard Scala syntax:

button.onAction = _ => {
 println("Handling button action")
 doSomething()
}

For Scala 2.11 and older, you can use handle to create a simple event handler when information about event is not be used.

Enables following use:

button.onAction = handle {
 println("Handling button action")
 doSomething()
}
Type Params
J

JavaFX Event subclass.

Value Params
handler

code executed when event is handled.

Returns

JavaFX EventHandler which will wrap the input code handler.

Deprecated

Implicits

Implicits

implicit def eventClosureWrapperWithParam[J <: Event, S <: SFXDelegate[J], R](handler: S => R)(jfx2sfx: J => S): EventHandler[J]

Converts a closure to a JavaFX EventHandler. It is used when the event properties ''will be used''.

Converts a closure to a JavaFX EventHandler. It is used when the event properties ''will be used''.

Enables following use:

button.onAction = (e:ActionEvent) => {
 println("Handling button action: " + e)
 doSomething(e)
}
Type Params
J

JavaFX Event subclass.

Value Params
handler

Closure that that takes scalafx.event.Event as argument.

Returns

JavaFX EventHandler which handle method will call handler

implicit def eventClosureWrapperWithZeroParam[T <: Event, R](handler: () => R): EventHandler[T]

Converts a closure to a JavaFX EventHandler. It is used when information about event is not be used.

Converts a closure to a JavaFX EventHandler. It is used when information about event is not be used.

Enables following use:

button.onAction = () => {
  println("Handling button action")
  doSomething()
}
Type Params
T

JavaFX Event subclass.

Value Params
handler

Closure that ''will not'' handle event.

Returns

JavaFX EventHandler which handle method will call handler

implicit def jfxActionEvent2sfx(ae: ActionEvent): ActionEvent

Converts a `javafx.event.ActionEvent` instance to its ScalaFX counterpart.

Converts a `javafx.event.ActionEvent` instance to its ScalaFX counterpart.

Value Params
ae

JavaFX ActionEvent

Returns

ScalaFX ActionEvent

implicit def jfxEvent2sfx(e: Event): Event

Converts a `javafx.event.Event` instance to its ScalaFX counterpart.

Converts a `javafx.event.Event` instance to its ScalaFX counterpart.

Value Params
e

JavaFX Event

Returns

ScalaFX Event

implicit def jfxEventDispatchChain2sfx(e: EventDispatchChain): EventDispatchChain
implicit def jfxEventDispatcher2sfx(e: EventDispatcher): EventDispatcher
implicit def jfxEventTarget2sfx(e: EventTarget): EventTarget
implicit def jfxEventType2sfx[T <: Event](e: EventType[T]): EventType[T]

Converts a `javafx.event.EventType` instance to its ScalaFX counterpart.

Converts a `javafx.event.EventType` instance to its ScalaFX counterpart.

Type Params
T

Event Type

Value Params
e

JavaFX EventType

Returns

ScalaFX EventType

implicit def jfxWeakEventHandler2sfx[T <: Event](weh: WeakEventHandler[T]): WeakEventHandler[T]

Converts a `javafx.event.WeakEventHandler` instance to its ScalaFX counterpart.

Converts a `javafx.event.WeakEventHandler` instance to its ScalaFX counterpart.

Type Params
T

Event Type

Value Params
weh

JavaFX WeakEventHandler

Returns

ScalaFX WeakEventHandler

Since

8.0