当前位置: 首页>>代码示例>>Java>>正文


Java ObjectProperty.set方法代码示例

本文整理汇总了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);
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:13,代码来源:ComponentController.java

示例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());
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:32,代码来源:ComponentController.java

示例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());
    }
}
 
开发者ID:rmfisher,项目名称:fx-animation-editor,代码行数:11,代码来源:UngroupCommand.java

示例4: bind

import javafx.beans.property.ObjectProperty; //导入方法依赖的package包/类
private void bind(ObjectProperty<String> objectProperty, StringProperty stringProperty) {
  objectProperty.set(stringProperty.get());
}
 
开发者ID:VerifAPS,项目名称:stvs,代码行数:4,代码来源:ConfigDialogManager.java

示例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);
}
 
开发者ID:rmfisher,项目名称:fx-animation-editor,代码行数:6,代码来源:ModelFunctions.java

示例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());
}
 
开发者ID:rmfisher,项目名称:fx-animation-editor,代码行数:6,代码来源:ModelFunctions.java


注:本文中的javafx.beans.property.ObjectProperty.set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。