object ObservableBuffer extends SeqFactory[ObservableBuffer]
Companion Object for scalafx.collections.ObservableBuffer.
- Source
- ObservableBuffer.scala
- Alphabetic
- By Inheritance
- ObservableBuffer
- SeqFactory
- TraversableFactory
- GenericSeqCompanion
- GenSeqFactory
- GenTraversableFactory
- GenericCompanion
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
case class
Add
[T](position: Int, added: Traversable[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
. -
type
Coll = ObservableBuffer[_]
- Attributes
- protected[this]
- Definition Classes
- GenericCompanion
-
class
GenericCanBuildFrom[A] extends CanBuildFrom[CC[_], A, CC[A]]
- Definition Classes
- GenTraversableFactory
-
case class
Remove
[T](position: Int, removed: Traversable[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
ReusableCBF: GenericCanBuildFrom[Nothing]
- Definition Classes
- GenTraversableFactory
-
def
apply[T](items: Seq[T]): ObservableBuffer[T]
Creates a new
ObservableBuffer
from a sequence of elements.Creates a new
ObservableBuffer
from a sequence of elements.- items
Sequence of elements
- returns
new
ObservableBuffer
from items
-
def
apply[A](elems: A*): ObservableBuffer[A]
- Definition Classes
- GenericCompanion
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
implicit
def
canBuildFrom[T]: CanBuildFrom[Coll, T, ObservableBuffer[T]]
The standard
CanBuildFrom
instance forObservableBuffer
objects. -
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
concat[T](buffers: ObservableBuffer[T]*): ObservableBuffer[T]
Concatenates more
ObservableBuffer
's into one.Concatenates more
ObservableBuffer
's into one.- buffers
Buffer
to concatenate
-
def
concat[A](xss: Traversable[A]*): ObservableBuffer[A]
- Definition Classes
- GenTraversableFactory
-
def
empty[A]: ObservableBuffer[A]
- Definition Classes
- GenericCompanion
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
fill[A](n1: Int, n2: Int, n3: Int, n4: Int, n5: Int)(elem: ⇒ A): ObservableBuffer[ObservableBuffer[ObservableBuffer[ObservableBuffer[ObservableBuffer[A]]]]]
- Definition Classes
- GenTraversableFactory
-
def
fill[A](n1: Int, n2: Int, n3: Int, n4: Int)(elem: ⇒ A): ObservableBuffer[ObservableBuffer[ObservableBuffer[ObservableBuffer[A]]]]
- Definition Classes
- GenTraversableFactory
-
def
fill[A](n1: Int, n2: Int, n3: Int)(elem: ⇒ A): ObservableBuffer[ObservableBuffer[ObservableBuffer[A]]]
- Definition Classes
- GenTraversableFactory
-
def
fill[A](n1: Int, n2: Int)(elem: ⇒ A): ObservableBuffer[ObservableBuffer[A]]
- Definition Classes
- GenTraversableFactory
-
def
fill[A](n: Int)(elem: ⇒ A): ObservableBuffer[A]
- Definition Classes
- GenTraversableFactory
-
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
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
iterate[A](start: A, len: Int)(f: (A) ⇒ A): ObservableBuffer[A]
- Definition Classes
- GenTraversableFactory
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
newBuilder[T]: Builder[T, ObservableBuffer[T]]
The default builder for
ObservableBuffer
objects.The default builder for
ObservableBuffer
objects.- Definition Classes
- ObservableBuffer → GenericCompanion
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
implicit
def
observableBuffer2ObservableList[T](ob: ObservableBuffer[T]): ObservableList[T]
Extracts an
ObservableList
from anObservableBuffer
.Extracts an
ObservableList
from anObservableBuffer
.- ob
ObservableBuffer
-
def
range[T](start: T, end: T, step: T)(implicit arg0: Integral[T]): ObservableBuffer[T]
- Definition Classes
- GenTraversableFactory
-
def
range[T](start: T, end: T)(implicit arg0: Integral[T]): ObservableBuffer[T]
- Definition Classes
- GenTraversableFactory
-
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](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
- GenTraversableFactory
-
def
tabulate[A](n1: Int, n2: Int, n3: Int, n4: Int)(f: (Int, Int, Int, Int) ⇒ A): ObservableBuffer[ObservableBuffer[ObservableBuffer[ObservableBuffer[A]]]]
- Definition Classes
- GenTraversableFactory
-
def
tabulate[A](n1: Int, n2: Int, n3: Int)(f: (Int, Int, Int) ⇒ A): ObservableBuffer[ObservableBuffer[ObservableBuffer[A]]]
- Definition Classes
- GenTraversableFactory
-
def
tabulate[A](n1: Int, n2: Int)(f: (Int, Int) ⇒ A): ObservableBuffer[ObservableBuffer[A]]
- Definition Classes
- GenTraversableFactory
-
def
tabulate[A](n: Int)(f: (Int) ⇒ A): ObservableBuffer[A]
- Definition Classes
- GenTraversableFactory
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
unapplySeq[A](x: ObservableBuffer[A]): Some[ObservableBuffer[A]]
- Definition Classes
- SeqFactory
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
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.