Skip to content

Commit

Permalink
Several minor enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
netopyr committed Feb 11, 2017
1 parent d338b23 commit b1960d7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ public static <T> Update<T> of(T state, Command... commands) {
return new Update<>(state, Array.of(commands));
}

public static <T> Update<T> of(T state, Seq<Command> commands) {
@SafeVarargs
public static <T> Update<T> of(T state, Seq<Command>... commands) {
return new Update<>(state, commands);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.netopyr.reduxfx.vscenegraph.VNode;
import com.netopyr.reduxfx.vscenegraph.event.VEventHandler;
import com.netopyr.reduxfx.vscenegraph.event.VEventType;
import com.netopyr.reduxfx.vscenegraph.property.VChangeListener;
import com.netopyr.reduxfx.vscenegraph.property.VProperty;
import javaslang.collection.Array;
import javaslang.collection.Map;
Expand Down Expand Up @@ -34,6 +35,9 @@ protected BUILDER create(
public BUILDER selected(boolean value) {
return property(SELECTED, value);
}
public BUILDER selected(VChangeListener<Boolean> changeListener) {
return property(SELECTED, changeListener);
}


@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
import com.netopyr.reduxfx.vscenegraph.event.VEventHandler;
import com.netopyr.reduxfx.vscenegraph.event.VEventType;
import com.netopyr.reduxfx.vscenegraph.property.VProperty;
import javafx.stage.WindowEvent;
import javaslang.collection.Array;
import javaslang.collection.Map;

import static com.netopyr.reduxfx.vscenegraph.event.VEventType.CLOSE_REQUEST;

public class StageBuilder<BUILDER extends StageBuilder<BUILDER>> extends Builder<BUILDER> {

private static final String SCENE = "scene";
Expand Down Expand Up @@ -45,4 +48,9 @@ public BUILDER title(String value) {
return property(TITLE, value);
}


public BUILDER onCloseRequest(VEventHandler<WindowEvent> eventHandler) {
return onEvent(CLOSE_REQUEST, eventHandler);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

public enum VEventType {
ACTION("action"),
CLOSE_REQUEST("closeRequest"),
MOUSE_CLICKED("mouseClicked");

private final String name;
Expand Down

0 comments on commit b1960d7

Please sign in to comment.