diff --git a/docs/concepts/observable/observable.md b/docs/concepts/observable/observable.md index cef1901f11..b043353698 100644 --- a/docs/concepts/observable/observable.md +++ b/docs/concepts/observable/observable.md @@ -15,12 +15,20 @@ layout: default [BooleanPropertyKDoc]: https://tudo-aqua.github.io/bgw/kotlin-docs/bgw-core/tools.aqua.bgw.observable/-boolean-property/index.html [IntegerPropertyKDoc]: https://tudo-aqua.github.io/bgw/kotlin-docs/bgw-core/tools.aqua.bgw.observable/-integer-property/index.html [DoublePropertyKDoc]: https://tudo-aqua.github.io/bgw/kotlin-docs/bgw-core/tools.aqua.bgw.observable/-double-property/index.html +[LimitedDoublePropertyKDoc]: https://tudo-aqua.github.io/bgw/kotlin-docs/bgw-core/tools.aqua.bgw.observable.properties/-limited-double-property/index.html [StringPropertyKDoc]: https://tudo-aqua.github.io/bgw/kotlin-docs/bgw-core/tools.aqua.bgw.observable/-string-property/index.html +[ReadonlyPropertyKDoc]: https://tudo-aqua.github.io/bgw/kotlin-docs/bgw-core/tools.aqua.bgw.observable.properties/-readonly-property/index.html +[ReadonlyBooleanPropertyKDoc]: https://tudo-aqua.github.io/bgw/kotlin-docs/bgw-core/tools.aqua.bgw.observable/-readonly-boolean-property/index.html +[ReadonlyIntegerPropertyKDoc]: https://tudo-aqua.github.io/bgw/kotlin-docs/bgw-core/tools.aqua.bgw.observable/-readonly-integer-property/index.html +[ReadonlyDoublePropertyKDoc]: https://tudo-aqua.github.io/bgw/kotlin-docs/bgw-core/tools.aqua.bgw.observable/-readonly-double-property/index.html +[ReadonlyStringPropertyKDoc]: https://tudo-aqua.github.io/bgw/kotlin-docs/bgw-core/tools.aqua.bgw.observable/-readonly-string-property/index.html + [ObservableListKDoc]: https://tudo-aqua.github.io/bgw/kotlin-docs/bgw-core/tools.aqua.bgw.observable/-observable-list/index.html [ObservableArrayListKDoc]: https://tudo-aqua.github.io/bgw/kotlin-docs/bgw-core/tools.aqua.bgw.observable/-observable-array-list/index.html [ObservableLinkedListKDoc]: https://tudo-aqua.github.io/bgw/kotlin-docs/bgw-core/tools.aqua.bgw.observable/-observable-linked-list/index.html +[IllegalArgumentExceptionKDoc]: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-illegal-argument-exception/ # Observable @@ -44,7 +52,7 @@ by [Property#addListener][addListenerKDoc] or [Property#addListenerAndInvoke][addListenerAndInvokeKDoc] which also invokes it with the given value. Note that the given value is not set to the backing field. Every time the value of this observable is set it invokes all listeners if and only if the new value is not equal the old one. If -all listeners with the current value should be invoked, use [Property#notifyUnchanged][notifyUnchangedKDoc]. +all listeners should be invoked with the current value, use [Property#notifyUnchanged][notifyUnchangedKDoc]. For common data types there are dedicated classes: * [BooleanProperty][BooleanPropertyKDoc] @@ -54,6 +62,16 @@ For common data types there are dedicated classes: For generic types use the baseclass [Property][PropertyKDoc]. +The [LimitedDoubleProperty][LimitedDoublePropertyKDoc] behaves like a [DoubleProperty][DoublePropertyKDoc] +but throws an [IllegalArgumentException][IllegalArgumentExceptionKDoc] is a value is set that exceeds its bounds given as constructor parameter. + +The framework uses equivalent [ReadonlyProperties][ReadonlyPropertyKDoc] for one way communication. These come in the same variety: +* [ReadonlyBooleanProperty][ReadonlyBooleanPropertyKDoc] +* [ReadonlyIntegerProperty][ReadonlyIntegerPropertyKDoc] +* [ReadonlyDoubleProperty][ReadonlyDoublePropertyKDoc] +* [ReadonlyStringProperty][ReadonlyStringPropertyKDoc] +* [ReadonlyProperty][ReadonlyPropertyKDoc]. + ## Observable Lists The [ObservableList][ObservableListKDoc] work exactly like Properties. It provides all standard list operations and notifies listeners every