Questions tagged [reactfx]

ReactFX is a Java library by Tomas Mikula that extends upon the JDK's JavaFX library. It uses reactive programming techniques in attempt to achieve more concise code, less side effects and less inversion of control, all of which improve the readability of code.

ReactFX is an exploration of (functional) reactive programming techniques for JavaFX. These techniques usually result in more concise code, less side effects and less inversion of control, all of which improve the readability of code.

For further information, refer to the GitHub page.

29 questions
0
votes
1 answer

ReactFX Val, how do I get binding for null status?

In JavaFX's Property you can obtain a boolean binding for null or non null via val.isNull() and val.isNonNull(). What's the equivalence for this in ReactFX? I've tried: val.map(v -> v == null) But it would return a Val with the actual…
Mordechai
  • 15,437
  • 2
  • 41
  • 82
0
votes
2 answers

How to reset the last accumulation value in EventStream?

I have a merged EventStream from N observable values. From this values I want the smallest one. For example: Var a = Var.newSimpleVar(2); Var b = Var.newSimpleVar(3); Var c = Var.newSimpleVar(4); ... …
schlegel11
  • 363
  • 4
  • 8
0
votes
1 answer

How to get the source of a property by subscribing to an event stream?

if I have a JavaFX property and I create an event stream from this property: EventStreams.nonNullValuesOf(node.boundsInParentProperty()) Is there a possibility to set the source (in this case the "node") at creation time or to get this object later…
schlegel11
  • 363
  • 4
  • 8
0
votes
1 answer

Bind a JavaFx property to more than one observable

I am writing a JavaFx control that consists of a sub-control that gets user input, e.g. a TextField. The main component holds a property which represents a parsed representation of the text, e.g. a LocalDateTime. When the user enters something, this…
Jens
  • 9,058
  • 2
  • 26
  • 43
0
votes
0 answers

Type-inference fails when binding ReactFx Var.mapBidirectional to JavaFx property

I am trying to bind a TextField.textProperty() to a ObjectProperty in a custom control. The following code ompiles and runs in Eclipse: package main.java import java.time.LocalDateTime; import org.reactfx.value.Var; import…
Jens
  • 9,058
  • 2
  • 26
  • 43
0
votes
1 answer

How to bind to more than 1 ReactFX observable?

In regular JavaFX i would create a binding on 2 or more observables like this: xxxProperty().bind(Bindings.createObjectBinding(() -> {...}, observable1, observable2, ...)); In ReactFx I was shown that I can create a binding like…
Mark
  • 2,167
  • 4
  • 32
  • 64
0
votes
1 answer

How to create multilevel composition binding?

I was shown how to create a dependency on the containing property of a property using something like Val.selectVar(property, propertyOfProperty). However, i want to know how to continue creating dependencies on the composition graph. so like a…
Mark
  • 2,167
  • 4
  • 32
  • 64
0
votes
1 answer

How to do a custom binding with ReactFX's Var?

In this question I was shown how to deal with the problem of having a property change by changing it's wrapping object and thus not sending updates that it changed. A solution was using ReactFX: class Cell { private final ObjectProperty
Mark
  • 2,167
  • 4
  • 32
  • 64
0
votes
0 answers

UndoFX: A bound value cannot be set

I use UndoFX for the undo and redo functions to a rectangle shape. So far it is working fine for position, size and rotation, except the fillProperty color of the shape. The problem is that i can't bind my shape with the ColorPicker component, i get…
Senpai
  • 515
  • 6
  • 18
0
votes
1 answer

How to implement an undo/redo function for rotating a group?

Thanks to James_D, i have a perfectly working undo/redo function when i move or resize my group. Unfortunately i can't make it work with the rotate too. EDIT: I have made a custom bounding box and the undo/redo is working for the rotate too. But…
Senpai
  • 515
  • 6
  • 18
0
votes
1 answer

UndoFX: Undo/Redo recording every pixel of drag

I'm using UndoFX & ReactFX for implementing the Undo/Redo function for my 2D shape application. The problem is when i move my shape the EventStream records every X/Y pixel of movement. I just want to record the last position (when the user releases…
Senpai
  • 515
  • 6
  • 18
0
votes
1 answer

Using ReactFX to resize stage when nodes become invisible?

I have a JavaFX dashboard that hides and shows components based on complicated contexts, so ReactFX is a great utility for this. I created some nested closures by looping through each node, creating an EventStream off eachvisibleProperty(), and…
tmn
  • 11,121
  • 15
  • 56
  • 112
0
votes
2 answers

Most effective way to turn Observable into ObservableValue/Binding/EventStream?

I will be using RxJava and ReactFX more heavily, but what I am trying to understand is how to reconcile the two since ReactFX does not have an RxJava dependency, so how can the two talk to each other within the same monad? This is especially the…
tmn
  • 11,121
  • 15
  • 56
  • 112
0
votes
0 answers

Animating Text objects using ReactFx

I would like to find out if there is any way of animating Text, such as changing its background colour and adding some fade transitions after a certain period of time using ReactFx. A simple example would be appreciated. Thanks.
1
2