當前位置: 首頁>>代碼示例>>Java>>正文


Java RotateTransition.setCycleCount方法代碼示例

本文整理匯總了Java中javafx.animation.RotateTransition.setCycleCount方法的典型用法代碼示例。如果您正苦於以下問題:Java RotateTransition.setCycleCount方法的具體用法?Java RotateTransition.setCycleCount怎麽用?Java RotateTransition.setCycleCount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.animation.RotateTransition的用法示例。


在下文中一共展示了RotateTransition.setCycleCount方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: rotateHer

import javafx.animation.RotateTransition; //導入方法依賴的package包/類
public void rotateHer(Label labelHer, ImageView iv)
{
	RotateTransition rotation = new RotateTransition(Duration.seconds(2), iv);
	rotation.setCycleCount(Animation.INDEFINITE);
	rotation.setByAngle(360);

	iv.setTranslateZ(iv.getBoundsInLocal().getWidth() / 2.0);
	iv.setRotationAxis(Rotate.Y_AXIS);
	
	labelHer.setOnMouseEntered(e ->
	{ 
		rotation.play();
		iv.setRotate(180);
	});
	labelHer.setOnMouseExited(e ->
	{ 
		rotation.pause();
		iv.setRotate(0);
	});
}
 
開發者ID:mikemacharia39,項目名稱:gatepass,代碼行數:21,代碼來源:MainWindow.java

示例2: rotateHer

import javafx.animation.RotateTransition; //導入方法依賴的package包/類
public void rotateHer(Label labelHer, ImageView iv)
{
	RotateTransition rotation = new RotateTransition(Duration.seconds(2.3), iv);
	rotation.setCycleCount(Animation.INDEFINITE);
	rotation.setByAngle(360);

	iv.setTranslateZ(iv.getBoundsInLocal().getWidth() / 2.0);
	iv.setRotationAxis(Rotate.Y_AXIS);
	
	labelHer.setOnMouseEntered(e ->
	{ 
		rotation.play();
		iv.setRotate(180);
	});
	labelHer.setOnMouseExited(e ->
	{ 
		rotation.pause();
		iv.setRotate(0);
	});
}
 
開發者ID:mikemacharia39,項目名稱:gatepass,代碼行數:21,代碼來源:SysSettings.java

示例3: TestLoadingScene

import javafx.animation.RotateTransition; //導入方法依賴的package包/類
public TestLoadingScene() {

        getText().setFont(Font.font("Segoe UI", 24));
        getText().setTranslateY(50);

        Circle circle = new Circle(50, 50, 50);

        Shape shape = Shape.subtract(new Rectangle(100, 100), circle);
        shape.setFill(Color.BLUE);
        shape.setStroke(Color.YELLOW);

        RotateTransition rt = new RotateTransition(Duration.seconds(2), shape);
        rt.setByAngle(360);
        rt.setCycleCount(15);
        rt.play();

        shape.setTranslateX(700);
        shape.setTranslateY(500);

        getContentRoot().getChildren().set(1, shape);
    }
 
開發者ID:AlmasB,項目名稱:FXGL,代碼行數:22,代碼來源:TestLoadingScene.java

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

示例5: LoadingCircle

import javafx.animation.RotateTransition; //導入方法依賴的package包/類
public LoadingCircle() {
    Circle circle = new Circle(20);
    circle.setFill(null);
    circle.setStroke(Color.WHITE);
    circle.setStrokeWidth(2);

    Rectangle rect = new Rectangle(20, 20);

    Shape shape = Shape.subtract(circle, rect);
    shape.setFill(Color.WHITE);

    getChildren().add(shape);

    animation = new RotateTransition(Duration.seconds(2.5), this);
    animation.setByAngle(-360);
    animation.setInterpolator(Interpolator.LINEAR);
    animation.setCycleCount(Animation.INDEFINITE);
    animation.play();
}
 
開發者ID:AlmasB,項目名稱:FXTutorials,代碼行數:20,代碼來源:FarCry4Loading.java

示例6: initialize

import javafx.animation.RotateTransition; //導入方法依賴的package包/類
@FXML
private void initialize() {
	eventBus.register(this);
	messageBox.setDisable(client.getSelectedRoom() == null);

	eventListView.setCellFactory(listView -> {
		EventListItemView memberListItemView = new EventListItemView();
		memberListItemView.getView();
		return (EventListItemPresenter)memberListItemView.getPresenter();
	});

	eventListView.itemsProperty().addListener((observable, oldValue, newValue) -> {

		if(eventListScrollBar != null) {
			eventListScrollBar.valueProperty().removeListener(scrollListener);
		}

		this.eventListScrollBar = getListViewScrollBar(eventListView, Orientation.VERTICAL);

		if(eventListScrollBar != null) {
			eventListScrollBar.valueProperty().addListener(scrollListener);
		}
	});

	// Buffering icon animations
	bufferIconAnimation = new RotateTransition(Duration.millis(1000), bufferingIcon);
	bufferIconAnimation.setCycleCount(Timeline.INDEFINITE);
	bufferIconAnimation.setByAngle(360);
	bufferFadeIn = new FadeTransition(Duration.millis(200), bufferingIcon);
	bufferFadeIn.setFromValue(0.0);
	bufferFadeIn.setToValue(1.0);
	bufferFadeOut = new FadeTransition(Duration.millis(200), bufferingIcon);
	bufferFadeOut.setFromValue(1.0);
	bufferFadeOut.setToValue(0.0);
}
 
開發者ID:Gurgy,項目名稱:Cypher,代碼行數:36,代碼來源:ChatPresenter.java

示例7: queueImageView

import javafx.animation.RotateTransition; //導入方法依賴的package包/類
private ImageView queueImageView( final TileViewModel build ) {
    final ImageView queuedIcon = new ImageView( UIUtils.createImage( "icons/queued.png" ) );
    queuedIcon.setFitHeight( 45 );
    queuedIcon.setPreserveRatio( true );
    queuedIcon.visibleProperty( ).bind( build.queuedProperty( ) );

    final RotateTransition transition = new RotateTransition( Duration.seconds( 3 ), queuedIcon );
    transition.setByAngle( 360 );
    transition.setCycleCount( Timeline.INDEFINITE );
    transition.play( );

    return queuedIcon;
}
 
開發者ID:u2032,項目名稱:wall-t,代碼行數:14,代碼來源:TileView.java

示例8: getRotation

import javafx.animation.RotateTransition; //導入方法依賴的package包/類
private void getRotation(Button button){

		RotateTransition rotation = new RotateTransition(Duration.seconds(3), button);
		rotation.setCycleCount(Animation.INDEFINITE);
		rotation.setByAngle(360);
		
		button.setOnMouseEntered(e -> rotation.play());
		button.setOnMouseExited(e -> rotation.pause());
	}
 
開發者ID:LtubSalad,項目名稱:voogasalad-ltub,代碼行數:10,代碼來源:GameChooser.java

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

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

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

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

示例13: createRotateTransition

import javafx.animation.RotateTransition; //導入方法依賴的package包/類
RotateTransition createRotateTransition(Duration duration, Node node, int startAngle) {
    RotateTransition rt = new RotateTransition(duration, node);
    rt.setFromAngle(startAngle);
    rt.setByAngle(360);
    rt.setCycleCount(Animation.INDEFINITE);
    rt.setInterpolator(Interpolator.LINEAR);
    return rt;
}
 
開發者ID:torutk,項目名稱:analogclock,代碼行數:9,代碼來源:AnalogClockDrawing.java

示例14: createRotateTransition

import javafx.animation.RotateTransition; //導入方法依賴的package包/類
/**
 * 360度回転を繰り返すアニメーションの設定。
 *
 * @param duration 1回転するのに要する時間
 * @param node 回転するノード
 * @param startAngle 回転開始角度
 * @return 指定下パラメータで初期化したRotateTransitionインスタンス
 */
private RotateTransition createRotateTransition(Duration duration, Node node, double startAngle) {
    RotateTransition rt = new RotateTransition(duration, node);
    rt.setFromAngle(startAngle);
    rt.setByAngle(360);
    rt.setCycleCount(Animation.INDEFINITE);
    rt.setInterpolator(Interpolator.LINEAR);
    return rt;
}
 
開發者ID:torutk,項目名稱:analogclock,代碼行數:17,代碼來源:AnalogClockImaging.java

示例15: start

import javafx.animation.RotateTransition; //導入方法依賴的package包/類
@Override
public void start(Stage stage) throws Exception {
    if (stage == null) {
        return;
    }

    Rectangle clipRect1 = new Rectangle(-130, -130, 115, 115);
    Rectangle clipRect2 = new Rectangle(15, -130, 115, 115);
    Rectangle clipRect3 = new Rectangle(-130, 15, 115, 115);
    Rectangle clipRect4 = new Rectangle(15, 15, 115, 115);
    Group clip = new Group(clipRect1, clipRect2, clipRect3, clipRect4);

    Circle spinnanCircle = new Circle(100);
    spinnanCircle.setFill(null);
    spinnanCircle.setStrokeWidth(30);
    spinnanCircle.setStroke(LTTNG_PURPLE);
    spinnanCircle.setClip(clip);

    Circle magCircle = new Circle(60);
    magCircle.setFill(null);
    magCircle.setStrokeWidth(25);
    magCircle.setStroke(LTTNG_LIGHT_BLUE);

    Rectangle magHandle = new Rectangle(-12.5, 60, 25, 110);
    magHandle.setFill(LTTNG_LIGHT_BLUE);

    Group mag = new Group(magCircle, magHandle);

    Group root = new Group(spinnanCircle, mag);
    root.setRotate(30);
    root.relocate(0, 0);

    Pane pane = new Pane(root);
    pane.setStyle(BACKGROUND_STYLE);

    RotateTransition spinnan = new RotateTransition(Duration.seconds(4), spinnanCircle);
    spinnan.setByAngle(360);
    spinnan.setCycleCount(Animation.INDEFINITE);
    spinnan.setInterpolator(Interpolator.LINEAR);

    Scene scene = new Scene(pane);
    stage.setScene(scene);
    stage.show();

    spinnan.play();
}
 
開發者ID:lttng,項目名稱:lttng-scope,代碼行數:47,代碼來源:Logo.java


注:本文中的javafx.animation.RotateTransition.setCycleCount方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。