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


Java RotateTransition.setAxis方法代码示例

本文整理汇总了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;
}
 
开发者ID:ivartanian,项目名称:JVx.javafx,代码行数:34,代码来源:FXAnimator.java

示例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;
}
 
开发者ID:ivartanian,项目名称:JVx.javafx,代码行数:33,代码来源:FXAnimator.java

示例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();
        }
    });
}
 
开发者ID:SaiPradeepDandem,项目名称:javafx-demos,代码行数:19,代码来源:DominoSkin.java

示例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();
        }
    });
}
 
开发者ID:SaiPradeepDandem,项目名称:javafx-demos,代码行数:19,代码来源:DominoSkin.java

示例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;
}
 
开发者ID:mars-sim,项目名称:mars-sim,代码行数:14,代码来源:MarsViewer.java

示例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();
}
 
开发者ID:mars-sim,项目名称:mars-sim,代码行数:11,代码来源:SpinningGlobe.java

示例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;
}
 
开发者ID:sanke69,项目名称:fr.xs.jtk,代码行数:11,代码来源:Planetoid.java

示例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();
}
 
开发者ID:AlmasB,项目名称:FXTutorials,代码行数:8,代码来源:HangmanMain.java

示例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();
}
 
开发者ID:scourgemancer,项目名称:FamilyFeud,代码行数:7,代码来源:AnswerTile.java


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