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


Java PauseTransition类代码示例

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


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

示例1: onActionSimulateGameMode

import javafx.animation.PauseTransition; //导入依赖的package包/类
private void onActionSimulateGameMode(EGameMode gameMode) {
    DebugConsole.getDefault().debug(this.getClass(), "On Action simulate GameMode: " + gameMode.toString()); // NOI18N

    final SequentialTransition st = new SequentialTransition();
    st.setDelay(Duration.millis(125.0d));
    
    final PauseTransition ptStopGameMode = this.onActionStopGameMode();
    st.getChildren().add(ptStopGameMode);
    
    final FadeTransition ftHideGameInformations = this.onActionHideGameInformations();
    st.getChildren().add(ftHideGameInformations);
    
    final FadeTransition ftShowGameInformations = this.onActionShowGameInformations(gameMode);
    st.getChildren().add(ftShowGameInformations);
    
    final PauseTransition ptStartGameMode = this.onActionStartGameMode(gameMode);
    st.getChildren().add(ptStartGameMode);
    
    st.playFromStart();
}
 
开发者ID:Naoghuman,项目名称:Incubator,代码行数:21,代码来源:GameEngine.java

示例2: addContinuousPressHandler

import javafx.animation.PauseTransition; //导入依赖的package包/类
/**
 * Add an event handler to a node will trigger continuously trigger at a given interval while the button is
 * being pressed.
 *
 * @param node     the {@link Node}
 * @param holdTime interval time
 * @param handler  the handler
 */
private void addContinuousPressHandler(final Node node, final Duration holdTime,
                                       final EventHandler<MouseEvent> handler) {
    final Wrapper<MouseEvent> eventWrapper = new Wrapper<>();

    final PauseTransition holdTimer = new PauseTransition(holdTime);
    holdTimer.setOnFinished(event -> {
        handler.handle(eventWrapper.content);
        holdTimer.playFromStart();
    });

    node.addEventHandler(MouseEvent.MOUSE_PRESSED, event -> {
        eventWrapper.content = event;
        holdTimer.playFromStart();
    });
    node.addEventHandler(MouseEvent.MOUSE_RELEASED, event -> holdTimer.stop());
    node.addEventHandler(MouseEvent.DRAG_DETECTED, event -> holdTimer.stop());
}
 
开发者ID:ProgrammingLife2017,项目名称:hygene,代码行数:26,代码来源:GraphNavigationController.java

示例3: regionOrProductChanged

import javafx.animation.PauseTransition; //导入依赖的package包/类
public void regionOrProductChanged() {
    cancel();
    boolean regionChanged = updateRegionAndProductSelection();
    if (regionChanged) {
        // pause the data updating to wait for animation to finish
        PauseTransition delay = new PauseTransition(Duration.millis(1500));
        delay.setOnFinished(new EventHandler<ActionEvent>() {
            @Override public void handle(ActionEvent t) {
                restart();
            }
        });
        delay.play();
    } else {
        restart();
    }
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:17,代码来源:LiveDataFetcher.java

示例4: initialize

import javafx.animation.PauseTransition; //导入依赖的package包/类
@Override
public void initialize(URL location, ResourceBundle resources) {

	tableColumnScope.setCellValueFactory(new PropertyValueFactory<>("scope"));
	tableColumnIdentifier.setCellValueFactory(new PropertyValueFactory<>("identifier"));
	tableColumnParameter.setCellValueFactory(new PropertyValueFactory<>("parameter"));
	tableColumnType.setCellValueFactory(new PropertyValueFactory<>("type"));
	tableColumnValue.setCellValueFactory(new PropertyValueFactory<>("data"));

	PauseTransition refreshLoop = new PauseTransition();
	refreshLoop.setOnFinished(e -> {
		if (toggleButtonRefresh.isSelected())
			refresh();
		refreshLoop.playFromStart();
	});
	refreshLoop.setDuration(Duration.seconds(0.5));
	refreshLoop.playFromStart();

	refresh();
}
 
开发者ID:enoy19,项目名称:keyboard-light-composer,代码行数:21,代码来源:ExternalMonitor.java

示例5: onCloseRequest

import javafx.animation.PauseTransition; //导入依赖的package包/类
private void onCloseRequest() {
    final char borderSign = Properties.getPropertyForTestdataApplication(KEY__TESTDATA_APPLICATION__BORDER_SIGN).charAt(0);
    final String message = Properties.getPropertyForTestdataApplication(KEY__TESTDATA_APPLICATION__MESSAGE_STOP);
    final String title = Properties.getPropertyForTestdataApplication(KEY__TESTDATA_APPLICATION__TITLE);
    LoggerFacade.getDefault().message(borderSign, 80, message + title);
    
    try {
        TestdataFacade.getDefault().shutdown();
    } catch (InterruptedException e) {
    }
    
    Injector.forgetAll();
    DatabaseFacade.getDefault().shutdown();
    
    final PauseTransition pt = new PauseTransition(LITTLE_DELAY__DURATION_125);
    pt.setOnFinished((ActionEvent event) -> {
        Platform.exit();
    });
    pt.playFromStart();
}
 
开发者ID:Naoghuman,项目名称:ABC-List,代码行数:21,代码来源:TestdataApplication.java

示例6: onCloseRequest

import javafx.animation.PauseTransition; //导入依赖的package包/类
private void onCloseRequest() {
    // afterburner.fx
    Injector.forgetAll();
    
    // Database
    DatabaseFacade.getDefault().shutdown();
    
    // Message
    final char borderSign = Properties.getPropertyForApplication(KEY__APPLICATION__BORDER_SIGN).charAt(0);
    final String message = Properties.getPropertyForApplication(KEY__APPLICATION__MESSAGE_STOP);
    final String title = Properties.getPropertyForApplication(KEY__APPLICATION__TITLE)
            + Properties.getPropertyForApplication(KEY__APPLICATION__VERSION);
    LoggerFacade.getDefault().message(borderSign, 80, String.format(message, title));
    
    // Timer
    final PauseTransition pt = new PauseTransition(LITTLE_DELAY__DURATION_125);
    pt.setOnFinished((ActionEvent event) -> {
        Platform.exit();
    });
    pt.playFromStart();
}
 
开发者ID:Naoghuman,项目名称:ABC-List,代码行数:22,代码来源:StartApplication.java

示例7: MouseHandler

import javafx.animation.PauseTransition; //导入依赖的package包/类
public MouseHandler(Duration maxTimeBetweenSequentialClicks) {
    bind();
    clickTimer = new PauseTransition(maxTimeBetweenSequentialClicks);
    clickTimer.setOnFinished(event -> {
        int count = sequentialClickCount.get();
        sequentialClickCount.set(0);
        switch (count) {
            case 1:
                singleClick(mouseEvent);
                break;
            case 2:
                doubleClick(mouseEvent);
                break;
            case 3:
                tripleClick(mouseEvent);
                break;
            default:
        }
    });

}
 
开发者ID:ChiralBehaviors,项目名称:Kramer,代码行数:22,代码来源:MouseHandler.java

示例8: onCloseRequest

import javafx.animation.PauseTransition; //导入依赖的package包/类
private void onCloseRequest() {
    // afterburner.fx
    Injector.forgetAll();
    
    // Database
    DatabaseFacade.getDefault().shutdown();
    
    // Message
    final char borderSign = this.getProperty(KEY__APPLICATION__BORDER_SIGN).charAt(0);
    final String message = this.getProperty(KEY__APPLICATION__MESSAGE_STOP);
    final String title = this.getProperty(KEY__APPLICATION__TITLE) + this.getProperty(KEY__APPLICATION__VERSION);
    LoggerFacade.getDefault().message(borderSign, 80, String.format(message, title));
    
    // Timer
    final PauseTransition pt = new PauseTransition(DURATION__125);
    pt.setOnFinished((ActionEvent event) -> {
        Platform.exit();
    });
    pt.playFromStart();
}
 
开发者ID:Naoghuman,项目名称:Project-Templates,代码行数:21,代码来源:StartApplication.java

示例9: onActionShowPageCSS

import javafx.animation.PauseTransition; //导入依赖的package包/类
private void onActionShowPageCSS(ConcreteSample concreteSample) {
    LoggerFacade.getDefault().debug(this.getClass(), "On action show page [CSS]"); // NOI18N
    
    final PauseTransition pt = new PauseTransition();
    pt.setDuration(Duration.millis(25.0d));
    pt.setOnFinished(event -> {
        LoggerFacade.getDefault().debug(this.getClass(), "Load css-url..."); // NOI18N
        
        final boolean hasCssURL = concreteSample.hasCssURL();
        if (hasCssURL) {
            LoggerFacade.getDefault().debug(this.getClass(), "A css-url is defined."); // NOI18N
            
            wvCssPage.getEngine().loadContent(TemplateLoader.loadCSStemplate(concreteSample.getCssURL().get()));
        }
        else {
            LoggerFacade.getDefault().warn(this.getClass(), "No css-url is defined!"); // NOI18N
            
            wvCssPage.getEngine().loadContent(TemplateLoader.loadNoXyURLisDefinedTemplate(TemplateLoader.UrlType.CSS));
        }
    });
    
    pt.playFromStart();
}
 
开发者ID:Naoghuman,项目名称:Project-Templates,代码行数:24,代码来源:ApplicationPresenter.java

示例10: onActionShowPageJavaDoc

import javafx.animation.PauseTransition; //导入依赖的package包/类
private void onActionShowPageJavaDoc(ConcreteSample concreteSample) {
    LoggerFacade.getDefault().debug(this.getClass(), "On action show page [JavaDoc]"); // NOI18N
    
    final PauseTransition pt = new PauseTransition();
    pt.setDuration(Duration.millis(25.0d));
    pt.setOnFinished(event -> {
        LoggerFacade.getDefault().debug(this.getClass(), "Load javadoc-url..."); // NOI18N
        
        final boolean hasJavaDocURL = concreteSample.hasJavaDocURL();
        if (hasJavaDocURL) {
            LoggerFacade.getDefault().debug(this.getClass(), "A javadoc-url is defined."); // NOI18N
        
            wvJavaDocPage.getEngine().load(concreteSample.getJavaDocURL().get());
        }
        else {
            LoggerFacade.getDefault().warn(this.getClass(), "No javadoc-url is defined!"); // NOI18N
            
            wvJavaDocPage.getEngine().loadContent(TemplateLoader.loadNoXyURLisDefinedTemplate(TemplateLoader.UrlType.JAVA_DOC));
        }
    });
    
    pt.playFromStart();
}
 
开发者ID:Naoghuman,项目名称:Project-Templates,代码行数:24,代码来源:ApplicationPresenter.java

示例11: onActionShowPageOverview

import javafx.animation.PauseTransition; //导入依赖的package包/类
private void onActionShowPageOverview(ConcreteSample concreteSample) {
    LoggerFacade.getDefault().debug(this.getClass(), "On action show page [Overview]"); // NOI18N
    
    final PauseTransition pt = new PauseTransition();
    pt.setDuration(Duration.millis(25.0d));
    pt.setOnFinished(event -> {
        LoggerFacade.getDefault().debug(this.getClass(), "Load overview-url..."); // NOI18N
        
        final boolean hasOverviewURL = concreteSample.hasOverviewURL();
        if (hasOverviewURL) {
            LoggerFacade.getDefault().debug(this.getClass(), "A overview-url is defined."); // NOI18N
        
            wvOverviewPage.getEngine().load(concreteSample.getOverviewURL().get());
        }
        else {
            LoggerFacade.getDefault().warn(this.getClass(), "No overview-url is defined!"); // NOI18N
            
            wvOverviewPage.getEngine().loadContent(TemplateLoader.loadNoXyURLisDefinedTemplate(TemplateLoader.UrlType.OVERVIEW));
        }
    });
    
    pt.playFromStart();
}
 
开发者ID:Naoghuman,项目名称:Project-Templates,代码行数:24,代码来源:ApplicationPresenter.java

示例12: onActionShowPageProject

import javafx.animation.PauseTransition; //导入依赖的package包/类
private void onActionShowPageProject(final ConcreteProject concreteProject) {
    LoggerFacade.getDefault().debug(this.getClass(), "On action show page [Project] for: " + concreteProject.getName()); // NOI18N
    
    // Reset previous shown content in sample-view
    wvProjectPage.getEngine().loadContent(TemplateLoader.loadLoadingTemplate());

    final PauseTransition pt = new PauseTransition();
    pt.setDuration(Duration.millis(25.0d));
    pt.setOnFinished(event -> {
        LoggerFacade.getDefault().debug(this.getClass(), "Load project-url..."); // NOI18N

        // Show new project-view
        if (concreteProject.hasProjectURL()) {
            LoggerFacade.getDefault().debug(this.getClass(), "A project-url is defined."); // NOI18N

            wvProjectPage.getEngine().load(concreteProject.getProjectURL().get());
        }
        else {
            LoggerFacade.getDefault().warn(this.getClass(), "No project-url is defined!"); // NOI18N

            wvProjectPage.getEngine().loadContent(TemplateLoader.loadNoXyURLisDefinedTemplate(TemplateLoader.UrlType.PROJECT));
        }
    });
    
    pt.playFromStart();
}
 
开发者ID:Naoghuman,项目名称:Project-Templates,代码行数:27,代码来源:ApplicationPresenter.java

示例13: onActionShowPageSourceCode

import javafx.animation.PauseTransition; //导入依赖的package包/类
private void onActionShowPageSourceCode(ConcreteSample concreteSample) {
    LoggerFacade.getDefault().debug(this.getClass(), "On action show page [SourceCode]"); // NOI18N
    
    final PauseTransition pt = new PauseTransition();
    pt.setDuration(Duration.millis(25.0d));
    pt.setOnFinished(event -> {
        LoggerFacade.getDefault().debug(this.getClass(), "Load sourcecode-url..."); // NOI18N
        
        final boolean hasCssURL = concreteSample.hasCssURL();
        if (hasCssURL) {
            LoggerFacade.getDefault().debug(this.getClass(), "A sourcecode-url is defined."); // NOI18N
            
            wvSourceCodePage.getEngine().loadContent(TemplateLoader.loadSourceCodeTemplate(concreteSample.getSourceCodeURL().get()));
        }
        else {
            LoggerFacade.getDefault().warn(this.getClass(), "No sourcecode-url is defined!"); // NOI18N
            
            wvSourceCodePage.getEngine().loadContent(TemplateLoader.loadNoXyURLisDefinedTemplate(TemplateLoader.UrlType.SOURCE_CODE));
        }
    });
    
    pt.playFromStart();
}
 
开发者ID:Naoghuman,项目名称:Project-Templates,代码行数:24,代码来源:ApplicationPresenter.java

示例14: Splash

import javafx.animation.PauseTransition; //导入依赖的package包/类
/**
 * Initializes the splash screen.
 * 
 * @param create
 * @param learn
 * @param open
 */
public Splash(Command create, Command learn, Command open) {
	this.create = create;
	this.learn = learn;
	this.open = open;
	Image image = new Image(this.getClass().getResourceAsStream(SPLASH_GIF_PATH));

	ImageView iv = new ImageView(image);
	this.getChildren().add(iv);

	Scene scene = new VoogaScene(this);
	Stage stage = new Stage();
	stage.setScene(scene);
	stage.initStyle(StageStyle.UNDECORATED);
	stage.show();

	PauseTransition delay = new PauseTransition(UILauncher.SPLASH_DURATION);
	delay.setOnFinished(event -> {
		stage.close();
		showSplashMessage();
	});
	delay.play();

}
 
开发者ID:sjain28,项目名称:Game-Engine-Vooga,代码行数:31,代码来源:Splash.java

示例15: onCloseRequest

import javafx.animation.PauseTransition; //导入依赖的package包/类
private void onCloseRequest() {
    // afterburner.fx
    Injector.forgetAll();
    
    // Database
    DatabaseFacade.INSTANCE.shutdown();
    
    // Message
    final char borderSign = this.getProperty(KEY__APPLICATION__BORDER_SIGN).charAt(0);
    final String message = this.getProperty(KEY__APPLICATION__MESSAGE_STOP);
    final String title = this.getProperty(KEY__APPLICATION__TITLE);
    LoggerFacade.INSTANCE.message(borderSign, 80, String.format(message, title));
    
    // Timer
    final PauseTransition pt = new PauseTransition(DURATION__125);
    pt.setOnFinished((ActionEvent event) -> {
        Platform.exit();
    });
    pt.playFromStart();
}
 
开发者ID:Naoghuman,项目名称:Incubator,代码行数:21,代码来源:StartApplication.java


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