Package fr.soleil.salsa.entity.event

Examples of fr.soleil.salsa.entity.event.Config2DModel


        return allActuators;
    }

    @Override
    protected IConfig<IDimension2DX> initModel() {
        Config2DModel config2DModel = new Config2DModel(this);

        IDimension2DX dimension2DX = (IDimension2DX) getDimensionX();
        if (dimension2DX != null) {
            IDimension2DX dimensionModel = (IDimension2DX) dimension2DX.toModel();
            List<IActuator> actuatorList = dimension2DX.getActuatorsList();
            List<IActuator> actuatorListModel = convertActuatorListToModel(actuatorList);
            dimensionModel.setActuatorsList(actuatorListModel);

            List<IRange2DX> rangeList = dimension2DX.getRangesList();
            List<IRange2DX> rangeModelList = new ArrayList<IRange2DX>();
            for (IRange2DX range : rangeList) {
                rangeModelList.add((IRange2DX) range.toModel());
            }
            dimension2DX.setRangesList(rangeModelList);

            config2DModel.setDimensionX(dimensionModel);

        }

        if (dimensionY != null) {
            IDimension2DY dimensionModel = (IDimension2DY) dimensionY.toModel();
            List<IActuator> actuatorList = dimensionY.getActuatorsList();
            List<IActuator> actuatorListModel = convertActuatorListToModel(actuatorList);
            dimensionModel.setActuatorsList(actuatorListModel);

            List<IRange2DY> rangeList = dimensionY.getRangesList();
            List<IRange2DY> rangeModelList = new ArrayList<IRange2DY>();
            for (IRange2DY range : rangeList) {
                rangeModelList.add((IRange2DY) range.toModel());
            }
            dimensionY.setRangesList(rangeModelList);

            config2DModel.setDimensionY(dimensionModel);
        }

        return config2DModel;
    }
View Full Code Here


     */
    public void startListening(IConfig<?> config) {
        if (config != null) {
            stopListening();

            Config2DModel config2DModel = (Config2DModel) config;
            config2DModel.addListener(listenerConfig2D);

            Dimension2DYModel dimension2DYModel = (Dimension2DYModel) config2DModel.getDimensionY();
            dimension2DYModel.addListener(listenerDimension2DY);

            for (IActuator actuator : dimension2DYModel.getActuatorsList()) {
                ((ActuatorModel) actuator).addListener(listenerActuator);
            }
View Full Code Here

    /**
     * Stop listening to a config and its elements.
     */
    public void stopListening() {
        if (config != null) {
            Config2DModel config2DModel = (Config2DModel) config;
            config2DModel.removeListener(listenerConfig2D);

            Dimension2DYModel dimension2DYModel = (Dimension2DYModel) config2DModel.getDimensionY();
            dimension2DYModel.removeListener(listenerDimension2DY);

            for (IActuator actuator : dimension2DYModel.getActuatorsList()) {
                ((ActuatorModel) actuator).removeListener(listenerActuator);
            }
View Full Code Here

    public void startListening(IConfig<?> config) {
        if (config != null) {

            stopListening();

            Config2DModel config2DModel = (Config2DModel) config;
            config2DModel.addListener(listenerConfig2D);

            Dimension2DXModel dimension2DXModel = (Dimension2DXModel) config2DModel.getDimensionX();
            dimension2DXModel.addListener(listenerDimension2DX);

            for (IActuator actuator : dimension2DXModel.getActuatorsList()) {
                ((ActuatorModel) actuator).addListener(listenerActuator);
            }
View Full Code Here

    /**
     * Stop listening to a config and its elements.
     */
    public void stopListening() {
        if (config != null) {
            Config2DModel config2DModel = (Config2DModel) config;
            config2DModel.removeListener(listenerConfig2D);

            Dimension2DXModel dimension2DXModel = (Dimension2DXModel) config2DModel.getDimensionX();
            dimension2DXModel.removeListener(listenerDimension2DX);

            for (IActuator actuator : dimension2DXModel.getActuatorsList()) {
                ((ActuatorModel) actuator).removeListener(listenerActuator);
            }
View Full Code Here

    public void startListening(IConfig<?> config) {
        if (config != null) {

            stopListening();

            Config2DModel config2DModel = (Config2DModel) config;
            config2DModel.addListener(listenerConfig2D);

            Dimension2DXModel dimension2DXModel = (Dimension2DXModel) config2DModel.getDimensionX();
            dimension2DXModel.addListener(listenerDimension2DX);

            for (IActuator actuator : dimension2DXModel.getActuatorsList()) {
                ((ActuatorModel) actuator).addListener(listenerActuator);
            }
View Full Code Here

    /**
     * Stop listening to a config and its elements.
     */
    public void stopListening() {
        if (config != null) {
            Config2DModel config2DModel = (Config2DModel) config;
            config2DModel.removeListener(listenerConfig2D);

            Dimension2DXModel dimension2DXModel = (Dimension2DXModel) config2DModel.getDimensionX();
            dimension2DXModel.removeListener(listenerDimension2DX);

            for (IActuator actuator : dimension2DXModel.getActuatorsList()) {
                ((ActuatorModel) actuator).removeListener(listenerActuator);
            }
View Full Code Here

    public void startListening(IConfig<?> config) {
        if (config != null) {

            stopListening();

            Config2DModel config2DModel = (Config2DModel) config;
            config2DModel.addListener(listenerConfig2D);

            Dimension2DXModel dimension2DXModel = (Dimension2DXModel) config2DModel.getDimensionX();
            dimension2DXModel.addListener(listenerDimension2DX);

            for (IActuator actuator : dimension2DXModel.getActuatorsList()) {
                ((ActuatorModel) actuator).addListener(listenerActuator);
            }
View Full Code Here

    /**
     * Stop listening to a config and its elements.
     */
    public void stopListening() {
        if (config != null) {
            Config2DModel config2DModel = (Config2DModel) config;
            config2DModel.removeListener(listenerConfig2D);

            Dimension2DXModel dimension2DXModel = (Dimension2DXModel) config2DModel.getDimensionX();
            dimension2DXModel.removeListener(listenerDimension2DX);

            for (IActuator actuator : dimension2DXModel.getActuatorsList()) {
                ((ActuatorModel) actuator).removeListener(listenerActuator);
            }
View Full Code Here

    public void startListening(IConfig<?> config) {
        if (config != null) {

            stopListening();

            Config2DModel config2DModel = (Config2DModel) config;
            config2DModel.addListener(listenerConfig2D);

            Dimension2DXModel dimension2DXModel = (Dimension2DXModel) config2DModel.getDimensionX();
            dimension2DXModel.addListener(listenerDimension2DX);

            for (IActuator actuator : dimension2DXModel.getActuatorsList()) {
                ((ActuatorModel) actuator).addListener(listenerActuator);
            }
View Full Code Here

TOP

Related Classes of fr.soleil.salsa.entity.event.Config2DModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.