use of io.github.vocabhunter.gui.model.SessionModel in project VocabHunter by VocabHunter.
the class SessionStateHandler method addSession.
public SessionModel addSession(final SessionState state) {
SessionViewTool viewTool = new SessionViewTool();
SessionModelTool sessionTool = new SessionModelTool(state, model.getFilterSettings(), viewTool.selectedProperty(), settingsManager.getWindowSettings().orElseGet(WindowSettings::new));
SessionModel sessionModel = sessionTool.buildModel();
ControllerAndView<SessionController, Node> cav = sessionProvider.get();
SessionController controller = cav.getController();
controller.initialise(guiTaskHandler, sessionModel);
viewTool.setTabContent(SessionTab.ANALYSIS, cav.getView());
viewTool.setTabContent(SessionTab.PROGRESS, progressView(sessionModel));
mainBorderPane.setCenter(viewTool.getView());
sessionActions = controller.getSessionActions();
return sessionModel;
}
use of io.github.vocabhunter.gui.model.SessionModel in project VocabHunter by VocabHunter.
the class GuiFileHandler method finishOpen.
private void finishOpen(final EnrichedSessionState enrichedState) {
SessionState state = enrichedState.getState();
SessionModel sessionModel = sessionStateHandler.addSession(state);
model.replaceSessionModel(state, sessionModel, enrichedState.getFile().orElse(null));
statusManager.replaceSession(sessionModel.getPosition(), sessionModel.getProgress());
}
Aggregations