ObservableBuffer

scalafx.collections.ObservableBuffer
See theObservableBuffer companion class

Companion Object for scalafx.collections.ObservableBuffer.

Attributes

Companion
class
Graph
Supertypes
trait Serializable
class Object
trait Matchable
class Any
Show all
Self type

Members list

Type members

Classlikes

case class Add[T](position: Int, added: Iterable[T]) extends Change[T]

Indicates an Addition in an ObservableBuffer.

Indicates an Addition in an ObservableBuffer.

Value parameters

added

elements added

position

Position from where new elements were added

Attributes

See also
Supertypes
trait Serializable
trait Product
trait Equals
trait Change[T]
class Object
trait Matchable
class Any
Show all
sealed trait Change[T]

Trait that indicates a Change in an ObservableBuffer. It is a simpler version of JavaFX's `ListChangeListener.Change`, where each subclass indicates a specific change operation. Unlike JavaFX, all subclasses are exclusive to each other. This enables using pattern matching:

Trait that indicates a Change in an ObservableBuffer. It is a simpler version of JavaFX's `ListChangeListener.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 and Add.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Add[T]
class Remove[T]
class Reorder[T]
class Update[T]
case class Remove[T](position: Int, removed: Iterable[T]) extends Change[T]

Indicates a Removal in an ObservableBuffer.

Indicates a Removal in an ObservableBuffer.

Value parameters

position

Position from where elements were removed

removed

elements removed

Attributes

See also
Supertypes
trait Serializable
trait Product
trait Equals
trait Change[T]
class Object
trait Matchable
class Any
Show all
case class Reorder[T](start: Int, end: Int, permutation: Int => Int) extends Change[T]

Indicates a Reordering in an ObservableBuffer.

Indicates a Reordering in an ObservableBuffer.

Value parameters

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.

start

The start of the change interval.

Attributes

See also
Supertypes
trait Serializable
trait Product
trait Equals
trait Change[T]
class Object
trait Matchable
class Any
Show all
case class Update[T](from: Int, to: Int) extends Change[T]

Indicates an Update in an ObservableBuffer.

Indicates an Update in an ObservableBuffer.

Value parameters

from

Position from where elements were updated

to

Position to where elements were updated (exclusive)

Attributes

See also
Supertypes
trait Serializable
trait Product
trait Equals
trait Change[T]
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

override def empty[T]: ObservableBuffer[T]

Attributes

Definition Classes
def fillAll[T](buffer: ObservableBuffer[T], obj: T): Unit

Fills the provided Buffer with obj. Fires only one change notification on the Buffer.

Fills the provided Buffer with obj. Fires only one change notification on the Buffer.

Value parameters

buffer

Buffer to Fill

obj

the object to fill the Buffer with

Attributes

override def from[T](source: IterableOnce[T]): ObservableBuffer[T]

Attributes

Definition Classes
override def newBuilder[T]: Builder[T, ObservableBuffer[T]]

Attributes

Definition Classes
def revertBuffer[T](buffer: ObservableBuffer[T]): Unit

Revert the order in the ObservableBuffer. Fires only '''one''' change notification on the list.

Revert the order in the ObservableBuffer. Fires only '''one''' change notification on the list.

''Implementation note'': This method uses `reverse` method from `javafx.collections.FXCollections`. It is not called reverse to not confuse with method with same name from scala.collection.mutable.Buffer

Value parameters

buffer

Buffer to be reverted.

Attributes

def rotate[T](buffer: ObservableBuffer[T], distance: Int): Unit

Rotates the Buffer by distance. Fires only one change notification on the Buffer.

Rotates the Buffer by distance. Fires only one change notification on the Buffer.

Value parameters

buffer

the Buffer to be rotated

distance

the distance of rotation

Attributes

def shuffle[T](buffer: ObservableBuffer[T]): Unit

Shuffles all elements in the ObservableBuffer. Fires only '''one''' change notification on the Buffer.

Shuffles all elements in the ObservableBuffer. Fires only '''one''' change notification on the Buffer.

Value parameters

buffer

Buffer to be shuffled

Attributes

def shuffle[T](buffer: ObservableBuffer[T], rnd: Random): Unit

Shuffles all elements in the ObservableBuffer. Fires only '''one''' change notification on the Buffer.

Shuffles all elements in the ObservableBuffer. Fires only '''one''' change notification on the Buffer.

Value parameters

buffer

Buffer to be shuffled

rnd

the random generator used for shuffling

Attributes

Inherited methods

def apply[A](elems: A*): CC[A]

Attributes

Inherited from:
IterableFactory
override def concat[A](xss: Iterable[A]*): CC[A]

Attributes

Definition Classes
Inherited from:
StrictOptimizedSeqFactory
override def fill[A](n: Int)(elem: => A): CC[A]

Attributes

Definition Classes
Inherited from:
StrictOptimizedSeqFactory
def fill[A](n1: Int, n2: Int, n3: Int, n4: Int, n5: Int)(elem: => A): CC[CC[CC[CC[CC[A]]]]]

Attributes

Inherited from:
IterableFactory
def fill[A](n1: Int, n2: Int, n3: Int, n4: Int)(elem: => A): CC[CC[CC[CC[A]]]]

Attributes

Inherited from:
IterableFactory
def fill[A](n1: Int, n2: Int, n3: Int)(elem: => A): CC[CC[CC[A]]]

Attributes

Inherited from:
IterableFactory
def fill[A](n1: Int, n2: Int)(elem: => A): CC[CC[A]]

Attributes

Inherited from:
IterableFactory
def iterate[A](start: A, len: Int)(f: A => A): CC[A]

Attributes

Inherited from:
IterableFactory
def range[A : Integral](start: A, end: A, step: A): CC[A]

Attributes

Inherited from:
IterableFactory
def range[A : Integral](start: A, end: A): CC[A]

Attributes

Inherited from:
IterableFactory
override def tabulate[A](n: Int)(f: Int => A): CC[A]

Attributes

Definition Classes
Inherited from:
StrictOptimizedSeqFactory
def tabulate[A](n1: Int, n2: Int, n3: Int, n4: Int, n5: Int)(f: (Int, Int, Int, Int, Int) => A): CC[CC[CC[CC[CC[A]]]]]

Attributes

Inherited from:
IterableFactory
def tabulate[A](n1: Int, n2: Int, n3: Int, n4: Int)(f: (Int, Int, Int, Int) => A): CC[CC[CC[CC[A]]]]

Attributes

Inherited from:
IterableFactory
def tabulate[A](n1: Int, n2: Int, n3: Int)(f: (Int, Int, Int) => A): CC[CC[CC[A]]]

Attributes

Inherited from:
IterableFactory
def tabulate[A](n1: Int, n2: Int)(f: (Int, Int) => A): CC[CC[A]]

Attributes

Inherited from:
IterableFactory

Attributes

Inherited from:
SeqFactory
def unfold[A, S](init: S)(f: S => Option[(A, S)]): CC[A]

Attributes

Inherited from:
IterableFactory

Implicits

Implicits

implicit def observableBuffer2ObservableList[T](ob: ObservableBuffer[T]): ObservableList[T]

Extracts an `ObservableList` from an ObservableBuffer.

Extracts an `ObservableList` from an ObservableBuffer.

Value parameters

ob

ObservableBuffer

Attributes

Inherited implicits

implicit def iterableFactory[A]: Factory[A, CC[A]]

Attributes

Inherited from:
IterableFactory