本文整理汇总了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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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));
});
}
}
示例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;
}
示例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("");
}
}
示例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));
}
示例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));
}
示例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));
}
示例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);
}
示例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();
}
示例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);
}
}
示例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);
}
}
示例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);
}
}