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


Java TranslateTransition.setByY方法代码示例

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


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

示例1: animate

import javafx.animation.TranslateTransition; //导入方法依赖的package包/类
private void animate() {
    TranslateTransition tt = new TranslateTransition(Duration.millis(duration), load_image_button);
    TranslateTransition tLogo = new TranslateTransition(Duration.millis(duration), christopher);
    TranslateTransition tDesc = new TranslateTransition(Duration.millis(duration), description);

    ScaleTransition st = new ScaleTransition(Duration.millis(duration), load_image_button);
    st.setToX(3);
    st.setToY(3);

    tt.setByY(-180f);

    tLogo.setToY(50);
    tDesc.setToY(500);
    buttonParallelTransition = new ParallelTransition(load_image_button, st, tt, tLogo, tDesc);

    buttonParallelTransition.play();
    buttonParallelTransition.setOnFinished((e) -> {
        load_image_button.setOpacity(1);
    });
}
 
开发者ID:afsalashyana,项目名称:FakeImageDetection,代码行数:21,代码来源:LaunchScreeenController.java

示例2: update

import javafx.animation.TranslateTransition; //导入方法依赖的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

示例3: animate

import javafx.animation.TranslateTransition; //导入方法依赖的package包/类
protected void animate(final ModView modView, final int amount) {
	
	 TranslateTransition tt = new TranslateTransition(Duration.millis(80), modView.getContent());
     tt.setByY(amount);
     tt.setCycleCount(1);
     tt.setAutoReverse(false);
     tt.setOnFinished(new EventHandler<ActionEvent>() {
		@Override
		public void handle(ActionEvent e) {
			modView.moving = false;
		}
	});
 
     tt.play();
	
}
 
开发者ID:KrazyTheFox,项目名称:Starbound-Mod-Manager,代码行数:17,代码来源:ModListView.java

示例4: animateSelection

import javafx.animation.TranslateTransition; //导入方法依赖的package包/类
/** Animates the surrounding frame to move between two difficulty selections */
private void animateSelection(Node target, Node frame, Stage stage ){
    TranslateTransition animation = new TranslateTransition( Duration.millis(400), frame );
    animation.setInterpolator( Interpolator.EASE_IN );
    //centers the difficulties with and without 'y' in them within the frame properly
    if( target.localToScene( target.getBoundsInLocal(), false ).getMaxY() < stage.getHeight() * 0.4 ){
        animation.setByY( target.localToScene( target.getBoundsInLocal(), false ).getMaxY() -
                frame.localToScene( frame.getBoundsInLocal(), false ).getMaxY() + stage.getHeight() / 100 );
    }else{
        animation.setByY( target.localToScene( target.getBoundsInLocal(), false ).getMaxY() -
                frame.localToScene( frame.getBoundsInLocal(), false ).getMaxY() + stage.getHeight() / 150 );
    }
    animation.play();
}
 
开发者ID:scourgemancer,项目名称:Sudoku_Program_with_Solver,代码行数:15,代码来源:DifficultySelectionState.java

示例5: createAndConfigureAnimation

import javafx.animation.TranslateTransition; //导入方法依赖的package包/类
private TranslateTransition createAndConfigureAnimation(
		final TableView<Person> sourceTable,
		final TableView<Person> destinationTable,
		final Pane commonTableAncestor, final TableRow<Person> row,
		final ImageView imageView, final Point2D animationStartPoint,
		Point2D animationEndPoint) {
	final TranslateTransition transition = new TranslateTransition(ANIMATION_DURATION, imageView);
	// At end of animation, actually move data, and remove animated image
	transition.setOnFinished(createAnimationFinishedHandler(sourceTable, destinationTable, commonTableAncestor, row.getItem(), imageView));
	// configure transition
	transition.setByX(animationEndPoint.getX() - animationStartPoint.getX()); // absolute translation, computed from coords relative to Scene
	transition.setByY(animationEndPoint.getY() - animationStartPoint.getY()); // absolute translation, computed from coords relative to Scene
	return transition;
}
 
开发者ID:mars-sim,项目名称:mars-sim,代码行数:15,代码来源:AnimatedTableRow.java

示例6: updatePosition

import javafx.animation.TranslateTransition; //导入方法依赖的package包/类
@Override
public void updatePosition(Point2D moveBy) {
	double translateX = holder.getNode().getTranslateX();
	double translateY = holder.getNode().getTranslateY();
	Point2D playerPosition = new Point2D(translateX, translateY);

	this.position = playerPosition;
	TranslateTransition smoothMove = new TranslateTransition(
			Duration.millis(2000), this.getNode());
	smoothMove.setFromX(translateX);
	smoothMove.setFromY(translateY);
	// FIXME: Change 1000 to screenWidth()
	int leftRightDirection = 0;
	int upDownDirection = 0;
	
	switch (shootingDirection) {
	case ("west"):
		leftRightDirection = -1000;
		break;
	case ("east"):
		leftRightDirection = 1000;
		break;
	case ("north"):
		upDownDirection = -1000;
		break;
	case ("south"):
		upDownDirection = 1000;
		break;
	default:
		//some other directions?
		break;
	}
	
	smoothMove.setByX(this.getPosition().getX() + leftRightDirection);
	smoothMove.setByY(this.getPosition().getY() + upDownDirection);
	smoothMove.setAutoReverse(true);
	smoothMove.setCycleCount(1);
	smoothMove.play();
}
 
开发者ID:kpetkova,项目名称:teamearth,代码行数:40,代码来源:Bullet.java

示例7: updatePosition

import javafx.animation.TranslateTransition; //导入方法依赖的package包/类
@Override
public void updatePosition(Point2D position) {
	TranslateTransition smoothMove = new TranslateTransition(
			Duration.millis(200), this.getNode());
	smoothMove.setByX(position.getX());
	smoothMove.setByY(position.getY());
	smoothMove.setAutoReverse(true);
	smoothMove.play();
}
 
开发者ID:kpetkova,项目名称:teamearth,代码行数:10,代码来源:Player.java

示例8: updatePosition

import javafx.animation.TranslateTransition; //导入方法依赖的package包/类
@Override
public void updatePosition(Point2D position) {
	TranslateTransition smoothMove = new TranslateTransition(
			Duration.millis(300), this.getNode());
	smoothMove.setByX(this.getPosition().getX() + position.getX());
	smoothMove.setByY(this.getPosition().getY() + position.getY());
	smoothMove.setAutoReverse(true);
	smoothMove.play();
}
 
开发者ID:kpetkova,项目名称:teamearth,代码行数:10,代码来源:Enemy.java

示例9: restoreFromSeedAnimation

import javafx.animation.TranslateTransition; //导入方法依赖的package包/类
public void restoreFromSeedAnimation() {
    // Buttons slide out ...
    TranslateTransition leave = new TranslateTransition(Duration.millis(1200), controlsBox);
    leave.setByY(80.0);
    leave.play();
}
 
开发者ID:creativechain,项目名称:creacoinj,代码行数:7,代码来源:MainController.java

示例10: restoreFromSeedAnimation

import javafx.animation.TranslateTransition; //导入方法依赖的package包/类
public void restoreFromSeedAnimation () {
    // Buttons slide out ...
    TranslateTransition leave = new TranslateTransition(Duration.millis(1200), controlsBox);
    leave.setByY(80.0);
    leave.play();
}
 
开发者ID:blockchain,项目名称:thunder,代码行数:7,代码来源:MainController.java


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