You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been working on an application for use during brainsurgery using this amazing framework for about a year now. BUt I have now encountered an issue that I have not been able to solve.
I made this custom implementation of an ObservableMapProperty which is backed by a reversed map (value,keys) with some custom impelmentations class ReversableObservableMapProperty<K, V?> (map: ObservableMap<K,V?> = FXCollections.observableMap<K,V?>(hashMapOf())) : SimpleMapProperty<K, V?>(map)
I have a Model : class MappingModel() { val parcelHexagonMapProperty = ReversableObservableMapProperty<ParcelPoint,Hexagon?>() val parcelHexagonMap by parcelHexagonMapProperty }
And and ItemViewModel: class MappingModelView: ItemViewModel<MappingModel>() { val parcelHexagonMap = bind(MappingModel::parcelHexagonMapProperty) }
On build however it throws the following error: java.lang.ClassCastException: class tornadofx.BindingAwareSimpleMapProperty cannot be cast to class com.sasdashboard.ui.utils.ReversableObservableMap (tornadofx.BindingAwareSimpleMapProperty and com.sasdashboard.ui.utils.ReversableObservableMap are in unnamed module of loader 'app')
at line val parcelHexagonMap = bind(MappingModel::parcelHexagonMapProperty)
Any idea what causes the issue? Is it due to my custom MapProperty not being accessible by TornadoFx? Might it be due to kotlin version (as I saw in another similar issue #12 . Any ideas on how to resolve it. I rely a lot on this easy binding of properties and delegation of Mapfunctions.
The text was updated successfully, but these errors were encountered:
I currently fixed it by creating a custom: class BindingAwareReversableObservableMapProperty<S, T>(viewModel: ViewModel, name: String?) : ReversableObservableMap<S, T>(viewModel, name) {
I have been working on an application for use during brainsurgery using this amazing framework for about a year now. BUt I have now encountered an issue that I have not been able to solve.
I made this custom implementation of an ObservableMapProperty which is backed by a reversed map (value,keys) with some custom impelmentations
class ReversableObservableMapProperty<K, V?> (map: ObservableMap<K,V?> = FXCollections.observableMap<K,V?>(hashMapOf())) : SimpleMapProperty<K, V?>(map)
I have a Model :
class MappingModel() {
val parcelHexagonMapProperty = ReversableObservableMapProperty<ParcelPoint,Hexagon?>()
val parcelHexagonMap by parcelHexagonMapProperty
}
And and ItemViewModel:
class MappingModelView: ItemViewModel<MappingModel>() {
val parcelHexagonMap = bind(MappingModel::parcelHexagonMapProperty)
}
On build however it throws the following error:
java.lang.ClassCastException: class tornadofx.BindingAwareSimpleMapProperty cannot be cast to class com.sasdashboard.ui.utils.ReversableObservableMap (tornadofx.BindingAwareSimpleMapProperty and com.sasdashboard.ui.utils.ReversableObservableMap are in unnamed module of loader 'app')
at line
val parcelHexagonMap = bind(MappingModel::parcelHexagonMapProperty)
Any idea what causes the issue? Is it due to my custom MapProperty not being accessible by TornadoFx? Might it be due to kotlin version (as I saw in another similar issue #12 . Any ideas on how to resolve it. I rely a lot on this easy binding of properties and delegation of Mapfunctions.
The text was updated successfully, but these errors were encountered: