EventIncludes

scalafx.event.EventIncludes
See theEventIncludes companion object

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

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object EventIncludes.type
trait Includes
object Includes.type

Members list

Value members

Deprecated methods

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 parameters

J

JavaFX Event subclass.

Value parameters

handler

code executed when event is handled.

Attributes

Returns

JavaFX EventHandler which will wrap the input code handler.

Deprecated
true

Implicits

Implicits

implicit def eventClosureWrapperWithParam[J <: Event, S <: SFXDelegate[J], R](handler: S => R)(implicit 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 parameters

J

JavaFX Event subclass.

Value parameters

handler

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

Attributes

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 parameters

T

JavaFX Event subclass.

Value parameters

handler

Closure that ''will not'' handle event.

Attributes

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 parameters

ae

JavaFX ActionEvent

Attributes

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 parameters

e

JavaFX Event

Attributes

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 parameters

T

Event Type

Value parameters

e

JavaFX EventType

Attributes

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 parameters

T

Event Type

Value parameters

weh

JavaFX WeakEventHandler

Attributes

Returns

ScalaFX WeakEventHandler

Since

8.0