Packages

  • package root

    ScalaFX is a UI DSL written within the Scala Language that sits on top of JavaFX 2.x and and JavaFX 8.

    ScalaFX is a UI DSL written within the Scala Language that sits on top of JavaFX 2.x and and JavaFX 8. This means that every ScalaFX application is also a valid Scala application. By extension it supports full interoperability with Java and can run anywhere the Java Virtual Machine (JVM) and JavaFX 2.0 or JavaFX 8 are supported.

    Package Structure

    ScalaFX package structure corresponds to JavaFX package structure, for instance scalafx.animation corresponds to javafx.animation.

    Example Usage

    A basic ScalaFX application is created creating an object that is an instance of JFXApp. Following Java FX theatre metaphor, it contains a stage that contains a scene. A stage roughly corresponds to a window in a typical UI environment. The scene holds UI content presented to the user. In the example below, the content is a pane with a single label component.

    package hello
    
    import scalafx.application.JFXApp
    import scalafx.application.JFXApp.PrimaryStage
    import scalafx.geometry.Insets
    import scalafx.scene.Scene
    import scalafx.scene.control.Label
    import scalafx.scene.layout.BorderPane
    
    object HelloWorld extends JFXApp {
      stage = new PrimaryStage {
        title = "Hello"
        scene = new Scene {
          root = new BorderPane {
            padding = Insets(25)
            center = new Label("Hello World")
          }
        }
      }
    }
    Definition Classes
    root
  • package scalafx

    Base package for ScalaFX classes.

    Base package for ScalaFX classes.

    Definition Classes
    root
  • package application

    Wraps javafx.application package.

    Wraps javafx.application package.

    Definition Classes
    scalafx
  • ApplicationIncludes
  • ConditionalFeature
  • HostServices
  • JFXApp
  • JFXApp3
  • Platform

object Platform

Application platform support, wrapper for javafx.application.Platform.

Source
Platform.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Platform
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def accessibilityActive: ReadOnlyBooleanProperty

    Indicates whether or not accessibility is active.

    Indicates whether or not accessibility is active. This property is typically set to true the first time an assistive technology, such as a screen reader, requests information about any JavaFX window or its children.

    This method may be called from any thread.

    returns

    the read-only boolean property indicating if accessibility is active

    Since

    JavaFX 8u40

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  7. def enterNestedEventLoop(key: Any): Any

    Enter a nested event loop and block until the corresponding exitNestedEventLoop call is made.

    Enter a nested event loop and block until the corresponding exitNestedEventLoop call is made. The key passed into this method is used to uniquely identify the matched enter/exit pair. This method creates a new nested event loop and blocks until the corresponding exitNestedEventLoop method is called with the same key. The return value of this method will be the rval object supplied to the exitNestedEventLoop method call that unblocks it.

    This method must either be called from an input event handler or from the run method of a Runnable passed to javafx.application.Platform.runLater. It must not be called during animation or layout processing.

    key

    the Object that identifies the nested event loop, which must not be null

    returns

    the value passed into the corresponding call to exitEventLoop

    Since

    9

    Exceptions thrown

    IllegalArgumentException if the specified key is associated with a nested event loop that has not yet returned

    IllegalStateException if this method is called on a thread other than the JavaFX Application Thread.

    NullPointerException if the key is null

  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  10. def exit(): Unit

    Causes the JavaFX application to terminate.

  11. def exitNestedEventLoop(key: Any, rval: Any): Unit

    Exit a nested event loop and unblock the caller of the corresponding enterNestedEventLoop.

    Exit a nested event loop and unblock the caller of the corresponding enterNestedEventLoop. The key passed into this method is used to uniquely identify the matched enter/exit pair. This method causes the nested event loop that was previously created with the key to exit and return control to the caller. If the specified nested event loop is not the inner-most loop then it will not return until all other inner loops also exit.

    key

    the Object that identifies the nested event loop, which must not be null

    rval

    an Object that is returned to the caller of the corresponding enterNestedEventLoop. This may be null.

    Since

    9

    Exceptions thrown

    IllegalArgumentException if the specified key is not associated with an active nested event loop

    IllegalStateException if this method is called on a thread other than the FX Application thread

    NullPointerException if the key is null

  12. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  13. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  14. def implicitExit: Boolean

    Gets the value of the implicitExit attribute.

  15. def implicitExit_=(implicitExit: Boolean): Unit

    Sets the implicitExit attribute to the specified value.

  16. def isAccessibilityActive: Boolean
  17. def isFxApplicationThread: Boolean

    Returns true if the calling thread is the JavaFX Application Thread.

  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. def isNestedLoopRunning: Boolean

    Checks whether a nested event loop is running, returning true to indicate that one is, and false if there are no nested event loops currently running.

    Checks whether a nested event loop is running, returning true to indicate that one is, and false if there are no nested event loops currently running. This method must be called on the JavaFX Application thread.

    returns

    true if there is a nested event loop running, and false otherwise.

    Since

    9

    Exceptions thrown

    IllegalStateException if this method is called on a thread other than the JavaFX Application Thread.

  20. def isSupported(feature: ConditionalFeature): Boolean

    Queries whether a specific conditional feature is supported by the platform.

  21. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  24. def requestNextPulse(): Unit

    Requests the Java Runtime to perform a pulse.

    Requests the Java Runtime to perform a pulse. This will run a pulse even if there are no animation timers, scene graph modifications, or window events that would otherwise cause the pulse to run. If no pulse is in progress, then one will be scheduled to run the next time the pulse timer fires. If there is already a pulse running, then at least one more pulse after the current pulse will be scheduled. This method may be called on any thread.

    Since

    9

  25. def runLater[R](op: => R): Unit

    Run the specified code block on the JavaFX Application Thread at some unspecified time in the future.

    Run the specified code block on the JavaFX Application Thread at some unspecified time in the future. Returns immediately.

    Example use:

    Platform.runLater {
      println("Running on application thread.")
    }
  26. def runLater(runnable: Runnable): Unit

    Run the specified Runnable on the JavaFX Application Thread at some unspecified time in the future.

    Run the specified Runnable on the JavaFX Application Thread at some unspecified time in the future. Returns immediately.

  27. def startup(runnable: Runnable): Unit

    This method starts the JavaFX runtime.

    This method starts the JavaFX runtime. The specified Runnable will then be called on the JavaFX Application Thread. In general it is not necessary to explicitly call this method, since it is invoked as a consequence of how most JavaFX applications are built. However there are valid use cases for calling this method directly. Because this method starts the JavaFX runtime, there is not yet any JavaFX Application Thread, so it is normal that this method is called directly on the main thread of the application.

    This method may or may not return to the caller before the run method of the specified Runnable has been called. In any case, once this method returns, you may call runLater(Runnable) with additional Runnables. Those Runnables will be called, also on the JavaFX Application Thread, after the Runnable passed into this method has been called.

    As noted, it is normally the case that the JavaFX Application Thread is started automatically. It is important that this method only be called when the JavaFX runtime has not yet been initialized. Situations where the JavaFX runtime is started automatically include:

    • For standard JavaFX applications that extend Application, and use either the Java launcher or one of the launch methods in the Application class to launch the application, the FX runtime is initialized automatically by the launcher before the Application class is loaded.
    • For Swing applications that use javafx.embed.swing.JFXPanel to display FX content, the FX runtime is initialized when the first JFXPanel instance is constructed.
    • For SWT application that use FXCanvas to display FX content, the FX runtime is initialized when the first FXCanvas instance is constructed.

    When an application does not follow any of these common approaches, then it becomes the responsibility of the developer to manually start the JavaFX runtime by calling this startup method.

    Calling this method when the JavaFX runtime is already running will result in an IllegalStateException being thrown - it is only valid to request that the JavaFX runtime be started once.

    runnable

    the Runnable whose run method will be executed on the JavaFX Application Thread once it has been started

    Since

    9

    Exceptions thrown

    IllegalStateException if the JavaFX runtime is already running

    See also

    Application

  28. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  29. def toString(): String
    Definition Classes
    AnyRef → Any
  30. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  31. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  32. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped