Skip to content

Commit

Permalink
Merge pull request #94 from pvnhome/3.0.0
Browse files Browse the repository at this point in the history
The project was adapted to RxJava v3.0.1
  • Loading branch information
thomasnield authored May 25, 2020
2 parents a4ba5cc + 74aa7e0 commit 9f61f94
Show file tree
Hide file tree
Showing 28 changed files with 89 additions and 91 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ repositories {
}

dependencies {
compile 'io.reactivex.rxjava2:rxjava:2.2.4'
compile 'io.reactivex.rxjava3:rxjava:3.0.1'
compile "org.openjfx:javafx-base:11:${platform}"
compile "org.openjfx:javafx-graphics:11:${platform}"
compile "org.openjfx:javafx-controls:11:${platform}"
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GROUP=io.reactivex.rxjava2
VERSION_NAME=2.11.0-RC34
GROUP=io.reactivex.rxjava3
VERSION_NAME=3.0.0
POM_NAME=RxJavaFX
POM_PACKAGING=jar
POM_DESCRIPTION=RxJava extensions for JavaFX
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
package io.reactivex.rxjavafx.observables;


import io.reactivex.Maybe;
import io.reactivex.Observable;
import io.reactivex.rxjava3.core.Maybe;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjavafx.sources.*;
import javafx.beans.value.ObservableValue;
import javafx.collections.ObservableList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
*/
package io.reactivex.rxjavafx.observers;

import io.reactivex.Observer;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
import io.reactivex.functions.Function;
import io.reactivex.observables.ConnectableObservable;
import io.reactivex.rxjava3.core.Observer;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.functions.Consumer;
import io.reactivex.rxjava3.functions.Function;
import io.reactivex.rxjava3.observables.ConnectableObservable;
import javafx.beans.binding.Binding;
import javafx.beans.value.ObservableValue;
import javafx.collections.ObservableList;
Expand Down Expand Up @@ -69,7 +69,7 @@ public void onNext(T t) {
try {
value = unmaskingFunction.apply(t);
fireChange();
} catch (Exception e) {
} catch (Throwable e) {
onError(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
*/
package io.reactivex.rxjavafx.observers;

import io.reactivex.flowables.ConnectableFlowable;
import io.reactivex.functions.Consumer;
import io.reactivex.functions.Function;
import io.reactivex.rxjava3.flowables.ConnectableFlowable;
import io.reactivex.rxjava3.functions.Consumer;
import io.reactivex.rxjava3.functions.Function;
import javafx.beans.binding.Binding;
import javafx.beans.value.ObservableValue;
import javafx.collections.ObservableList;
Expand Down Expand Up @@ -70,7 +70,7 @@ public void onNext(T t) {
try {
value = unmaskingFunction.apply(t);
fireChange();
} catch (Exception e) {
} catch (Throwable e) {
onError(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

import java.util.Optional;

import io.reactivex.Observable;
import io.reactivex.functions.Consumer;
import io.reactivex.observables.ConnectableObservable;
import io.reactivex.plugins.RxJavaPlugins;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.functions.Consumer;
import io.reactivex.rxjava3.observables.ConnectableObservable;
import io.reactivex.rxjava3.plugins.RxJavaPlugins;
import io.reactivex.rxjavafx.observables.JavaFxObservable;
import javafx.beans.binding.Binding;
import javafx.beans.value.ObservableValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
*/
package io.reactivex.rxjavafx.observers;

import io.reactivex.Flowable;
import io.reactivex.flowables.ConnectableFlowable;
import io.reactivex.functions.Consumer;
import io.reactivex.plugins.RxJavaPlugins;
import io.reactivex.rxjava3.core.Flowable;
import io.reactivex.rxjava3.flowables.ConnectableFlowable;
import io.reactivex.rxjava3.functions.Consumer;
import io.reactivex.rxjava3.plugins.RxJavaPlugins;
import io.reactivex.rxjavafx.observables.JavaFxObservable;
import javafx.beans.binding.Binding;
import javafx.beans.value.ObservableValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
*/
package io.reactivex.rxjavafx.schedulers;

import io.reactivex.Scheduler;
import io.reactivex.disposables.Disposable;
import io.reactivex.disposables.Disposables;
import io.reactivex.rxjava3.core.Scheduler;
import io.reactivex.rxjava3.disposables.Disposable;
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.application.Platform;
Expand Down Expand Up @@ -118,7 +117,7 @@ public Disposable schedule(final Runnable action, long delayTime, TimeUnit unit)
final Timeline timer = new Timeline(new KeyFrame(Duration.millis(delay), event -> schedule(queuedRunnable)));
timer.play();

return Disposables.fromRunnable(() -> {
return Disposable.fromRunnable(() -> {
queuedRunnable.dispose();
timer.stop();
});
Expand All @@ -127,7 +126,7 @@ public Disposable schedule(final Runnable action, long delayTime, TimeUnit unit)
@Override
public Disposable schedule(final Runnable action) {
if (isDisposed()) {
return Disposables.disposed();
return Disposable.disposed();
}

final QueuedRunnable queuedRunnable = action instanceof QueuedRunnable ? (QueuedRunnable) action : new QueuedRunnable(action);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
package io.reactivex.rxjavafx.sources;

import io.reactivex.Observable;
import io.reactivex.ObservableEmitter;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.core.ObservableEmitter;
import io.reactivex.rxjavafx.schedulers.JavaFxScheduler;
import io.reactivex.rxjavafx.subscriptions.JavaFxSubscriptions;
import javafx.event.ActionEvent;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/reactivex/rxjavafx/sources/DialogSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
package io.reactivex.rxjavafx.sources;

import io.reactivex.Maybe;
import io.reactivex.Single;
import io.reactivex.rxjava3.core.Maybe;
import io.reactivex.rxjava3.core.Single;
import io.reactivex.rxjavafx.schedulers.JavaFxScheduler;
import javafx.scene.control.Dialog;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
package io.reactivex.rxjavafx.sources;

import io.reactivex.Observable;
import io.reactivex.ObservableEmitter;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.core.ObservableEmitter;
import io.reactivex.rxjavafx.schedulers.JavaFxScheduler;
import io.reactivex.rxjavafx.subscriptions.JavaFxSubscriptions;
import javafx.event.Event;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
package io.reactivex.rxjavafx.sources;

import io.reactivex.Observable;
import io.reactivex.ObservableOnSubscribe;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.core.ObservableOnSubscribe;
import io.reactivex.rxjavafx.observables.JavaFxObservable;
import io.reactivex.rxjavafx.schedulers.JavaFxScheduler;
import io.reactivex.rxjavafx.subscriptions.JavaFxSubscriptions;
Expand All @@ -42,7 +42,7 @@ public static <T> Observable<ObservableList<T>> fromObservableList(final Observa
if (source instanceof ListProperty<?>) {
return JavaFxObservable.valuesOf((ListProperty<T>) source);
} else {
return mutations.startWith(source);
return mutations.startWithArray(source);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
package io.reactivex.rxjavafx.sources;

import io.reactivex.Observable;
import io.reactivex.ObservableOnSubscribe;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.core.ObservableOnSubscribe;
import io.reactivex.rxjavafx.observables.JavaFxObservable;
import io.reactivex.rxjavafx.subscriptions.JavaFxSubscriptions;
import javafx.beans.property.ListProperty;
Expand All @@ -43,7 +43,7 @@ public static <K,T> Observable<ObservableMap<K,T>> fromObservableMap(final Obser
if (source instanceof MapProperty<?,?>) {
return JavaFxObservable.valuesOf((MapProperty<K,T>) source);
} else {
return mutations.startWith(source);
return mutations.startWithArray(source);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
package io.reactivex.rxjavafx.sources;

import io.reactivex.Observable;
import io.reactivex.ObservableOnSubscribe;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.core.ObservableOnSubscribe;
import io.reactivex.rxjavafx.observables.JavaFxObservable;
import io.reactivex.rxjavafx.schedulers.JavaFxScheduler;
import io.reactivex.rxjavafx.subscriptions.JavaFxSubscriptions;
Expand All @@ -38,7 +38,7 @@ public static <T> Observable<ObservableSet<T>> fromObservableSet(final Observabl
if (source instanceof SetProperty<?>) {
return JavaFxObservable.valuesOf((SetProperty<T>) source);
} else {
return mutations.startWith(source);
return mutations.startWithArray(source);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
package io.reactivex.rxjavafx.sources;

import io.reactivex.Observable;
import io.reactivex.ObservableEmitter;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.core.ObservableEmitter;
import io.reactivex.rxjavafx.subscriptions.JavaFxSubscriptions;
import javafx.beans.InvalidationListener;
import javafx.beans.value.ChangeListener;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
package io.reactivex.rxjavafx.sources;

import io.reactivex.Observable;
import io.reactivex.ObservableOnSubscribe;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.core.ObservableOnSubscribe;
import io.reactivex.rxjavafx.schedulers.JavaFxScheduler;
import io.reactivex.rxjavafx.subscriptions.JavaFxSubscriptions;
import javafx.event.Event;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package io.reactivex.rxjavafx.sources;

import io.reactivex.Observable;
import io.reactivex.rxjava3.core.Observable;
import javafx.animation.Animation;
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
package io.reactivex.rxjavafx.sources;

import io.reactivex.Observable;
import io.reactivex.ObservableEmitter;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.core.ObservableEmitter;
import io.reactivex.rxjavafx.schedulers.JavaFxScheduler;
import io.reactivex.rxjavafx.subscriptions.JavaFxSubscriptions;
import javafx.event.EventHandler;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package io.reactivex.rxjavafx.subscriptions;

import io.reactivex.exceptions.Exceptions;
import io.reactivex.rxjava3.exceptions.Exceptions;
import javafx.beans.binding.Binding;

import java.util.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
package io.reactivex.rxjavafx.subscriptions;


import io.reactivex.Scheduler;
import io.reactivex.disposables.Disposable;
import io.reactivex.disposables.Disposables;
import javafx.application.Platform;;
import io.reactivex.rxjava3.core.Scheduler;
import io.reactivex.rxjava3.disposables.Disposable;
import javafx.application.Platform;
import io.reactivex.rxjavafx.schedulers.JavaFxScheduler;


Expand All @@ -36,7 +35,7 @@ private JavaFxSubscriptions() {
* @return an Disposable that always runs <code>unsubscribe</code> in the event dispatch thread.
*/
public static Disposable unsubscribeInEventDispatchThread(final Runnable unsubscribe) {
return Disposables.fromRunnable(() -> {
return Disposable.fromRunnable(() -> {
if (Platform.isFxApplicationThread()) {
unsubscribe.run();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
*/
package io.reactivex.rxjavafx.transformers;

import io.reactivex.FlowableOperator;
import io.reactivex.FlowableTransformer;
import io.reactivex.exceptions.Exceptions;
import io.reactivex.functions.Action;
import io.reactivex.functions.Consumer;
import io.reactivex.subscribers.ResourceSubscriber;
import io.reactivex.rxjava3.core.FlowableOperator;
import io.reactivex.rxjava3.core.FlowableTransformer;
import io.reactivex.rxjava3.exceptions.Exceptions;
import io.reactivex.rxjava3.functions.Action;
import io.reactivex.rxjava3.functions.Consumer;
import io.reactivex.rxjava3.subscribers.ResourceSubscriber;
import javafx.application.Platform;
import org.reactivestreams.Subscriber;
import org.reactivestreams.Subscription;
Expand Down Expand Up @@ -190,7 +190,7 @@ public void onComplete() {
try {
if (ctObserver.doOnCompletedCountAction != null)
ctObserver.doOnCompletedCountAction.accept(count);
} catch (Exception e) {
} catch (Throwable e) {
Exceptions.throwIfFatal(e);
onError(e);
return;
Expand All @@ -206,7 +206,7 @@ public void onError(Throwable e) {
try {
if (ctObserver.doOnErrorCountAction != null)
ctObserver.doOnErrorCountAction.accept(count);
} catch(Exception e1) {
} catch(Throwable e1) {
Exceptions.throwIfFatal(e1);
child.onError(e1);
}
Expand All @@ -220,7 +220,7 @@ public void onNext(T t) {
++count;
if (ctObserver.doOnNextCountAction != null)
ctObserver.doOnNextCountAction.accept(count);
} catch(Exception e) {
} catch(Throwable e) {
Exceptions.throwIfFatal(e);
onError(e);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@

package io.reactivex.rxjavafx.transformers;

import io.reactivex.ObservableOperator;
import io.reactivex.ObservableTransformer;
import io.reactivex.Observer;
import io.reactivex.disposables.Disposable;
import io.reactivex.exceptions.Exceptions;
import io.reactivex.functions.Action;
import io.reactivex.functions.Consumer;
import io.reactivex.observers.ResourceObserver;
import io.reactivex.rxjava3.core.ObservableOperator;
import io.reactivex.rxjava3.core.ObservableTransformer;
import io.reactivex.rxjava3.core.Observer;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.exceptions.Exceptions;
import io.reactivex.rxjava3.functions.Action;
import io.reactivex.rxjava3.functions.Consumer;
import io.reactivex.rxjava3.observers.ResourceObserver;
import javafx.application.Platform;


Expand Down Expand Up @@ -183,7 +183,7 @@ public void onComplete() {
try {
if (ctObserver.doOnCompletedCountAction != null)
ctObserver.doOnCompletedCountAction.accept(count);
} catch (Exception e) {
} catch (Throwable e) {
Exceptions.throwIfFatal(e);
onError(e);
return;
Expand All @@ -199,7 +199,7 @@ public void onError(Throwable e) {
try {
if (ctObserver.doOnErrorCountAction != null)
ctObserver.doOnErrorCountAction.accept(count);
} catch(Exception e1) {
} catch(Throwable e1) {
Exceptions.throwIfFatal(e1);
child.onError(e1);
}
Expand All @@ -213,7 +213,7 @@ public void onNext(T t) {
++count;
if (ctObserver.doOnNextCountAction != null)
ctObserver.doOnNextCountAction.accept(count);
} catch(Exception e) {
} catch(Throwable e) {
Exceptions.throwIfFatal(e);
onError(e);
return;
Expand Down
Loading

0 comments on commit 9f61f94

Please sign in to comment.