本文整理汇总了Java中javafx.animation.RotateTransition.setAxis方法的典型用法代码示例。如果您正苦于以下问题:Java RotateTransition.setAxis方法的具体用法?Java RotateTransition.setAxis怎么用?Java RotateTransition.setAxis使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.animation.RotateTransition
的用法示例。
在下文中一共展示了RotateTransition.setAxis方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createFlipEndTransition
import javafx.animation.RotateTransition; //导入方法依赖的package包/类
/**
* Creates a {@link RotateTransition} that is the second/end part of a flip
* animation.
*
* @param pNode the {@link Node}.
* @param pOrientation the {@link Orientation} in which to rotate. Note that
* {@link Orientation#HORIZONTAL} means from right to left.
* @param pRightLeftTopDown {@code true} if the animation should be from
* right to left/top to down. {@code false} if it should be left
* to right/bottom to up.
* @return the created {@link RotateTransition}.
*/
public static RotateTransition createFlipEndTransition(Node pNode, Orientation pOrientation, boolean pRightLeftTopDown)
{
double startingAngle = calculateEdgeAngle(pNode, pOrientation);
RotateTransition endTransition = new RotateTransition(Duration.millis(466), pNode);
endTransition.setAxis(getAxis(pOrientation));
if (pRightLeftTopDown)
{
endTransition.setFromAngle(startingAngle + 180);
endTransition.setToAngle(360);
}
else
{
endTransition.setFromAngle(startingAngle);
endTransition.setToAngle(0);
}
endTransition.setInterpolator(Interpolator.EASE_OUT);
return endTransition;
}
示例2: createFlipStartTransition
import javafx.animation.RotateTransition; //导入方法依赖的package包/类
/**
* Creates a {@link RotateTransition} that is the first/start part of a flip
* animation.
*
* @param pNode the {@link Node}.
* @param pOrientation the {@link Orientation} in which to rotate. Note that
* {@link Orientation#HORIZONTAL} means from right to left.
* @param pRightLeftTopDown {@code true} if the animation should be from
* right to left/top to down. {@code false} if it should be left
* to right/bottom to up.
* @return the created {@link RotateTransition}.
*/
public static RotateTransition createFlipStartTransition(Node pNode, Orientation pOrientation, boolean pRightLeftTopDown)
{
double endingAngle = calculateEdgeAngle(pNode, pOrientation);
RotateTransition transition = new RotateTransition(Duration.millis(466), pNode);
transition.setAxis(getAxis(pOrientation));
if (pRightLeftTopDown)
{
transition.setFromAngle(0);
transition.setToAngle(endingAngle);
}
else
{
transition.setFromAngle(360);
transition.setToAngle(endingAngle + 180);
}
transition.setInterpolator(Interpolator.EASE_IN);
return transition;
}
示例3: flipTo180
import javafx.animation.RotateTransition; //导入方法依赖的package包/类
private void flipTo180(final Domino.Dot DOT, final String STYLE) {
final RotateTransition ROT_0_90 = new RotateTransition(FLIP_TIME.divide(2), dotMap.get(DOT));
ROT_0_90.setAxis(Rotate.Y_AXIS);
ROT_0_90.setFromAngle(0);
ROT_0_90.setToAngle(90);
ROT_0_90.play();
ROT_0_90.setOnFinished(new EventHandler<ActionEvent>() {
@Override public void handle(final ActionEvent EVENT) {
dotMap.get(DOT).getStyleClass().clear();
dotMap.get(DOT).getStyleClass().add(STYLE);
final RotateTransition ROT_90_180 = new RotateTransition(FLIP_TIME.divide(2), dotMap.get(DOT));
ROT_90_180.setAxis(Rotate.Y_AXIS);
ROT_90_180.setFromAngle(90);
ROT_90_180.setToAngle(180);
ROT_90_180.play();
}
});
}
示例4: flipTo0
import javafx.animation.RotateTransition; //导入方法依赖的package包/类
private void flipTo0(final Domino.Dot DOT, final String STYLE) {
final RotateTransition ROT_180_90 = new RotateTransition(FLIP_TIME.divide(2), dotMap.get(DOT));
ROT_180_90.setAxis(Rotate.Y_AXIS);
ROT_180_90.setFromAngle(180);
ROT_180_90.setToAngle(90);
ROT_180_90.play();
ROT_180_90.setOnFinished(new EventHandler<ActionEvent>() {
@Override public void handle(final ActionEvent EVENT) {
dotMap.get(DOT).getStyleClass().clear();
dotMap.get(DOT).getStyleClass().add(STYLE);
final RotateTransition ROT_90_0 = new RotateTransition(FLIP_TIME.divide(2), dotMap.get(DOT));
ROT_90_0.setAxis(Rotate.Y_AXIS);
ROT_90_0.setFromAngle(90);
ROT_90_0.setToAngle(0);
ROT_90_0.play();
}
});
}
示例5: rotateAroundYAxis
import javafx.animation.RotateTransition; //导入方法依赖的package包/类
private RotateTransition rotateAroundYAxis(Node node) {
RotateTransition rotate = new RotateTransition(
Duration.seconds(ROTATE_SECS),
node
);
rotate.setAxis(Rotate.Y_AXIS);
rotate.setFromAngle(360);
rotate.setToAngle(0);
rotate.setInterpolator(Interpolator.LINEAR);
rotate.setCycleCount(RotateTransition.INDEFINITE);
return rotate;
}
示例6: rotateGlobe
import javafx.animation.RotateTransition; //导入方法依赖的package包/类
public void rotateGlobe() {
rt = new RotateTransition(Duration.seconds(OrbitInfo.SOLAR_DAY/500D), globe.getWorld());
//rt.setByAngle(360);
rt.setInterpolator(Interpolator.LINEAR);
rt.setCycleCount(Animation.INDEFINITE);
rt.setAxis(Rotate.Y_AXIS);
rt.setFromAngle(360);
rt.setToAngle(0);
rt.play();
}
示例7: selfRotation
import javafx.animation.RotateTransition; //导入方法依赖的package包/类
private RotateTransition selfRotation() {
RotateTransition rotate = new RotateTransition(Duration.seconds(ROTATE_SECS), this);
rotate.setAxis(Rotate.Y_AXIS);
rotate.setFromAngle(clockRotate ? 0 : 360);
rotate.setToAngle(clockRotate ? 360 : 0);
rotate.setInterpolator(Interpolator.LINEAR);
rotate.setCycleCount(RotateTransition.INDEFINITE);
return rotate;
}
示例8: show
import javafx.animation.RotateTransition; //导入方法依赖的package包/类
public void show() {
RotateTransition rt = new RotateTransition(Duration.seconds(1), bg);
rt.setAxis(Rotate.Y_AXIS);
rt.setToAngle(180);
rt.setOnFinished(event -> text.setVisible(true));
rt.play();
}
示例9: rotate
import javafx.animation.RotateTransition; //导入方法依赖的package包/类
private void rotate(double angle, Duration time){
RotateTransition flip = new RotateTransition(time, this);
flip.setAxis(Rotate.X_AXIS);
flip.setByAngle(angle);
flip.play();
}