本文整理汇总了Java中javafx.beans.property.ObjectProperty.set方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectProperty.set方法的具体用法?Java ObjectProperty.set怎么用?Java ObjectProperty.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.beans.property.ObjectProperty
的用法示例。
在下文中一共展示了ObjectProperty.set方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initializeDeclarations
import javafx.beans.property.ObjectProperty; //导入方法依赖的package包/类
private void initializeDeclarations() {
// Initially style the declarations
declaration.setStyleSpans(0, ComponentPresentation.computeHighlighting(getComponent().getDeclarations()));
final Circle circle = new Circle(0);
if(getComponent().isDeclarationOpen()) {
circle.setRadius(1000);
}
final ObjectProperty<Node> clip = new SimpleObjectProperty<>(circle);
declaration.clipProperty().bind(clip);
clip.set(circle);
}
示例2: toggleDeclaration
import javafx.beans.property.ObjectProperty; //导入方法依赖的package包/类
public void toggleDeclaration(final MouseEvent mouseEvent) {
final Circle circle = new Circle(0);
circle.setCenterX(component.get().getWidth() - (toggleDeclarationButton.getWidth() - mouseEvent.getX()));
circle.setCenterY(-1 * mouseEvent.getY());
final ObjectProperty<Node> clip = new SimpleObjectProperty<>(circle);
declaration.clipProperty().bind(clip);
final Transition rippleEffect = new Transition() {
private final double maxRadius = Math.sqrt(Math.pow(getComponent().getWidth(), 2) + Math.pow(getComponent().getHeight(), 2));
{
setCycleDuration(Duration.millis(500));
}
protected void interpolate(final double fraction) {
if (getComponent().isDeclarationOpen()) {
circle.setRadius(fraction * maxRadius);
} else {
circle.setRadius(maxRadius - fraction * maxRadius);
}
clip.set(circle);
}
};
final Interpolator interpolator = Interpolator.SPLINE(0.785, 0.135, 0.15, 0.86);
rippleEffect.setInterpolator(interpolator);
rippleEffect.play();
getComponent().declarationOpenProperty().set(!getComponent().isDeclarationOpen());
}
示例3: moveChildByGroupPosition
import javafx.beans.property.ObjectProperty; //导入方法依赖的package包/类
private void moveChildByGroupPosition(NodeModel childNode, KeyFrameModel keyFrame, int factor) {
ObjectProperty<Object> x = keyFrame.getKeyValues().get(childNode).get(AnimatableField.LAYOUT_X).valueProperty();
ObjectProperty<Object> y = keyFrame.getKeyValues().get(childNode).get(AnimatableField.LAYOUT_Y).valueProperty();
if (x.get() != null) {
x.set(((Double) x.get()) + factor * groupPosition.getX());
}
if (y.get() != null) {
y.set(((Double) y.get()) + factor * groupPosition.getY());
}
}
示例4: bind
import javafx.beans.property.ObjectProperty; //导入方法依赖的package包/类
private void bind(ObjectProperty<String> objectProperty, StringProperty stringProperty) {
objectProperty.set(stringProperty.get());
}
示例5: bindDoubleBidirectional
import javafx.beans.property.ObjectProperty; //导入方法依赖的package包/类
public static void bindDoubleBidirectional(ObjectProperty<Object> keyValueProperty, ObjectProperty<Double> doubleProperty) {
doubleProperty.addListener((v, o, n) -> keyValueProperty.set(n));
keyValueProperty.addListener((v, o, n) -> doubleProperty.set(n instanceof Double ? (Double) n : null));
doubleProperty.set(keyValueProperty.get() instanceof Double ? (Double) keyValueProperty.get() : null);
}
示例6: bindColorBidirectional
import javafx.beans.property.ObjectProperty; //导入方法依赖的package包/类
public static void bindColorBidirectional(ObjectProperty<Object> keyValueProperty, ObjectProperty<Color> colorProperty) {
colorProperty.addListener((v, o, n) -> keyValueProperty.set(n));
keyValueProperty.addListener((v, o, n) -> colorProperty.set(n instanceof Color ? (Color) n : null));
keyValueProperty.set(colorProperty.get());
}