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.
- Source
- ObservableArray.scala
- Alphabetic
- By Inheritance
- ObservableArray
- Observable
- SFXDelegate
- Builder
- Growable
- Clearable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def addAll(src: T, srcIdx: Int, length: Int): Unit
Append portion of given regular array to the end of this array.
Append portion of given regular array to the end of this array.
Capacity is increased, if necessary, to match the new size of the data.
- src
Elements to be appended.
- srcIdx
Start position in the
srcarray.- length
Number of data elements to be appended.
- Exceptions thrown
java.lang.ArrayIndexOutOfBoundsExceptionif copying would cause access out ofsrcarray bounds.java.lang.ArrayStoreExceptionif element insrcarray could not be stored in this array due to a type mismatch.java.lang.NullPointerExceptionifsrcisnull.
- abstract def addAll(src: Array[V], srcIdx: Int, length: Int): Unit
Append portion of given regular array to the end of this array.
Append portion of given regular array to the end of this array.
Capacity is increased, if necessary, to match the new size of the data.
- src
Elements to be appended.
- srcIdx
Start position in the
srcarray.- length
Number of data elements to be appended.
- Exceptions thrown
java.lang.ArrayIndexOutOfBoundsExceptionif copying would cause access out ofsrcarray bounds.java.lang.ArrayStoreExceptionif element insrcarray could not be stored in this array due to a type mismatch.java.lang.NullPointerExceptionifsrcisnull.
- abstract def addAll(elems: V*): Unit
Append given
elementsto the end of this array.Append given
elementsto the end of this array.Capacity is increased, if necessary, to match the new size of the data.
- elems
Elements to be appended.
- Exceptions thrown
java.lang.ArrayStoreExceptionif element inelementscould not be stored in this array due to a type mismatch.java.lang.NullPointerExceptionifelementsisnull.
- abstract def addAll(src: T): Unit
Append given observable array to the end of this array.
Append given observable array to the end of this array.
Capacity is increased, if necessary, to match the new size of the data.
- src
Elements to be appended.
- Exceptions thrown
java.lang.ArrayStoreExceptionif element insrcarray could not be stored in this array due to a type mismatch.java.lang.NullPointerExceptionifsrcisnull.
- abstract def copyTo(srcIdx: Int, dest: T, destIdx: Int, length: Int): Unit
Copy specified portion of this observable array to
destobservable array.Copy specified portion of this observable array to
destobservable array.- srcIdx
Start position in this array.
- dest
Array into which the portion of this array is to be copied.
- destIdx
Start position in the
destarray.- length
Number of data elements to be copied.
- Exceptions thrown
java.lang.ArrayIndexOutOfBoundsExceptionif copying would cause access out of either array bounds.java.lang.ArrayStoreExceptionif element in this array could not be stored indestarray due to a type mismatch.java.lang.NullPointerExceptionifdestisnull.
- abstract def copyTo(srcIdx: Int, dest: Array[V], destIdx: Int, length: Int): Unit
Copy specified portion of this observable array to
destregular array.Copy specified portion of this observable array to
destregular array.- srcIdx
Start position in this array.
- dest
Array into which the portion of this array is to be copied.
- destIdx
Start position in the
destarray.- length
Number of data elements to be copied.
- Exceptions thrown
java.lang.ArrayIndexOutOfBoundsExceptionif copying would cause access out of either array bounds.java.lang.ArrayStoreExceptionif element in this array could not be stored indestarray due to a type mismatch.java.lang.NullPointerExceptionifdestisnull.
- abstract def get(idx: Int): V
Select the element at
idxin the array.Select the element at
idxin the array.- idx
Index of selected element.
- returns
Element at given
idx.
- Exceptions thrown
java.lang.ArrayIndexOutOfBoundsExceptionifidxdoes not satisfy0 <= idx < length.
- abstract def set(destIdx: Int, src: T, srcIdx: Int, length: Int): Unit
Copy a portion of given observable array into this array, replacing affected contents.
Copy a portion of given observable array into this array, replacing affected contents.
- destIdx
Start position in this array.
- src
Array containing data to be copied.
- srcIdx
Start position in
srcarray.- length
Number of data elements to be copied.
- Exceptions thrown
java.lang.ArrayIndexOutOfBoundsExceptionif copying would cause access out of array bounds.java.lang.ArrayStoreExceptionif element insrccould not be stored in this array due to a type mismatch.java.lang.NullPointerExceptionifsrcisnull.
- abstract def set(destIdx: Int, src: Array[V], srcIdx: Int, length: Int): Unit
Copy a portion of given regular array into this array, replacing affected contents.
Copy a portion of given regular array into this array, replacing affected contents.
- destIdx
Start position in this array.
- src
Array containing data to be copied.
- srcIdx
Start position in
srcarray.- length
Number of data elements to be copied.
- Exceptions thrown
java.lang.ArrayIndexOutOfBoundsExceptionif copying would cause access out of array bounds.java.lang.ArrayStoreExceptionif element insrccould not be stored in this array due to a type mismatch.java.lang.NullPointerExceptionifsrcisnull.
- abstract def set(idx: Int, value: V): Unit
Set the element at
idxin the array tovalue.Set the element at
idxin the array tovalue.- idx
Index of element to be changed.
- value
New value for element at
idx.
- Exceptions thrown
java.lang.ArrayIndexOutOfBoundsExceptionifidxdoes not satisfy0 <= idx < length.
- abstract def setAll(src: T, srcIdx: Int, length: Int): Unit
Replace the contents of this array with portion of the given observable array.
Replace the contents of this array with portion of the given observable array.
Capacity is increased, if necessary, to match the new size of the data.
- src
Array to replace contents this array.
- srcIdx
Start position in the
srcarray.- length
Number of data elements to be copied.
- Exceptions thrown
java.lang.ArrayIndexOutOfBoundsExceptionif copying would cause access out of array bounds.java.lang.ArrayStoreExceptionif element insrccould not be stored in this array due to a type mismatch.java.lang.NullPointerExceptionifsrcisnull.
- abstract def setAll(src: Array[V], srcIdx: Int, length: Int): Unit
Replace the contents of this array with portion of the given regular array.
Replace the contents of this array with portion of the given regular array.
Capacity is increased, if necessary, to match the new size of the data.
- src
Array to replace contents this array.
- srcIdx
Start position in the
srcarray.- length
Number of data elements to be copied.
- Exceptions thrown
java.lang.ArrayIndexOutOfBoundsExceptionif copying would cause access out of array bounds.java.lang.ArrayStoreExceptionif element insrccould not be stored in this array due to a type mismatch.java.lang.NullPointerExceptionifsrcisnull.
- abstract def setAll(src: T): Unit
Replace the contents of this array with the given observable array.
Replace the contents of this array with the given observable array.
Capacity is increased, if necessary, to match the new size of the data.
- src
Array to replace contents this array.
- Exceptions thrown
java.lang.ArrayStoreExceptionif element insrccould not be stored in this array due to a type mismatch.java.lang.NullPointerExceptionifsrcisnull.
- abstract def setAll(elems: V*): Unit
Replace the contents of this array with the given
elements.Replace the contents of this array with the given
elements.Capacity is increased, if necessary, to match the new size of the data.
- elems
New contents of this array.
- Exceptions thrown
java.lang.ArrayStoreExceptionif element inelementscould not be stored in this array due to a type mismatch.java.lang.NullPointerExceptionifelementsisnull.
- abstract def toArray(srcIdx: Int, dest: Array[V], length: Int): Array[V]
Write a portion of this array's contents into the specified array, if it is large enough, or a new array if it is not.
Write a portion of this array's contents into the specified array, if it is large enough, or a new array if it is not.
- srcIdx
Start position in this array.
- dest
Array into which this array will be written, if large enough to hold this array's contents. If
null, this argument is ignored.- length
Number of data elements to be copied.
- returns
The
destarray if it is large enough to hold this array's data, or a new array, containing this array's copied contents.
- Exceptions thrown
java.lang.ArrayStoreExceptionif element insrccould not be stored in this array due to a type mismatch.
- abstract def toArray(dest: Array[V]): Array[V]
Write the contents of this array into the specified array, if it is large enough, or a new array if it is not.
Write the contents of this array into the specified array, if it is large enough, or a new array if it is not.
- dest
Array into which this array will be written, if large enough to hold this array's contents. If
null, this argument is ignored.- returns
The
destarray if it is large enough to hold this array's data, or a new array, containing this array's copied contents.
- Exceptions thrown
java.lang.ArrayStoreExceptionif element insrccould not be stored in this array due to a type mismatch.
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def ++=(src: T): T
Append another observable array to this array.
Append another observable array to this array.
- src
Array to be appended to this array.
- returns
This array, expanded to contain the indicated array.
- def ++=(src: Array[V]): T
Append another array to this array.
Append another array to this array.
- src
Array to be appended to this array.
- returns
This array, expanded to contain the indicated array.
- final def ++=(xs: IterableOnce[V]): ObservableArray.this.type
- Definition Classes
- Growable
- Annotations
- @inline()
- final def +=(elem: V): ObservableArray.this.type
- Definition Classes
- Growable
- Annotations
- @inline()
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def addAll(xs: IterableOnce[V]): ObservableArray.this.type
- Definition Classes
- Growable
- def addOne(elem: V): ObservableArray.this.type
Append new element to this
ObservableArray.Append new element to this
ObservableArray.- elem
Element to be added to end of this array.
- returns
This
ObservableArray.
- Definition Classes
- ObservableArray → Growable
- def apply(idx: Int): V
Select an element by its index in the array.
Select an element by its index in the array.
- idx
Index of selected element.
- returns
Element at given
idx.
- Exceptions thrown
java.lang.ArrayIndexOutOfBoundsExceptionifidxdoes not satisfy0 <= idx < length.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clear(): Unit
Empty array, clearing builder contents, resizing it to zero.
Empty array, clearing builder contents, resizing it to zero.
Capacity is unchanged.
- Definition Classes
- ObservableArray → Builder → Clearable
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- val delegate: D
JavaFX object to be wrapped.
JavaFX object to be wrapped.
- Definition Classes
- ObservableArray → SFXDelegate
- def ensureCapacity(capacity: Int): Unit
Grow array capacity if currently smaller than given
capacity; do nothing otherwise.Grow array capacity if currently smaller than given
capacity; do nothing otherwise.- capacity
Required capacity.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(ref: Any): Boolean
Verifies if a object is equals to this delegate.
Verifies if a object is equals to this delegate.
- ref
Object to be compared.
- returns
if the other object is equals to this delegate or not.
- Definition Classes
- SFXDelegate → AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- returns
The delegate hashcode
- Definition Classes
- SFXDelegate → AnyRef → Any
- def isEmpty: Boolean
Tests whether the collection is empty.
Tests whether the collection is empty.
- returns
trueif the collection contains no elements,falseotherwise.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def knownSize: Int
- Definition Classes
- Growable
- def length: Int
Alias for size
- def mapResult[NewTo](f: (T) => NewTo): Builder[V, NewTo]
- Definition Classes
- Builder
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def nonEmpty: Boolean
Tests whether the collection is not empty.
Tests whether the collection is not empty.
- returns
trueif the collection contains at least one element,falseotherwise.
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def onChange(op: => Unit): Subscription
Add a listener function to
Array's changes.Add a listener function to
Array's changes.- op
Function that will handle this
ObservableArray's modifications data, to be activated when some change is made.
- Note
This function will not handle this array's modifications data. That is, it will be notified that an array it is associated with has changed, but not which array the which data within it was changed.
- def onChange(op: (T, Change) => Unit): Subscription
Add a listener function to
Array's changes.Add a listener function to
Array's changes.- op
Function that will handle this
ObservableArray's modifications data, to be activated when some change is made.
- Note
This function will handle this array's modifications data. That is, it will be notified which array has been modified and which array elements have been changed.
- def onInvalidate(op: => Unit): Subscription
Adds a no argument function as a JavaFX
InvalidationListener.Adds a no argument function as a JavaFX
InvalidationListener. This function has no arguments because it will not handle invalidated values.- op
A Function with no arguments. It will be called when value was invalidated.
- returns
A new scalafx.event.subscriptions.Subscription to remove JavaFX
InvalidationListener.
- Definition Classes
- Observable
- def onInvalidate(op: (Observable) => Unit): Subscription
Adds a function as a JavaFX
InvalidationListener.Adds a function as a JavaFX
InvalidationListener. This function has all arguments frominvalidatedmethod fromInvalidationListener.- op
Function that receives a ScalaFX
Observable. It will be called when value was invalidated.- returns
A new scalafx.event.subscriptions.Subscription to remove JavaFX
InvalidationListener.
- Definition Classes
- Observable
- def result(): T
Produces collection from builder.
Produces collection from builder.
- returns
This
ObservableArray.
- Definition Classes
- ObservableArray → Builder
- def size: Int
Retrieve length of data in this array.
Retrieve length of data in this array.
- returns
Length of data in this array.
- final def sizeHint(coll: IterableOnce[_], delta: Int): Unit
- Definition Classes
- Builder
- def sizeHint(size: Int): Unit
- Definition Classes
- Builder
- final def sizeHintBounded(size: Int, boundingColl: Iterable[_]): Unit
- Definition Classes
- Builder
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toArray: Array[V]
Translate this observable array to a regular array.
Translate this observable array to a regular array.
- returns
Regular array containing this array's contents.
- def toString(): String
- returns
Returns the original delegate's
toString()adding a[SFX]prefix.
- Definition Classes
- SFXDelegate → AnyRef → Any
- def trimToSize(): Unit
Shrinks capacity to current length of data in this array.
- def update(idx: Int, value: V): Unit
Set the element at
idxin the array tovalue.Set the element at
idxin the array tovalue.- idx
Index of element to be changed.
- value
New value for element at
idx.
- Exceptions thrown
java.lang.ArrayIndexOutOfBoundsExceptionifidxdoes not satisfy0 <= idx < length.
- 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])
Deprecated Value Members
- final def +=(elem1: V, elem2: V, elems: V*): ObservableArray.this.type
- Definition Classes
- Growable
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 2.13.0) Use
++=akaaddAllinstead of varargs+=; infix operations with an operand of multiple args will be deprecated
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
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.animationcorresponds tojavafx.animation.Example Usage
A basic ScalaFX application is created creating an object that is an instance of
JFXApp3. Following Java FX theatre metaphor, it contains astagethat contains ascene. Astageroughly corresponds to a window in a typical UI environment. Thesceneholds UI content presented to the user. In the example below, the content is a pane with a singlelabelcomponent.