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


Java FluentViewLoader类代码示例

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


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

示例1: newGame

import de.saxsys.mvvmfx.FluentViewLoader; //导入依赖的package包/类
@FXML
public void newGame(){
    ChoiceDialog<Integer> dialog = new ChoiceDialog<>(viewModel.sizeProperty().get(), viewModel.getSizeOptions());
    dialog.setTitle("New Game");
    dialog.setHeaderText("Start a new Game");
    dialog.setContentText("Choose the size:");

    Optional<Integer> result = dialog.showAndWait();
    result.ifPresent(size->{
        viewModel.sizeProperty().set(size);

        final ViewTuple<PuzzleView, PuzzleViewModel> viewTuple = FluentViewLoader.fxmlView(PuzzleView.class).load();

        final Parent view = viewTuple.getView();

        center.setMinSize(0,0);
        center.setPrefSize(0,0);

        if(view instanceof Region){
            center.setContent((Region) view);
        }
    });
}
 
开发者ID:lestard,项目名称:nonogram,代码行数:24,代码来源:MainView.java

示例2: start

import de.saxsys.mvvmfx.FluentViewLoader; //导入依赖的package包/类
@Override
public void start(Stage stage) throws Exception {
	stage.setTitle("TodoMVVM");

	EasyDI diContext = new EasyDI();
	diContext.markAsSingleton(TodoItemStore.class);

	MvvmFX.setCustomDependencyInjector(diContext::getInstance);

	final Parent parent = FluentViewLoader.fxmlView(MainView.class).load().getView();
       final Scene scene = new Scene(parent);

       stage.setScene(scene);
	stage.show();
}
 
开发者ID:lestard,项目名称:todomvcFX,代码行数:16,代码来源:MvvmfxApp.java

示例3: open

import de.saxsys.mvvmfx.FluentViewLoader; //导入依赖的package包/类
public static void open() {

        if(stage == null) {
            stage = new Stage();
            stage.setScene(new Scene(FluentViewLoader.fxmlView(BenchmarkView.class).load().getView()));
        }

        stage.show();
        stage.toFront();
    }
 
开发者ID:lestard,项目名称:ColorPuzzleFX,代码行数:11,代码来源:BenchmarkViewPopup.java

示例4: open

import de.saxsys.mvvmfx.FluentViewLoader; //导入依赖的package包/类
public static void open() {

        if(stage == null) {
            stage = new Stage();
            final ViewTuple<SolverView, SolverViewModel> viewTuple = FluentViewLoader.fxmlView(SolverView.class).load();

            final SolverViewModel solverViewModel = viewTuple.getViewModel();
            stage.setOnCloseRequest(event -> solverViewModel.pause());

            stage.setScene(new Scene(viewTuple.getView()));
        }

        stage.show();
        stage.toFront();
    }
 
开发者ID:lestard,项目名称:ColorPuzzleFX,代码行数:16,代码来源:SolverViewPopup.java

示例5: start

import de.saxsys.mvvmfx.FluentViewLoader; //导入依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
    EasyDI easyDI = new EasyDI();
    MvvmFX.setCustomDependencyInjector(easyDI::getInstance);

    final ViewTuple<MainView, MainViewModel> viewTuple = FluentViewLoader.fxmlView(MainView.class).load();

    primaryStage.setScene(new Scene(viewTuple.getView(), 600, 600));

    primaryStage.show();
}
 
开发者ID:lestard,项目名称:nonogram,代码行数:12,代码来源:Launcher.java

示例6: start

import de.saxsys.mvvmfx.FluentViewLoader; //导入依赖的package包/类
@Override
public void start(Stage stage) throws Exception {
    stage.setTitle("ColorPuzzleFX");

    EasyDI context = new EasyDI();
    context.bindInterface(Solver.class, BogoSolver.class);

    MvvmFX.setCustomDependencyInjector(context::getInstance);


    final ViewTuple<MainView, MainViewModel> viewTuple = FluentViewLoader.fxmlView(MainView.class).load();

    stage.setScene(new Scene(viewTuple.getView()));
    stage.sizeToScene();
    stage.show();

}
 
开发者ID:lestard,项目名称:ColorPuzzleFX,代码行数:18,代码来源:App.java

示例7: initFinishedPopup

import de.saxsys.mvvmfx.FluentViewLoader; //导入依赖的package包/类
private void initFinishedPopup() {
    final ViewTuple<FinishedView, FinishedViewModel> viewTuple = FluentViewLoader.fxmlView(FinishedView.class).load();

    viewTuple.getViewModel().setOnNewGame((v) -> newGame());

    centerPane.getChildren().add(viewTuple.getView());

    viewTuple.getView().visibleProperty().bind(viewModel.gameFinished());
}
 
开发者ID:lestard,项目名称:ColorPuzzleFX,代码行数:10,代码来源:MainView.java


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