object ObservableBuffer extends StrictOptimizedSeqFactory[ObservableBuffer]
Companion Object for scalafx.collections.ObservableBuffer.
- Source
- ObservableBuffer.scala
- Alphabetic
- By Inheritance
- ObservableBuffer
- StrictOptimizedSeqFactory
- SeqFactory
- IterableFactory
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- case class Add[T](position: Int, added: Iterable[T]) extends Change[T] with Product with Serializable
Indicates an Addition in an
ObservableBuffer
.Indicates an Addition in an
ObservableBuffer
.- position
Position from where new elements were added
- added
elements added
- sealed trait Change[T] extends AnyRef
Trait that indicates a Change in an
ObservableBuffer
.Trait that indicates a Change in an
ObservableBuffer
. It is a simpler version of JavaFX'sListChangeListener.Change
, where each subclass indicates a specific change operation. Unlike JavaFX, all subclasses are exclusive to each other. This enables using pattern matching:items.onChange((_, changes) => { for (change <- changes) change match { case Add(pos, added) => ... case Remove(pos, removed) => ... case Reorder(from, to, permutation) => ... case Update(pos, updated) => ... } })
"replace" is represented as two changes
Remove
andAdd
. - case class Remove[T](position: Int, removed: Iterable[T]) extends Change[T] with Product with Serializable
Indicates a Removal in an
ObservableBuffer
.Indicates a Removal in an
ObservableBuffer
.- position
Position from where elements were removed
- removed
elements removed
- case class Reorder[T](start: Int, end: Int, permutation: (Int) => Int) extends Change[T] with Product with Serializable
Indicates a Reordering in an
ObservableBuffer
.Indicates a Reordering in an
ObservableBuffer
.- start
The start of the change interval.
- end
The end of the change interval.
- permutation
Function that indicates the permutation that happened. The argument indicates the old index that contained the element prior to this change. Its return is the new index of the same element.
- case class Update[T](from: Int, to: Int) extends Change[T] with Product with Serializable
Indicates an Update in an
ObservableBuffer
.Indicates an Update in an
ObservableBuffer
.- from
Position from where elements were updated
- to
Position to where elements were updated (exclusive)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def apply[A](elems: A*): ObservableBuffer[A]
- Definition Classes
- IterableFactory
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- def concat[A](xss: Iterable[A]*): ObservableBuffer[A]
- Definition Classes
- StrictOptimizedSeqFactory → IterableFactory
- def empty[T]: ObservableBuffer[T]
- Definition Classes
- ObservableBuffer → IterableFactory
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def fill[A](n: Int)(elem: => A): ObservableBuffer[A]
- Definition Classes
- StrictOptimizedSeqFactory → IterableFactory
- def fill[A](n1: Int, n2: Int, n3: Int, n4: Int, n5: Int)(elem: => A): ObservableBuffer[ObservableBuffer[ObservableBuffer[ObservableBuffer[ObservableBuffer[A]]]]]
- Definition Classes
- IterableFactory
- def fill[A](n1: Int, n2: Int, n3: Int, n4: Int)(elem: => A): ObservableBuffer[ObservableBuffer[ObservableBuffer[ObservableBuffer[A]]]]
- Definition Classes
- IterableFactory
- def fill[A](n1: Int, n2: Int, n3: Int)(elem: => A): ObservableBuffer[ObservableBuffer[ObservableBuffer[A]]]
- Definition Classes
- IterableFactory
- def fill[A](n1: Int, n2: Int)(elem: => A): ObservableBuffer[ObservableBuffer[A]]
- Definition Classes
- IterableFactory
- def fillAll[T](buffer: ObservableBuffer[T], obj: T): Unit
Fills the provided
Buffer
with obj.Fills the provided
Buffer
with obj. Fires only one change notification on theBuffer
.- buffer
Buffer
to Fill- obj
the object to fill the
Buffer
with
- def from[T](source: IterableOnce[T]): ObservableBuffer[T]
- Definition Classes
- ObservableBuffer → IterableFactory
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- implicit def iterableFactory[A]: Factory[A, ObservableBuffer[A]]
- Definition Classes
- IterableFactory
- def iterate[A](start: A, len: Int)(f: (A) => A): ObservableBuffer[A]
- Definition Classes
- IterableFactory
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def newBuilder[T]: Builder[T, ObservableBuffer[T]]
- Definition Classes
- ObservableBuffer → IterableFactory
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- implicit def observableBuffer2ObservableList[T](ob: ObservableBuffer[T]): ObservableList[T]
Extracts an
ObservableList
from anObservableBuffer
.Extracts an
ObservableList
from anObservableBuffer
.- ob
ObservableBuffer
- def range[A](start: A, end: A, step: A)(implicit arg0: Integral[A]): ObservableBuffer[A]
- Definition Classes
- IterableFactory
- def range[A](start: A, end: A)(implicit arg0: Integral[A]): ObservableBuffer[A]
- Definition Classes
- IterableFactory
- def revertBuffer[T](buffer: ObservableBuffer[T]): Unit
Revert the order in the
ObservableBuffer
.Revert the order in the
ObservableBuffer
. Fires only one change notification on the list.Implementation note: This method uses
reverse
method fromjavafx.collections.FXCollections
. It is not calledreverse
to not confuse with method with same name from scala.collection.mutable.Buffer- buffer
Buffer
to be reverted.
- def rotate[T](buffer: ObservableBuffer[T], distance: Int): Unit
Rotates the
Buffer
by distance.Rotates the
Buffer
by distance. Fires only one change notification on theBuffer
.- buffer
the
Buffer
to be rotated- distance
the distance of rotation
- def shuffle[T](buffer: ObservableBuffer[T], rnd: Random): Unit
Shuffles all elements in the
ObservableBuffer
.Shuffles all elements in the
ObservableBuffer
. Fires only one change notification on theBuffer
.- buffer
Buffer to be shuffled
- rnd
the random generator used for shuffling
- def shuffle[T](buffer: ObservableBuffer[T]): Unit
Shuffles all elements in the
ObservableBuffer
.Shuffles all elements in the
ObservableBuffer
. Fires only one change notification on theBuffer
.- buffer
Buffer to be shuffled
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def tabulate[A](n: Int)(f: (Int) => A): ObservableBuffer[A]
- Definition Classes
- StrictOptimizedSeqFactory → IterableFactory
- def tabulate[A](n1: Int, n2: Int, n3: Int, n4: Int, n5: Int)(f: (Int, Int, Int, Int, Int) => A): ObservableBuffer[ObservableBuffer[ObservableBuffer[ObservableBuffer[ObservableBuffer[A]]]]]
- Definition Classes
- IterableFactory
- def tabulate[A](n1: Int, n2: Int, n3: Int, n4: Int)(f: (Int, Int, Int, Int) => A): ObservableBuffer[ObservableBuffer[ObservableBuffer[ObservableBuffer[A]]]]
- Definition Classes
- IterableFactory
- def tabulate[A](n1: Int, n2: Int, n3: Int)(f: (Int, Int, Int) => A): ObservableBuffer[ObservableBuffer[ObservableBuffer[A]]]
- Definition Classes
- IterableFactory
- def tabulate[A](n1: Int, n2: Int)(f: (Int, Int) => A): ObservableBuffer[ObservableBuffer[A]]
- Definition Classes
- IterableFactory
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def unapplySeq[A](x: ObservableBuffer[A]): UnapplySeqWrapper[A]
- Definition Classes
- SeqFactory
- def unfold[A, S](init: S)(f: (S) => Option[(A, S)]): ObservableBuffer[A]
- Definition Classes
- IterableFactory
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
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.