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


Java Circle.translateXProperty方法代码示例

本文整理汇总了Java中javafx.scene.shape.Circle.translateXProperty方法的典型用法代码示例。如果您正苦于以下问题:Java Circle.translateXProperty方法的具体用法?Java Circle.translateXProperty怎么用?Java Circle.translateXProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.shape.Circle的用法示例。


在下文中一共展示了Circle.translateXProperty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createMovingCircle

import javafx.scene.shape.Circle; //导入方法依赖的package包/类
private Circle createMovingCircle(Interpolator interpolator) {
    //create a transparent circle
    Circle circle = new Circle(45,45, 40,  Color.web("1c89f4"));
    circle.setOpacity(0);
    //add effect
    circle.setEffect(new Lighting());

    //create a timeline for moving the circle
   
    timeline.setCycleCount(Timeline.INDEFINITE);
    timeline.setAutoReverse(true);

    //create a keyValue for horizontal translation of circle to the position 155px with given interpolator
    KeyValue keyValue = new KeyValue(circle.translateXProperty(), 155, interpolator);

    //create a keyFrame with duration 4s
    KeyFrame keyFrame = new KeyFrame(Duration.seconds(4), keyValue);

    //add the keyframe to the timeline
    timeline.getKeyFrames().add(keyFrame);

    return circle;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:TimelineInterpolator.java

示例2: createMovingCircle

import javafx.scene.shape.Circle; //导入方法依赖的package包/类
private Circle createMovingCircle(Interpolator interpolator, Color color){
    Circle circle = new Circle(25,25,35,color);
    circle.setOpacity(0.0);
    //add effect
    circle.setEffect(new Lighting());

    //create a timeline for moving the circle
       
    timeline.setCycleCount(Timeline.INDEFINITE);
    timeline.setAutoReverse(true);

    //create a keyValue for horizontal translation of circle to the position 155px with given interpolator
    KeyValue keyValue = new KeyValue(circle.translateXProperty(), 155, interpolator);

    //create a keyFrame with duration 4s
    KeyFrame keyFrame = new KeyFrame(Duration.seconds(4), keyValue);
    
    //add the keyframe to the timeline
    timeline.getKeyFrames().add(keyFrame);
    
    return circle;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:23,代码来源:InterpolatorSample.java


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