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


Java Interpolator.EASE_BOTH属性代码示例

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


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

示例1: startAnimateForm300

private Timeline startAnimateForm300() {
    Timeline tml = new Timeline(
            new KeyFrame(Duration.ZERO, new KeyValue(pnlContent.maxHeightProperty(), 70)),
            new KeyFrame(Duration.seconds(0.4), new KeyValue(pnlContent.maxHeightProperty(), 300, Interpolator.EASE_BOTH)));
    tml.setOnFinished((ActionEvent event) -> {
        pnlForm.setVisible(true);
        txtSend.requestFocus();
    });
    return tml;
}
 
开发者ID:RestComm,项目名称:phone-simulator,代码行数:10,代码来源:USSDGUIController.java

示例2: startAnimateForm130

private Timeline startAnimateForm130() {
    Timeline tml = new Timeline(
            new KeyFrame(Duration.ZERO, new KeyValue(pnlContent.maxHeightProperty(), 70)),
            new KeyFrame(Duration.seconds(0.4), new KeyValue(pnlContent.maxHeightProperty(), 130, Interpolator.EASE_BOTH)));
    tml.setOnFinished((ActionEvent event) -> {

        pnlForm.setVisible(false);
        pnlMessage.setVisible(true);
    });

    return tml;
}
 
开发者ID:RestComm,项目名称:phone-simulator,代码行数:12,代码来源:USSDGUIController.java

示例3: setValue

public void setValue(final double VALUE) {
    if (null == value) {
        if (isAnimated()) {
            oldValue = _value;
            _value   = VALUE;
            timeline.stop();
            KeyValue kv1 = new KeyValue(currentValue, oldValue, Interpolator.EASE_BOTH);
            KeyValue kv2 = new KeyValue(currentValue, VALUE, Interpolator.EASE_BOTH);
            KeyFrame kf1 = new KeyFrame(Duration.ZERO, kv1);
            KeyFrame kf2 = new KeyFrame(Duration.millis(animationDuration), kv2);
            timeline.getKeyFrames().setAll(kf1, kf2);
            timeline.play();
        } else {
            oldValue = _value;
            _value = VALUE;
            fireItemEvent(FINISHED_EVENT);
        }
    } else {
        value.set(VALUE);
    }
}
 
开发者ID:HanSolo,项目名称:charts,代码行数:21,代码来源:ChartItem.java

示例4: drawNode

@Override
public Node drawNode() {
    Pane p = pre();

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

    keyValue1 = new KeyValue(circle.translateXProperty(), 300);
    keyValue2 = new KeyValue(circle.translateYProperty(), 200, Interpolator.EASE_BOTH);
    keyValue3 = new KeyValue(circle.visibleProperty(), true);

    KeyFrame keyFrame1 = new KeyFrame(duration, keyValue1);
    timeline.getKeyFrames().add(keyFrame1);

    KeyFrame keyFrame2 = new KeyFrame(duration, cuepointName2, keyValue2);
    timeline.getKeyFrames().add(keyFrame2);

    KeyFrame keyFrame3 = new KeyFrame(duration, cuepointName, keyValue3);
    timeline.getKeyFrames().add(keyFrame3);

    return p;
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:23,代码来源:AnimationApp.java

示例5: handleDial

private void handleDial(final MouseEvent EVENT, final double MAX_ANGLE, final int NUMBER) {
    final EventType TYPE = EVENT.getEventType();

    if (MouseEvent.MOUSE_DRAGGED == TYPE) {
        Point2D point = sceneToLocal(EVENT.getSceneX(), EVENT.getSceneY());
        touchRotate(point.getX(), point.getY(), MAX_ANGLE);
    } else if (MouseEvent.MOUSE_RELEASED == TYPE) {
        KeyValue kv0 = new KeyValue(plateRotate.angleProperty(), currentAngle, Interpolator.EASE_BOTH);
        KeyValue kv1 = new KeyValue(plateRotate.angleProperty(), 0, Interpolator.EASE_BOTH);
        KeyFrame kf0 = new KeyFrame(Duration.ZERO, kv0);
        KeyFrame kf1 = new KeyFrame(Duration.millis(2 * MAX_ANGLE), kv1);
        timeline.getKeyFrames().setAll(kf0, kf1);
        timeline.play();
        timeline.setOnFinished(e -> {
            currentAngle = 0;
            plateRotate.setAngle(currentAngle);
            fireEvent(new DialEvent(DialEvent.NUMBER_DIALED, NUMBER));
        });
    }
}
 
开发者ID:HanSolo,项目名称:dialplate,代码行数:20,代码来源:DialPlate.java

示例6: getKeyFrames

private KeyFrame[] getKeyFrames(double angle, double duration, Paint color) {
    KeyFrame[] frames = new KeyFrame[4];
    frames[0] = new KeyFrame(Duration.seconds(duration),
        new KeyValue(arc.lengthProperty(), 5, Interpolator.LINEAR),
        new KeyValue(arc.startAngleProperty(),
            angle + 45 + control.getStartingAngle(),
            Interpolator.LINEAR));
    frames[1] = new KeyFrame(Duration.seconds(duration + 0.4),
        new KeyValue(arc.lengthProperty(), 250, Interpolator.LINEAR),
        new KeyValue(arc.startAngleProperty(),
            angle + 90 + control.getStartingAngle(),
            Interpolator.LINEAR));
    frames[2] = new KeyFrame(Duration.seconds(duration + 0.7),
        new KeyValue(arc.lengthProperty(), 250, Interpolator.LINEAR),
        new KeyValue(arc.startAngleProperty(),
            angle + 135 + control.getStartingAngle(),
            Interpolator.LINEAR));
    frames[3] = new KeyFrame(Duration.seconds(duration + 1.1),
        new KeyValue(arc.lengthProperty(), 5, Interpolator.LINEAR),
        new KeyValue(arc.startAngleProperty(),
            angle + 435 + control.getStartingAngle(),
            Interpolator.LINEAR),
        new KeyValue(arc.strokeProperty(), color, Interpolator.EASE_BOTH));
    return frames;
}
 
开发者ID:jfoenixadmin,项目名称:JFoenix,代码行数:25,代码来源:JFXSpinnerSkin.java

示例7: updateColor

private void updateColor() {
    final ColorPicker colorPicker = (ColorPicker) getSkinnable();
    // update picker box color
    Circle colorCircle = new Circle();
    colorCircle.setFill(colorPicker.getValue());
    colorCircle.setLayoutX(colorBox.getWidth() / 4);
    colorCircle.setLayoutY(colorBox.getHeight() / 2);
    colorBox.getChildren().add(colorCircle);
    Timeline animateColor = new Timeline(new KeyFrame(Duration.millis(240),
        new KeyValue(colorCircle.radiusProperty(),
            200,
            Interpolator.EASE_BOTH)));
    animateColor.setOnFinished((finish) -> {
        JFXNodeUtils.updateBackground(colorBox.getBackground(), colorBox, colorCircle.getFill());
        colorBox.getChildren().remove(colorCircle);
    });
    animateColor.play();
    // update label color
    displayNode.setTextFill(colorPicker.getValue().grayscale().getRed() < 0.5 ? Color.valueOf(
        "rgba(255, 255, 255, 0.87)") : Color.valueOf("rgba(0, 0, 0, 0.87)"));
    if (colorLabelVisible.get()) {
        displayNode.setText(JFXNodeUtils.colorToHex(colorPicker.getValue()));
    } else {
        displayNode.setText("");
    }
}
 
开发者ID:jfoenixadmin,项目名称:JFoenix,代码行数:26,代码来源:JFXColorPickerSkin.java

示例8: CenterTransition

public CenterTransition(Node contentContainer, Node overlay) {
    super(contentContainer, new Timeline(
        new KeyFrame(Duration.ZERO,
            new KeyValue(contentContainer.scaleXProperty(), 0, Interpolator.LINEAR),
            new KeyValue(contentContainer.scaleYProperty(), 0, Interpolator.LINEAR),
            new KeyValue(overlay.opacityProperty(), 0, Interpolator.EASE_BOTH)
        ),
        new KeyFrame(Duration.millis(1000),
            new KeyValue(contentContainer.scaleXProperty(), 1, Interpolator.EASE_OUT),
            new KeyValue(contentContainer.scaleYProperty(), 1, Interpolator.EASE_OUT),
            new KeyValue(overlay.opacityProperty(), 1, Interpolator.EASE_BOTH)
        )));
    // reduce the number to increase the shifting , increase number to reduce shifting
    setCycleDuration(Duration.seconds(0.4));
    setDelay(Duration.seconds(0));
}
 
开发者ID:jfoenixadmin,项目名称:JFoenix,代码行数:16,代码来源:CenterTransition.java

示例9: HorizontalTransition

public HorizontalTransition(boolean leftDirection, Node contentContainer, Node overlay) {
    super(contentContainer, new Timeline(
        new KeyFrame(Duration.ZERO,
            new KeyValue(contentContainer.translateXProperty(),
                (contentContainer.getLayoutX() + contentContainer.getLayoutBounds().getMaxX())
                * (leftDirection? -1 : 1), Interpolator.LINEAR),
            new KeyValue(overlay.opacityProperty(), 0, Interpolator.EASE_BOTH)
        ),
        new KeyFrame(Duration.millis(1000),
            new KeyValue(overlay.opacityProperty(), 1, Interpolator.EASE_BOTH),
            new KeyValue(contentContainer.translateXProperty(), 0, Interpolator.EASE_OUT)
        )));
    // reduce the number to increase the shifting , increase number to reduce shifting
    setCycleDuration(Duration.seconds(0.4));
    setDelay(Duration.seconds(0));
}
 
开发者ID:jfoenixadmin,项目名称:JFoenix,代码行数:16,代码来源:HorizontalTransition.java

示例10: VerticalTransition

public VerticalTransition(boolean topDirection, Node contentContainer, Node overlay) {
    super(contentContainer, new Timeline(
        new KeyFrame(Duration.ZERO,
            new KeyValue(contentContainer.translateYProperty(),
                (contentContainer.getLayoutY() + contentContainer.getLayoutBounds().getMaxY())
                * (topDirection? -1 : 1), Interpolator.LINEAR),
            new KeyValue(overlay.opacityProperty(), 0, Interpolator.EASE_BOTH)
        ),
        new KeyFrame(Duration.millis(1000),
            new KeyValue(overlay.opacityProperty(), 1, Interpolator.EASE_BOTH),
            new KeyValue(contentContainer.translateYProperty(), 0, Interpolator.EASE_OUT)
        )));
    // reduce the number to increase the shifting , increase number to reduce shifting
    setCycleDuration(Duration.seconds(0.4));
    setDelay(Duration.seconds(0));
}
 
开发者ID:jfoenixadmin,项目名称:JFoenix,代码行数:16,代码来源:VerticalTransition.java

示例11: HorizontalShadowAnimation

public HorizontalShadowAnimation(Labeled label) {
	if (label == null) {
		throw new NullPointerException();
	}
	labeled = label;
	originalEffect = label.getEffect();

	dropShadow.setBlurType(BlurType.ONE_PASS_BOX);
	
	setInitialShadow(label);

	EventHandler<ActionEvent> onFinished = new EventHandler<ActionEvent>() {
		public void handle(ActionEvent t) {
			label.effectProperty().unbind();
			labeled.setEffect(originalEffect);
		}
	};
	KeyValue endValue = new KeyValue(dropShadow.widthProperty(), 0, Interpolator.EASE_BOTH);
	KeyFrame endFrame = new KeyFrame(Duration.millis(150), onFinished, endValue);

	animation.getKeyFrames().addAll(endFrame);
	animation.setCycleCount(1);
	animation.setAutoReverse(false);
	
}
 
开发者ID:ubershy,项目名称:StreamSis,代码行数:25,代码来源:HorizontalShadowAnimation.java

示例12: updateRefreshButton

protected void updateRefreshButton() {
	
	Color color = CSSHelper.getColor("mod-list-button-color", settings.getPropertyString("theme"));
	FXHelper.setColor(refreshButton.getGraphic(), color);
	
	if (!firstRunComplete) {
		firstRunComplete = true;
		return;
	}
	
	Timeline refreshAnimation = new Timeline();
	refreshAnimation.setCycleCount(1);
	
	refreshAnimation.setOnFinished(new EventHandler<ActionEvent>() {
		@Override
		public void handle(ActionEvent event) {
			refreshButton.setRotate(0);
		}
	});
	
	final KeyValue kv1 = new KeyValue(refreshButton.rotateProperty(), 1440, Interpolator.EASE_BOTH);
	final KeyFrame kf1 = new KeyFrame(Duration.millis(4500), kv1);
	refreshAnimation.getKeyFrames().addAll(kf1);
	refreshAnimation.playFromStart();
	
}
 
开发者ID:KrazyTheFox,项目名称:Starbound-Mod-Manager,代码行数:26,代码来源:MainView.java

示例13: setValue

public void setValue(final double VALUE) {
    if (animated) {
        timeline.stop();
        KeyValue kv1 = new KeyValue(currentValue, value, Interpolator.EASE_BOTH);
        KeyValue kv2 = new KeyValue(currentValue, VALUE, Interpolator.EASE_BOTH);
        KeyFrame kf1 = new KeyFrame(Duration.ZERO, kv1);
        KeyFrame kf2 = new KeyFrame(Duration.millis(animationDuration), kv2);
        timeline.getKeyFrames().setAll(kf1, kf2);
        timeline.play();
    } else {
        oldValue = value;
        value = VALUE;
        fireChartDataEvent(FINISHED_EVENT);
    }
}
 
开发者ID:HanSolo,项目名称:SunburstChart,代码行数:15,代码来源:ChartData.java

示例14: setValue

public void setValue(final double VALUE) {
    if (animated) {
        timeline.stop();
        KeyValue kv1 = new KeyValue(currentValue, value, Interpolator.EASE_BOTH);
        KeyValue kv2 = new KeyValue(currentValue, VALUE, Interpolator.EASE_BOTH);
        KeyFrame kf1 = new KeyFrame(Duration.ZERO, kv1);
        KeyFrame kf2 = new KeyFrame(Duration.millis(800), kv2);
        timeline.getKeyFrames().setAll(kf1, kf2);
        timeline.play();
    } else {
        value = VALUE;
        fireChartDataEvent(UPDATE_EVENT);
    }
}
 
开发者ID:HanSolo,项目名称:radialchart,代码行数:14,代码来源:ChartData.java

示例15: updateState

private void updateState() {
    upBar.setStyle(getSkinnable().getEnergized() ? "-fx-background-color:-energized-color" : "-fx-background-color:-de-energized-color");
    downBar.setStyle(getSkinnable().getEnergized() ? "-fx-background-color:-energized-color" : "-fx-background-color:-de-energized-color");
    mobileBar.setStyle(getSkinnable().getEnergized() ? "-fx-background-color:-energized-color" : "-fx-background-color:-de-energized-color");

    if (getSkinnable().getAnimated()) {
        timeline.stop();
        final KeyValue KEY_VALUE = new KeyValue(barRotate.angleProperty(), getSkinnable().getClosed() ? ANGLE_IN_CLOSED_POSITION : angleInOpenPosition, Interpolator.EASE_BOTH);
        final KeyFrame KEY_FRAME = new KeyFrame(Duration.millis(getSkinnable().getAnimationDuration()), KEY_VALUE);
        timeline.getKeyFrames().setAll(KEY_FRAME);
        timeline.play();
    } else {
        barRotate.setAngle(getSkinnable().getClosed() ? ANGLE_IN_CLOSED_POSITION : angleInOpenPosition);
    }
}
 
开发者ID:assemblits,项目名称:dynamo,代码行数:15,代码来源:SwitchSkin.java


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