Search in sources :

Example 1 with SessionModel

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;
}
Also used : SessionModel(io.github.vocabhunter.gui.model.SessionModel) Node(javafx.scene.Node) SessionViewTool(io.github.vocabhunter.gui.view.SessionViewTool)

Example 2 with 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());
}
Also used : SessionState(io.github.vocabhunter.analysis.session.SessionState) EnrichedSessionState(io.github.vocabhunter.analysis.session.EnrichedSessionState) SessionModel(io.github.vocabhunter.gui.model.SessionModel)

Aggregations

SessionModel (io.github.vocabhunter.gui.model.SessionModel)2 EnrichedSessionState (io.github.vocabhunter.analysis.session.EnrichedSessionState)1 SessionState (io.github.vocabhunter.analysis.session.SessionState)1 SessionViewTool (io.github.vocabhunter.gui.view.SessionViewTool)1 Node (javafx.scene.Node)1