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


Java RotateTransition.setToAngle方法代码示例

本文整理汇总了Java中javafx.animation.RotateTransition.setToAngle方法的典型用法代码示例。如果您正苦于以下问题:Java RotateTransition.setToAngle方法的具体用法?Java RotateTransition.setToAngle怎么用?Java RotateTransition.setToAngle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.animation.RotateTransition的用法示例。


在下文中一共展示了RotateTransition.setToAngle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleCurrentValue

import javafx.animation.RotateTransition; //导入方法依赖的package包/类
@Override protected void handleCurrentValue(final double VALUE) {
    double deviation = calculateDeviation(VALUE);
    updateState(deviation);
    valueText.setText(String.format(locale, formatString, VALUE));
    deviationText.setText(String.format(locale, "%." + tile.getTickLabelDecimals() + "f", deviation));

    RotateTransition rotateTransition = new RotateTransition(Duration.millis(200), triangle);
    rotateTransition.setFromAngle(triangle.getRotate());
    rotateTransition.setToAngle(state.angle);

    FillTransition fillIndicatorTransition = new FillTransition(Duration.millis(200), triangle);
    fillIndicatorTransition.setFromValue((Color) triangle.getFill());
    fillIndicatorTransition.setToValue(state.color);

    FillTransition fillReferenceTransition = new FillTransition(Duration.millis(200), deviationText);
    fillReferenceTransition.setFromValue((Color) triangle.getFill());
    fillReferenceTransition.setToValue(state.color);

    FillTransition fillReferenceUnitTransition = new FillTransition(Duration.millis(200), deviationUnitText);
    fillReferenceUnitTransition.setFromValue((Color) triangle.getFill());
    fillReferenceUnitTransition.setToValue(state.color);

    ParallelTransition parallelTransition = new ParallelTransition(rotateTransition, fillIndicatorTransition, fillReferenceTransition, fillReferenceUnitTransition);
    parallelTransition.play();
}
 
开发者ID:HanSolo,项目名称:tilesfx,代码行数:26,代码来源:HighLowTileSkin.java

示例2: switchStateAnimation

import javafx.animation.RotateTransition; //导入方法依赖的package包/类
private void switchStateAnimation(TDDState newState){
    RotateTransition rotateTransition = new RotateTransition(Duration.millis(800), cycleImage);
    rotateTransition.setFromAngle(0);
    rotateTransition.setToAngle(-180);
    FadeTransition ft = new FadeTransition(Duration.millis(800), cycleImage);
    ft.setFromValue(1);
    ft.setToValue(0);
    RotateTransition rotateTransition2 = new RotateTransition(Duration.millis(800), cycleImageOverlay);
    rotateTransition2.setFromAngle(180);
    rotateTransition2.setToAngle(0);

    Image newImg = getImageOfPhase(newState);
    rotateTransition2.setOnFinished(event -> {
        cycleImage.setImage(newImg);
    });
    FadeTransition ft2 = new FadeTransition(Duration.millis(800), cycleImageOverlay);
    ft2.setFromValue(0);
    ft2.setToValue(1);

    ft.play();
    cycleImageOverlay.setImage(newImg);
    rotateTransition.play();
    ft.play();
    ft2.play();
    rotateTransition2.play();
}
 
开发者ID:ProPra16,项目名称:programmierpraktikum-abschlussprojekt-amigos,代码行数:27,代码来源:ExerciseController.java

示例3: update

import javafx.animation.RotateTransition; //导入方法依赖的package包/类
@Override
public void update (Object object) {
    ITurtleState state = (ITurtleState) object;
    
    this.penStyleIndex = state.getPenStyle();
    TranslateTransition tt = new TranslateTransition(Duration.millis(mySpeed), this);

    double currentX = this.getTranslateX(); double currentY = this.getTranslateY();
    tt.setByX(currentX); tt.setByY(currentY); tt.setToX(state.getX()); tt.setToY(state.getY());

    RotateTransition rt = new RotateTransition(Duration.millis(mySpeed), this);

    double currentHeading = this.getRotate();
    rt.setByAngle(currentHeading); rt.setToAngle(state.getHeading());

    ParallelTransition pt = new ParallelTransition();
    pt.getChildren().addAll(tt, rt);

    pt.setOnFinished(e -> {
        updateTurtleState(state);
        System.out.println("myturtle: " + this.toString());
        tooltip.setText(this.toString());
    });

    pt.play();
}
 
开发者ID:adisrini,项目名称:slogo,代码行数:27,代码来源:TurtleView.java

示例4: close

import javafx.animation.RotateTransition; //导入方法依赖的package包/类
public void close() {
    if (State.CLOSED == getState()) return;

    setState(State.CLOSED);
    RotateTransition rotate = new RotateTransition();
    rotate.setNode(cross);
    rotate.setToAngle(0);
    rotate.setDuration(Duration.millis(200));
    rotate.setInterpolator(Interpolator.EASE_BOTH);
    rotate.play();
    closeTimeLines[closeTimeLines.length - 1].setOnFinished(actionEvent -> {
        FadeTransition buttonFadeOut = new FadeTransition();
        buttonFadeOut.setNode(mainMenuButton);
        buttonFadeOut.setDuration(Duration.millis(100));
        buttonFadeOut.setToValue(options.getButtonAlpha());
        buttonFadeOut.play();
        buttonFadeOut.setOnFinished(event -> {
            if (options.isButtonHideOnClose()) hide();
            fireMenuEvent(new MenuEvent(this, null, MenuEvent.MENU_CLOSE_FINISHED));
        });
    });
    for (int i = 0 ; i < closeTimeLines.length ; i++) {
        closeTimeLines[i].play();
    }
    fireMenuEvent(new MenuEvent(this, null, MenuEvent.MENU_CLOSE_STARTED));
}
 
开发者ID:Simego,项目名称:FXImgurUploader,代码行数:27,代码来源:RadialMenu.java

示例5: 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

示例6: 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

示例7: LoadingBar

import javafx.animation.RotateTransition; //导入方法依赖的package包/类
public LoadingBar() {
    Circle outer = new Circle(50);
    outer.setFill(null);
    outer.setStroke(Color.BLACK);

    Circle inner = new Circle(5);
    inner.setTranslateY(-50);

    rt = new RotateTransition(Duration.seconds(2), this);
    rt.setToAngle(360);
    rt.setInterpolator(Interpolator.LINEAR);
    rt.setCycleCount(RotateTransition.INDEFINITE);

    getChildren().addAll(outer, inner);
    setVisible(false);
}
 
开发者ID:AlmasB,项目名称:FXTutorials,代码行数:17,代码来源:Main.java

示例8: 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

示例9: 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

示例10: IconRotation

import javafx.animation.RotateTransition; //导入方法依赖的package包/类
/**
 * An animation which rotates the icon of a button.
 *
 * @param graphic The graphic on which the icon should be animated, must not be null.
 */
public IconRotation(Node graphic) {
    rotateProperty = graphic.rotateProperty();

    rotation = new RotateTransition(DURATION, graphic);
    rotation.setInterpolator(EASE_BOTH);
    rotation.setCycleCount(INDEFINITE);
    rotation.setFromAngle(0);
    rotation.setToAngle(360);
}
 
开发者ID:tbressler,项目名称:waterrower-workout,代码行数:15,代码来源:IconRotation.java

示例11: notifyCloseAction

import javafx.animation.RotateTransition; //导入方法依赖的package包/类
void notifyCloseAction() {
    if (isMenuOpen) {
        isMenuOpen = false;

        RotateTransition rotate = new RotateTransition(Duration.seconds(0.2), menuButton.getGraphic());
        rotate.setToAngle(0);
        rotate.play();

        hideAction.run();
    }
}
 
开发者ID:alexbodogit,项目名称:AnchorFX,代码行数:12,代码来源:DockCommandsBox.java

示例12: notifyOpenAction

import javafx.animation.RotateTransition; //导入方法依赖的package包/类
void notifyOpenAction() {
    RotateTransition rotate = new RotateTransition(Duration.seconds(0.2), menuButton.getGraphic());
    rotate.setToAngle(90);
    rotate.play();

    openAction.run();
}
 
开发者ID:alexbodogit,项目名称:AnchorFX,代码行数:8,代码来源:DockCommandsBox.java

示例13: 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

示例14: 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

示例15: 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


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