package collections
Wraps javafx.collections
package,
adding Scala's collections features to original JavaFX collections.
- Source
- package.scala
- Alphabetic
- By Inheritance
- collections
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Package Members
- package transformation
Type Members
- trait CollectionIncludes extends TransformationIncludes
Contains implicit methods to convert from
javafx.collections
Classes to their ScalaFX counterparts. - abstract class ObservableArray[V, T <: ObservableArray[V, T, D], D <: javafx.collections.ObservableArray[D]] extends Builder[V, T] with Observable with SFXDelegate[D]
Abstract
ObservableArray
base class. - class ObservableBuffer[T] extends AbstractBuffer[T] with IndexedBuffer[T] with IndexedSeqOps[T, ObservableBuffer, ObservableBuffer[T]] with StrictOptimizedSeqOps[T, ObservableBuffer, ObservableBuffer[T]] with IterableFactoryDefaults[T, ObservableBuffer] with Observable with SFXDelegate[ObservableList[T]]
Wrapper class to JavaFX's
ObservableList
.Wrapper class to JavaFX's
ObservableList
.- T
Type of this
Buffer
- abstract class ObservableBufferBase[E] extends ObservableBuffer[E] with SFXDelegate[ObservableListBase[E]]
There is no need in ScalaFX to use this class.
There is no need in ScalaFX to use this class.
ObservableListBase
is really an implementation detail of JavaFX, that is added in ScalaFX asObservableBufferBase
to keep type hierarchies inscalafx.collections.transformation
correct. Note thatBuffer
is used instead of JavaList
, since it is a closer equivalent to javaList
than ScalaList
(Java and ScalaList
are quite different). There should be bo need to use this class from ScalaFX. On JavaFX side this is an abstract class that serves as a base class for ObservableList implementations that wa added in JavFX 8. In ScalaFX 8 the implementation is actually in ObservableBuffer.Wraps a JavaFX ObservableListBase.
- E
- the type of the elements contained in the List
- class ObservableFloatArray extends ObservableArray[Float, ObservableFloatArray, javafx.collections.ObservableFloatArray]
Wrapper class to JavaFX's
ObservableFloatArray
. - class ObservableHashMap[K, V] extends ObservableMap[K, V]
scalafx.collections.ObservableMap implementation backed for a
HashMap
from Java Collection. - class ObservableHashSet[T] extends AbstractSet[T] with ObservableSet[T]
scalafx.collections.ObservableSet implementation backed for a
HashSet
from Java Collection. - class ObservableIntegerArray extends ObservableArray[Int, ObservableIntegerArray, javafx.collections.ObservableIntegerArray]
Wrapper class to JavaFX's
ObservableIntegerArray
. - trait ObservableMap[K, V] extends Map[K, V] with MapOps[K, V, Map, ObservableMap[K, V]] with StrictOptimizedIterableOps[(K, V), Iterable, ObservableMap[K, V]] with MapFactoryDefaults[K, V, ObservableMap, Iterable] with Observable with SFXDelegate[javafx.collections.ObservableMap[K, V]]
Wrapper class to JavaFX's
ObservableMap
.Wrapper class to JavaFX's
ObservableMap
.- K
Key type
- V
Value type. returned by observableHashMap method from FXCollections.
- trait ObservableSet[T] extends AbstractSet[T] with Observable with SFXDelegate[javafx.collections.ObservableSet[T]]
Wrapper class to JavaFX's
ObservableSet
.Wrapper class to JavaFX's
ObservableSet
.- T
Type of this
Set
Value Members
- def fillCollection[T](originalList: ObservableList[T], filler: Iterable[T]): Unit
Inserts all elements from a Iterable in a JavaFX ObservableList, replacing original content.
Inserts all elements from a Iterable in a JavaFX ObservableList, replacing original content. If this iterable was
null
, the list will be cleaned.- T
Iterable and ObservableList type
- originalList
List to be filled
- filler
Iterable which will fill originalList
- def fillCollectionWithOne[T](originalList: ObservableList[T], element: T): Unit
Replaces all content in an ObservableList of type T for a single element.
Replaces all content in an ObservableList of type T for a single element. If this element was
null
, the list will be cleaned.- T
Element and ObservableList type
- originalList
List to be filled
- element
Element which will replace originalList content.
- def fillSFXCollection[J <: AnyRef](originalList: ObservableList[J], filler: Iterable[SFXDelegate[J]]): Unit
Inserts all elements from a Iterable of type SFXDelegate[J] in a JavaFX ObservableList of type J, replacing its original content.
Inserts all elements from a Iterable of type SFXDelegate[J] in a JavaFX ObservableList of type J, replacing its original content. If this iterable was
null
, the list will be cleaned.- J
Iterable and ObservableList type
- originalList
List to be filled
- filler
Iterable which will fill originalList
- def fillSFXCollectionWithOne[J <: AnyRef](originalList: ObservableList[J], element: SFXDelegate[J]): Unit
Replaces all content in an JavaFX ObservableList of type J for a single SFXDelegate[J] element.
Replaces all content in an JavaFX ObservableList of type J for a single SFXDelegate[J] element. If this element was
null
, the list will be cleaned.- J
Iterable and ObservableList type
- originalList
List to be filled
- element
Element which will replace originalList content. Actually, it will used its delegate.
- object CollectionIncludes extends CollectionIncludes
- object ObservableArray
Companion Object for
scalafx.collections.ObservableArray
. - object ObservableBuffer extends StrictOptimizedSeqFactory[ObservableBuffer]
Companion Object for scalafx.collections.ObservableBuffer.
- object ObservableBufferBase
- object ObservableFloatArray extends ObservableArrayCompanionBase[Float, ObservableFloatArray, javafx.collections.ObservableFloatArray]
Companion Object for scalafx.collections.ObservableFloatArray.
- object ObservableIntegerArray extends ObservableArrayCompanionBase[Int, ObservableIntegerArray, javafx.collections.ObservableIntegerArray]
Companion Object for scalafx.collections.ObservableIntegerArray.
- object ObservableMap extends MapFactory[ObservableMap]
Companion Object for
scalafx.collections.ObservableMap
. - object ObservableSet extends IterableFactory[ObservableSet]
Companion Object for
scalafx.collections.ObservableSet
.
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 tojavafx.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 astage
that contains ascene
. Astage
roughly corresponds to a window in a typical UI environment. Thescene
holds UI content presented to the user. In the example below, the content is a pane with a singlelabel
component.