當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。