All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bidib.wizard.mvc.stepcontrol.controller.StepControlController Maven / Gradle / Ivy

There is a newer version: 2.0.0-M1
Show newest version
package org.bidib.wizard.mvc.stepcontrol.controller;

import org.bidib.wizard.mvc.main.model.MainModel;
import org.bidib.wizard.mvc.main.model.listener.CvDefinitionListener;
import org.bidib.wizard.mvc.main.view.panel.listener.TabStatusListener;
import org.bidib.wizard.mvc.stepcontrol.view.StepControlPanel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class StepControlController implements CvDefinitionListener {
    private static final Logger LOGGER = LoggerFactory.getLogger(StepControlController.class);

    private StepControlPanel stepControlPanel;

    public void start(final MainModel mainModel, final TabStatusListener tabStatusListener) {
        stepControlPanel = new StepControlPanel(mainModel, tabStatusListener);
        stepControlPanel.createComponent();

        // add the node list listener
        mainModel.addCvDefinitionListener(this);
    }

    public StepControlPanel getComponent() {
        return stepControlPanel;
    }

    @Override
    public void cvDefinitionChanged() {
        LOGGER.info("The CV definition has changed.");

        if (stepControlPanel != null) {
            LOGGER.info("Notify the stepControlPanel panel: {}", stepControlPanel);

            stepControlPanel.cvDefinitionChanged();
        }

    }

    @Override
    public void cvDefinitionValuesChanged() {
        LOGGER.info("The CV definition values have changed.");

        if (stepControlPanel != null) {
            LOGGER.info("Notify the stepControlPanel panel: {}", stepControlPanel);

            stepControlPanel.cvDefinitionValuesChanged();
        }

    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy