本文整理匯總了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);
});
}
示例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);
});
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}
示例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;
}
示例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());
}
示例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);
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}