當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。