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