本文整理匯總了Java中javafx.animation.FadeTransition.setAutoReverse方法的典型用法代碼示例。如果您正苦於以下問題:Java FadeTransition.setAutoReverse方法的具體用法?Java FadeTransition.setAutoReverse怎麽用?Java FadeTransition.setAutoReverse使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javafx.animation.FadeTransition
的用法示例。
在下文中一共展示了FadeTransition.setAutoReverse方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: ActionTextPane
import javafx.animation.FadeTransition; //導入方法依賴的package包/類
public ActionTextPane() {
actionText = new Label("Test");
graphic = new ImageView(new Image("assets/icons/editor_action_info_icon.png"));
actionText.setGraphic(graphic);
actionText.setTextFill(Utils.getDefaultTextColor());
actionText.setAlignment(Pos.CENTER);
actionText.setPadding(new Insets(0, 0, 0, 5));
getChildren().add(actionText);
setAlignment(Pos.CENTER);
ft = new FadeTransition(Duration.millis(500), graphic);
ft.setFromValue(1.0);
ft.setToValue(0.0);
ft.setAutoReverse(true);
ft.setCycleCount(4);
}
示例2: lollipop
import javafx.animation.FadeTransition; //導入方法依賴的package包/類
public static void lollipop(double x, double y) {
Circle circle = new Circle(x, y, 2);
circle.setFill(randomColor());
FrameController.instance.hover.getChildren().add(circle);
FadeTransition fadeTransition = new FadeTransition(Duration.millis(500), circle);
fadeTransition.setAutoReverse(true);
fadeTransition.setCycleCount(2);
fadeTransition.setFromValue(0.0);
fadeTransition.setToValue(1.0);
ScaleTransition scaleTransition = new ScaleTransition(Duration.millis(1000), circle);
scaleTransition.setToX(10.0);
scaleTransition.setToY(10.0);
scaleTransition.setCycleCount(1);
ParallelTransition parallelTransition = new ParallelTransition(fadeTransition, scaleTransition);
parallelTransition.play();
executorService.schedule(() -> Platform.runLater(() ->
FrameController.instance.hover.getChildren().remove(circle)), 1000, TimeUnit.MILLISECONDS);
}
示例3: TransitionAlert
import javafx.animation.FadeTransition; //導入方法依賴的package包/類
private void TransitionAlert(Pane player_pane, Pane energy_pane) {
Rectangle rectangle = new Rectangle(150, 50);
Stop[] stops = new Stop[]{new Stop(0, Color.RED), new Stop(1, Color.WHITE)};
LinearGradient gp = new LinearGradient(0, 0, 10, 24, true, CycleMethod.NO_CYCLE, stops);
rectangle.setFill(gp);
rectangle.setArcHeight(18);
rectangle.setArcWidth(18);
rectangle.setLayoutX(energy_pane.getLayoutX());
rectangle.setLayoutY(energy_pane.getLayoutY());
FadeTransition fadeTransition1 = new FadeTransition(Duration.millis(500), rectangle);
fadeTransition1.setFromValue(0f);
fadeTransition1.setToValue(0.6f);
fadeTransition1.setCycleCount(2);
fadeTransition1.setAutoReverse(true);
player_pane.getChildren().add(rectangle);
fadeTransition1.play();
}
示例4: TransitionGainPV
import javafx.animation.FadeTransition; //導入方法依賴的package包/類
private void TransitionGainPV(Pane player_pane, Pane energy_pane) {
Rectangle rectangle = new Rectangle(150, 50);
Stop[] stops = new Stop[]{new Stop(0, Color.GREEN), new Stop(1, Color.WHITE)};
LinearGradient gp = new LinearGradient(0, 0, 10, 24, true, CycleMethod.NO_CYCLE, stops);
rectangle.setFill(gp);
rectangle.setArcHeight(18);
rectangle.setArcWidth(18);
rectangle.setLayoutX(energy_pane.getLayoutX());
rectangle.setLayoutY(energy_pane.getLayoutY());
FadeTransition fadeTransition = new FadeTransition(Duration.millis(500), rectangle);
fadeTransition.setFromValue(0f);
fadeTransition.setToValue(0.6f);
fadeTransition.setCycleCount(2);
fadeTransition.setAutoReverse(true);
player_pane.getChildren().add(rectangle);
fadeTransition.play();
}
示例5: TransitionForAll
import javafx.animation.FadeTransition; //導入方法依賴的package包/類
private void TransitionForAll(Rectangle rectangle, double layoutXFrom, double layoutXTo, double layoutYFrom, double layoutYTo) {
mainPane.getChildren().add(rectangle);
TranslateTransition translateTransition = new TranslateTransition(Duration.millis(800), rectangle);
translateTransition.setFromX(layoutXFrom);
translateTransition.setToX(layoutXTo);
translateTransition.setFromY(layoutYFrom);
translateTransition.setToY(layoutYTo);
translateTransition.setCycleCount(1);
translateTransition.setAutoReverse(true);
FadeTransition fadeTransition = new FadeTransition(Duration.millis(800), rectangle);
fadeTransition.setFromValue(1.0f);
fadeTransition.setToValue(0f);
fadeTransition.setCycleCount(1);
fadeTransition.setAutoReverse(true);
translateTransition.play();
fadeTransition.play();
rectangle.setDisable(true);
Rectangle newRectangle = new Rectangle(10, 10);
eventExit(rectangle, newRectangle);
}
示例6: refreshBadge
import javafx.animation.FadeTransition; //導入方法依賴的package包/類
public void refreshBadge() {
badge.getChildren().clear();
if (enabled) {
Label labelControl = new Label(text.getValue());
StackPane badgePane = new StackPane();
badgePane.getStyleClass().add("badge-pane");
badgePane.getChildren().add(labelControl);
//Adding a clip would avoid overlap but this does not work as intended
//badgePane.setClip(clip);
badge.getChildren().add(badgePane);
StackPane.setAlignment(badge, getPosition());
FadeTransition ft = new FadeTransition(Duration.millis(666), badge);
ft.setFromValue(0);
ft.setToValue(1.0);
ft.setCycleCount(1);
ft.setAutoReverse(true);
ft.play();
}
}
示例7: createRightContent
import javafx.animation.FadeTransition; //導入方法依賴的package包/類
private Node createRightContent() {
String title = "Please Subscribe :)";
HBox letters = new HBox(0);
letters.setAlignment(Pos.CENTER);
for (int i = 0; i < title.length(); i++) {
Text letter = new Text(title.charAt(i) + "");
letter.setFont(FONT);
letter.setFill(Color.WHITE);
letter.setOpacity(0);
letters.getChildren().add(letter);
FadeTransition ft = new FadeTransition(Duration.seconds(2), letter);
ft.setDelay(Duration.millis(i * 50));
ft.setToValue(1);
ft.setAutoReverse(true);
ft.setCycleCount(TranslateTransition.INDEFINITE);
ft.play();
}
return letters;
}
示例8: ExceptionWitnessResponderButton
import javafx.animation.FadeTransition; //導入方法依賴的package包/類
/**
* @param origin The same origin that is passed to the
* {@link edu.wpi.grip.core.util.ExceptionWitness}
*/
@Inject
ExceptionWitnessResponderButton(@Assisted Object origin, @Assisted String popOverTitle) {
super();
this.origin = checkNotNull(origin, "The origin can not be null");
this.popOverTitle = checkNotNull(popOverTitle, "The pop over title can not be null");
this.tooltip = new Tooltip();
this.getStyleClass().add(STYLE_CLASS);
final ImageView icon = new ImageView("/edu/wpi/grip/ui/icons/warning.png");
setOnMouseClicked(event -> getPopover().show(this));
setVisible(false);
setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
setGraphic(icon);
icon.setFitWidth(DPIUtility.SMALL_ICON_SIZE);
icon.setFitHeight(DPIUtility.SMALL_ICON_SIZE);
FadeTransition ft = new FadeTransition(Duration.millis(750), icon);
ft.setToValue(0.1);
ft.setCycleCount(Transition.INDEFINITE);
ft.setAutoReverse(true);
ft.play();
}
示例9: pickGraphic
import javafx.animation.FadeTransition; //導入方法依賴的package包/類
/**
* Gets the graphic that should be used for the button given the current source's state
*
* @return The graphic to show on the button.
*/
private static ImageView pickGraphic(RestartableService startStoppable) {
final boolean running = startStoppable.isRunning();
final ImageView icon = running ? new ImageView(stopImage) : new ImageView(startImage);
if (!running) {
// If we are not running then we want the icon to flash
final FadeTransition ft = new FadeTransition(Duration.millis(750), icon);
ft.setToValue(0.1);
ft.setCycleCount(Transition.INDEFINITE);
ft.setAutoReverse(true);
ft.play();
}
icon.setFitHeight(DPIUtility.MINI_ICON_SIZE);
icon.setFitWidth(DPIUtility.MINI_ICON_SIZE);
return icon;
}
示例10: fadeText
import javafx.animation.FadeTransition; //導入方法依賴的package包/類
public static void fadeText(String label,StackPane stack,double x,double y,Color c){
String temp = "";
if(label.length()>50)
temp = label.substring(0, 50);
else
temp = label;
Label lb = new Label(temp);
lb.setTranslateX(x);
lb.setTranslateY(y);
lb.setTextFill(c);
lb.setStyle("-fx-font-size: 20pt;");
stack.getChildren().add(lb);
FadeTransition ft = new FadeTransition(Duration.millis(2000),lb);
ft.setFromValue(1.0);
ft.setToValue(0);
ft.setCycleCount(1);
ft.setAutoReverse(true);
ft.play();
}
示例11: ImagePane
import javafx.animation.FadeTransition; //導入方法依賴的package包/類
/**
* Creates a new ImagePane with the given Image
* @param image
*/
public ImagePane(Image image){
imageView = new ImageView();
imageView.setSmooth(true);
imageView.fitWidthProperty().bind(widthProperty());
imageView.fitHeightProperty().bind(heightProperty());
fadeTransition =
new FadeTransition(Duration.millis(2000), imageView);
fadeTransition.setFromValue(0.0f);
fadeTransition.setToValue(1.0f);
fadeTransition.setCycleCount(1);
fadeTransition.setAutoReverse(false);
fadeTransition.setCycleCount(1);
setCenter(imageView);
imageProperty().addListener(imageChangeListener);
setImage(image);
}
示例12: prepareRunningAnimation
import javafx.animation.FadeTransition; //導入方法依賴的package包/類
private FadeTransition prepareRunningAnimation( ) {
final FadeTransition transition = new FadeTransition( Duration.millis( 1500 ) );
transition.setFromValue( 1.0 );
transition.setToValue( 0.5 );
transition.setCycleCount( Timeline.INDEFINITE );
transition.setAutoReverse( true );
return transition;
}
示例13: prepareRunningAnimation
import javafx.animation.FadeTransition; //導入方法依賴的package包/類
private FadeTransition prepareRunningAnimation( ) {
final FadeTransition transition = new FadeTransition( Duration.millis( 1500 ), this );
transition.setFromValue( 1.0 );
transition.setToValue( 0.5 );
transition.setCycleCount( Timeline.INDEFINITE );
transition.setAutoReverse( true );
return transition;
}
示例14: showText
import javafx.animation.FadeTransition; //導入方法依賴的package包/類
public void showText(String text, Consumer<FadingNotificationText> cleanup) {
messageLabel.setText(text);
setOpacity(1.0);
FadeTransition fadeTransition = new FadeTransition(Duration.millis(200.0), this);
fadeTransition.setDelay(Duration.millis(3000.0));
fadeTransition.setFromValue(1.0);
fadeTransition.setToValue(0.0);
fadeTransition.setCycleCount(1);
fadeTransition.setAutoReverse(false);
fadeTransition.setOnFinished(event -> cleanup.accept(this));
fadeTransition.play();
}
示例15: setFadeIn
import javafx.animation.FadeTransition; //導入方法依賴的package包/類
/**
* Make fade in on button press
* @param c circle which is pressed
*/
private void setFadeIn(Circle c) {
FadeTransition ft = new FadeTransition(Duration.millis(300), c);
ft.setFromValue(0.3);
ft.setToValue(1);
ft.setCycleCount(1);
ft.setAutoReverse(true);
ft.play();
}