本文整理汇总了Java中org.reactfx.value.Val.combine方法的典型用法代码示例。如果您正苦于以下问题:Java Val.combine方法的具体用法?Java Val.combine怎么用?Java Val.combine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.reactfx.value.Val
的用法示例。
在下文中一共展示了Val.combine方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ParagraphBox
import org.reactfx.value.Val; //导入方法依赖的package包/类
ParagraphBox(Paragraph<PS, SEG, S> par, BiConsumer<TextFlow, PS> applyParagraphStyle,
Function<StyledSegment<SEG, S>, Node> nodeFactory) {
this.getStyleClass().add("paragraph-box");
this.text = new ParagraphText<>(par, nodeFactory);
applyParagraphStyle.accept(this.text, par.getParagraphStyle());
this.index = Var.newSimpleVar(0);
getChildren().add(text);
graphic = Val.combine(
graphicFactory,
this.index,
(f, i) -> f != null ? f.apply(i) : null);
graphic.addListener((obs, oldG, newG) -> {
if(oldG != null) {
getChildren().remove(oldG);
}
if(newG != null) {
getChildren().add(newG);
}
});
graphicOffset.addListener(obs -> requestLayout());
}
示例2: ScaledVirtualized
import org.reactfx.value.Val; //导入方法依赖的package包/类
public ScaledVirtualized(V content) {
super();
this.content = content;
getChildren().add(content);
getTransforms().add(zoom);
estHeight = Val.combine(
content.totalHeightEstimateProperty(),
zoom.yProperty(),
(estHeight, scaleFactor) -> estHeight * scaleFactor.doubleValue()
);
estWidth = Val.combine(
content.totalWidthEstimateProperty(),
zoom.xProperty(),
(estWidth, scaleFactor) -> estWidth * scaleFactor.doubleValue()
);
estScrollX = Var.mapBidirectional(
content.estimatedScrollXProperty(),
scrollX -> scrollX * zoom.getX(),
scrollX -> scrollX / zoom.getX()
);
estScrollY = Var.mapBidirectional(
content.estimatedScrollYProperty(),
scrollY -> scrollY * zoom.getY(),
scrollY -> scrollY / zoom.getY()
);
zoom.xProperty() .addListener((obs, ov, nv) -> requestLayout());
zoom.yProperty() .addListener((obs, ov, nv) -> requestLayout());
zoom.zProperty() .addListener((obs, ov, nv) -> requestLayout());
zoom.pivotXProperty().addListener((obs, ov, nv) -> requestLayout());
zoom.pivotYProperty().addListener((obs, ov, nv) -> requestLayout());
zoom.pivotZProperty().addListener((obs, ov, nv) -> requestLayout());
}
示例3: minYProperty
import org.reactfx.value.Val; //导入方法依赖的package包/类
default Val<Double> minYProperty(Node node) {
return Val.combine(
layoutYProperty(node),
node.layoutBoundsProperty(),
(layoutY, layoutBounds) -> layoutY.doubleValue() + minY(layoutBounds));
}