@Override protected void configure() { String mathRecenteredJSONFile = MATH_RECENTERED_JSON_FILE; String verbalRecenteredJSONFile = VERBAL_RECENTERED_JSON_FILE; String settingsFileName = SETTINGS_FILE_NAME; bind(BuilderFactory.class).to(JavaFXBuilderFactory.class); bind(String.class).annotatedWith(Names.named("mathRecenteredJSONFile")).toInstance(mathRecenteredJSONFile); bind(String.class).annotatedWith(Names.named("verbalRecenteredJSONFile")).toInstance(verbalRecenteredJSONFile); bind(String.class).annotatedWith(Names.named("settingsFileName")).toInstance(settingsFileName); bind(SettingsDAO.class).to(SettingsDAOImpl.class).asEagerSingleton(); bind(RecenteredDAO.class).to(RecenteredDAOImpl.class).asEagerSingleton(); bindInterceptor(Matchers.subclassesOf(ManagedDataSource.class), Matchers.any(), new ManagedDataSourceInterceptor()); }
@Override protected void configure() { String mathRecenteredJSONFile = MATH_RECENTERED_JSON_FILE; String verbalRecenteredJSONFile = VERBAL_RECENTERED_JSON_FILE; String settingsFileName = SETTINGS_FILE_NAME; bind(BuilderFactory.class).to(JavaFXBuilderFactory.class); bind(String.class).annotatedWith(Names.named("mathRecenteredJSONFile")).toInstance(mathRecenteredJSONFile); bind(String.class).annotatedWith(Names.named("verbalRecenteredJSONFile")).toInstance(verbalRecenteredJSONFile); bind(String.class).annotatedWith(Names.named("settingsFileName")).toInstance(settingsFileName); bind(SettingsDAO.class).to(SettingsDAOImpl.class).asEagerSingleton(); bind(RecenteredDAO.class).to(RecenteredDAOImpl.class).asEagerSingleton(); }
public static BuilderFactory getInstance() { if (factory == null) { factory = new GargoyleBuilderFactory(); } return factory; }
@Override public void start(Stage primaryStage) throws Exception { if( logger.isDebugEnabled() ) { logger.debug("[START]"); } Injector injector = Guice.createInjector(new OldScoresModule()); FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml1/MainView.fxml"), null, injector.getInstance(BuilderFactory.class), injector.getInstance(GuiceControllerFactory.class)); Parent p = loader.load(); MainViewController mv = loader.getController(); Scene scene = new Scene( p ); scene.setOnKeyPressed(evt -> { if( evt.getCode().equals(KeyCode.F1) ) { try { if( logger.isDebugEnabled() ) { logger.debug("[OPEN HELP]"); } mv.openHelpDialog(); } catch (IOException exc) { String msg = "error showing help dialog"; logger.error(msg); Alert alert = new Alert(Alert.AlertType.ERROR, msg); alert.showAndWait(); } } }); primaryStage.setTitle("Old Scores"); primaryStage.setScene(scene); primaryStage.show(); }
@Override public void start(Stage primaryStage) throws Exception { if( logger.isDebugEnabled() ) { logger.debug("[START]"); } Injector injector = Guice.createInjector(new OldScoresModule()); FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml2/MainView.fxml"), null, injector.getInstance(BuilderFactory.class), injector.getInstance(GuiceControllerFactory.class)); Parent p = loader.load(); MainViewController mv = loader.getController(); Scene scene = new Scene( p ); scene.setOnKeyPressed(evt -> { if( evt.getCode().equals(KeyCode.F1) ) { try { if( logger.isDebugEnabled() ) { logger.debug("[OPEN HELP]"); } mv.openHelpDialog(); } catch (IOException exc) { String msg = "error showing help dialog"; logger.error(msg); Alert alert = new Alert(Alert.AlertType.ERROR, msg); alert.showAndWait(); } } }); primaryStage.setTitle("Old Scores"); primaryStage.setScene(scene); primaryStage.show(); }
@Bean public FXMLControllerLoader fxmlComponentLoader(@Qualifier("fxmlComponentControllerFactory") Callback<Class<?>, Object> controllerFactory, @Qualifier("fxmlComponentBuilderFactory") BuilderFactory builderFactory, @Qualifier("fxmlComponentResourceBundle") ResourceBundle resourceBundle) { FXMLControllerLoader fxmlControllerLoader = new FXMLControllerLoader(); fxmlControllerLoader.setControllerFactory(controllerFactory); fxmlControllerLoader.setBuilderFactory(builderFactory); fxmlControllerLoader.setResourceBundle(resourceBundle); return fxmlControllerLoader; }
public void configure(Binder binder) { binder.install(new VarsJpaModule(annotationPersistenceUnit, knowledgebasePersistenceUnit, miscPersistenceUnit)); binder.bind(BuilderFactory.class).to(JavaFXBuilderFactory.class); binder.bind(AsyncQueryService.class).to(AsyncQueryServiceImpl.class).asEagerSingleton(); // Fork join pool causes problems in java web start //binder.bind(Executor.class).to(ForkJoinPool.class).asEagerSingleton(); Executor executor = Executors.newCachedThreadPool(); binder.bind(Executor.class).toInstance(executor); }
public void setBuilderFactory(BuilderFactory factory) { this.deligator = factory; }
@Override public void start(Stage primaryStage) throws Exception { if( logger.isDebugEnabled() ) { logger.debug("[START]"); } Injector injector = Guice.createInjector(new OldScoresModule()); FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml3/MainView.fxml"), null, injector.getInstance(BuilderFactory.class), injector.getInstance(GuiceControllerFactory.class)); Parent p = loader.load(); MainViewController mv = loader.getController(); Scene scene = new Scene( p ); scene.setOnKeyPressed(evt -> { if( evt.getCode().equals(KeyCode.F1) ) { try { if( logger.isDebugEnabled() ) { logger.debug("[OPEN HELP]"); } injector.getInstance(NavigationDelegate.class).openHelpDialog(); } catch (Exception exc) { String msg = "error showing help dialog"; logger.error(msg); Alert alert = new Alert(Alert.AlertType.ERROR, msg); alert.showAndWait(); } } }); primaryStage.setTitle("Old Scores"); primaryStage.setScene(scene); primaryStage.show(); }
public void setBuilderFactory(BuilderFactory builderFactory) { this.builderFactory = builderFactory; }
/** * 프로그램당 하나의 builder만 * * @작성자 : KYJ * @작성일 : 2017. 12. 23. * @param _builderFactory */ public static void setBuilderFactory(BuilderFactory _builderFactory) { builderFactory = _builderFactory; }