/** * Needed for hyperlink form switches... * * @param request * @throws DatabaseException */ private void doXrefselect(Tuple request) throws DatabaseException { // also set the parent menu if (getParent() != null && getParent() instanceof MenuController) { // set the filter to select the xref-ed entity pager.resetFilters(); getModel().setUserRules(new ArrayList<QueryRule>()); QueryRule rule = new QueryRule( request.getString("attribute"), QueryRule.Operator.valueOf(request.getString("operator")), request.getString("value")); pager.addFilter(rule); // tell "my" menu to select me Tuple parentRequest = new SimpleTuple(); String aChildName = getModel().getName(); ScreenController<?> aParent = getParent(); while (aParent != null) { if (aParent instanceof MenuModel) { parentRequest.set("select", aChildName); MenuController c = (MenuController) aParent; c.doSelect(parentRequest); } aChildName = aParent.getName(); aParent = aParent.getParent(); } } }
@Override protected void init() { super.init(); screen.setVisible(false); getScreenDirector().addActor(screen); getOSinterface().setMultiplayerControllerAndAttemptToConnect(multiplayerController); }
@FXML void actionComboBoxHandler(ActionEvent event) throws IOException { Parent parent; int selectedIndex = actionComboBox.getSelectionModel().getSelectedIndex(); String title = actionComboBox.getSelectionModel().getSelectedItem(); // Switch to a different scene based on choice selected by user switch (selectedIndex) { case 0: parent = FXMLLoader.load(getClass().getResource("/fxml/AddPlayer.fxml")); break; case 1: parent = FXMLLoader.load(getClass().getResource("/fxml/AddGame.fxml")); break; case 2: parent = FXMLLoader.load(getClass().getResource("/fxml/UpdatePlayer.fxml")); break; case 3: parent = FXMLLoader.load(getClass().getResource("/fxml/DisplayPlayerGame.fxml")); break; default: parent = FXMLLoader.load(getClass().getResource("/fxml/MainWindow.fxml")); break; } // Set scene super.setScreen(event, parent, title); }
@Override public void reload(Database db) { logger.info("reloading..."); FormModel<E> model = getModel(); try { pager.setDirty(true); // reset pager List<QueryRule> rules = new ArrayList<QueryRule>(); rules.addAll(model.getUserRules()); rules.addAll(model.getSystemRules()); pager.resetFilters(rules); // check view and set limit accordingly if (model.getMode().equals(Mode.EDIT_VIEW)) pager.setLimit(1); else pager.setLimit(model.getLimit()); // refresh pager and options if (model.isReadonly()) pager.refresh(db); // update view // set readonly records // view.setRecords( pager.getPage() ); model.setRecords(this.getData(db)); model.setCount(pager.getCount(db)); model.setOffset(pager.getOffset()); model.setSort(pager.getOrderByField()); model.setSortMode(pager.getOrderByOperator()); // update child views if (model.getMode().equals(Mode.EDIT_VIEW)) { for (ScreenController<?> c : this.getChildren()) { // only the real screens, not the commands if (c instanceof SimpleScreenController<?>) { c.reload(db); } } } logger.debug("reload finished."); } catch (Exception e) { logger.error("reload() failed: " + e.getMessage()); e.printStackTrace(); } }
@Override void activate() { super.activate(); boolean fromSplash = checkForSplashScreen(); screen.buildViews(); screen.clearActions(); screen.setVisible(true); getScreenDirector().addActor(screen); if (fromSplash) screen.revealAnimation(); screen.startShowAnimation(); }
@FXML protected void handleSubmitButtonAction(ActionEvent event) { db.Connect(); boolean test = db.userExist(username.getText().toString()); if (test) { System.out.println("User Exists"); test = db.checkPassword(username.getText().toString(), password.getText().toString()); if (test) { // if username and password is correct program moves to main screen System.out.println("Password is correct"); myController.setScreen(WellCheck.screenID2); db.patientTable(); } } username.clear(); password.clear(); System.out.println(username.getText().toString()); }
@Override protected void disposeController() { super.disposeController(); screen.dispose(); }
@Override void deactivate() { super.deactivate(); }
/** * Goes to Screen 7, passing the ActionEvent * * @param event */ @FXML private void goToScreen7(ActionEvent event) { controller.setScreen(ScreenFramework.screen7ID); }
/** * Goes to Screen 1, passing the ActionEvent * * @param event * @throws IOException */ @FXML private void goToScreen1(ActionEvent event) throws IOException { controller.setScreen(ScreenFramework.screen1ID); }
/** * Goes to Screen 6, passing the ActionEvent * * @param event */ @FXML private void goToScreen6(ActionEvent event) { controller.setScreen(ScreenFramework.screen6ID); // goto editTask }
/** * Goes to Screen2 , passing the ActionEvent * * @param event */ @FXML private void goToScreen2(ActionEvent event) { controller.setScreen(ScreenFramework.screen2ID); // goto this }
/** * Goes to Screen 5, passing the ActionEvent * * @param event */ @FXML private void goToScreen5(ActionEvent event) { controller.setScreen(ScreenFramework.screen5ID); // goto confirmation -> createTask }
/** * Goes to Screen 4, passing the ActionEvent * * @param event */ @FXML private void goToScreen4(ActionEvent event) { controller.setScreen(ScreenFramework.screen4ID); // goto create Task }
public void create() { for (AbstractScreen _screen : this.states.values()) { _screen.create(); } screenCtr.create(); }