Package fr.soleil.salsa.entity

Examples of fr.soleil.salsa.entity.Behaviour


    /* (non-Javadoc)
     * @see fr.soleil.salsa.entity.IPostScanBehaviour#setBehaviour(fr.soleil.salsa.entity.impl.Behaviour)
     */
    @Override
    public void setBehaviour(Behaviour behaviour) {
        Behaviour oldValue = baseBean.getBehaviour();
        baseBean.setBehaviour(behaviour);
        this.firePropertyChange("behaviour", oldValue, behaviour);

    }
View Full Code Here


    }

    @Override
    public void notifyPostScanBehaviour(String code) {
        if (config != null) {
            Behaviour b = Behaviour.valueOf(Behaviour.class, code);
            if (config.getScanAddOn().getPostScanBehaviour() == null) {
                config.getScanAddOn().setPostScanBehaviour(new PostScanBehaviourModel());
            }
            config.getScanAddOn().getPostScanBehaviour().setBehaviour(b);
        }
View Full Code Here

                view.setZigzag(config.isZigzag());
                view.setOnTheFly(config.isOnTheFly());
                view.setEnableActuatorSpeed(config.isEnableScanSpeed());

                // Behaviour
                Behaviour selectedBehaviour = postScanBehaviour.getBehaviour();
                int selectedIndex = 0;

                view.clearPostScanBehaviour();
                Behaviour[] behaviours = Behaviour.values();
                for (int i = 0; i < behaviours.length; i++) {
                    Behaviour b = behaviours[i];
                    view.addPostScanBehaviour(b.name(), b.getShortDescription());
                    if (selectedBehaviour == b) {
                        selectedIndex = i;
                        view.setDescription(b.getLongDescription());
                    }
                }
                view.setPostScanSelected(selectedIndex);

                // We enable or not the sensor and actuator combo box.
View Full Code Here

                actionName = "write_attribute(\"enableScanSpeed\"," + enableScanSpeed + ")";
                setAttribute("enableScanSpeed", enableScanSpeed);

                // Post scan behaviour.
                IPostScanBehaviour postScanBehaviour = config.getScanAddOn().getPostScanBehaviour();
                Behaviour behaviour = postScanBehaviour.getBehaviour();
                if (behaviour == null) {
                    behaviour = Behaviour.NOOP;
                }
                int behaviourType = behaviour.getType();

                actionName = "write_attribute(\"afterRunActionType\"," + behaviourType + ")";
                setAttribute("afterRunActionType", behaviourType);

                if (behaviour.getArgumentCount() >= 1) {
                    int behaviourSensorIndex = postScanBehaviour.getSensor();
                    actionName = "write_attribute(\"afterRunActionSensor\"," + behaviourSensorIndex
                            + ")";
                    setAttribute("afterRunActionSensor", behaviourSensorIndex);
                }
                else if (behaviour.getArgumentCount() >= 2) {
                    int behaviourActuatorIndex = postScanBehaviour.getActuator();
                    actionName = "write_attribute(\"afterRunActionActuator\","
                            + behaviourActuatorIndex + ")";
                    setAttribute("afterRunActionActuator", behaviourActuatorIndex);
                }
View Full Code Here

        // }
    }

    @Override
    public void notifyPostScanBehaviour(String code) {
        Behaviour b = Behaviour.valueOf(Behaviour.class, code);
        if (config.getScanAddOn().getPostScanBehaviour() == null) {
            config.getScanAddOn().setPostScanBehaviour(new PostScanBehaviourModel());
        }
        config.getScanAddOn().getPostScanBehaviour().setBehaviour(b);
    }
View Full Code Here

                view.setZigzag(config.isZigzag());
                view.setOnTheFly(config.isOnTheFly());
                view.setEnableActuatorSpeed(config.isEnableScanSpeed());

                // Behaviour
                Behaviour selectedBehaviour = postScanBehaviour.getBehaviour();
                int selectedIndex = 0;

                view.clearPostScanBehaviour();
                Behaviour[] behaviours = Behaviour.values();
                for (int i = 0; i < behaviours.length; i++) {
                    Behaviour b = behaviours[i];
                    view.addPostScanBehaviour(b.name(), b.getShortDescription());
                    if (selectedBehaviour == b) {
                        selectedIndex = i;
                        view.setDescription(b.getLongDescription());
                    }
                }
                view.setPostScanSelected(selectedIndex);

                // We enable or not the sensor and actuator combo box.
View Full Code Here

    /**
     * The post scan behaviour has been changed.
     * @param code
     */
    public void notifyPostScanBehaviour(String code) {
        Behaviour b = Behaviour.valueOf(Behaviour.class, code);
        if (config.getScanAddOn().getPostScanBehaviour() == null) {
            config.getScanAddOn().setPostScanBehaviour(
                    new PostScanBehaviourModel());
        }
        config.getScanAddOn().getPostScanBehaviour().setBehaviour(b);
View Full Code Here

            view.setZigzag(config.isZigzag());
            view.setOnTheFly(config.isOnTheFly());
            view.setEnableActuatorSpeed(config.isEnableScanSpeed());
   
            // Behaviour
            Behaviour selectedBehaviour = postScanBehaviour.getBehaviour();
            int selectedIndex = 0;
   
            view.clearPostScanBehaviour();
            Behaviour[] behaviours = Behaviour.values();
            for (int i = 0; i < behaviours.length; i++) {
                Behaviour b = behaviours[i];
                view.addPostScanBehaviour(b.name(), b.getShortDescription());
                if (selectedBehaviour == b) {
                    selectedIndex = i;
                    view.setDescription(b.getLongDescription());
                }
            }
            view.setPostScanSelected(selectedIndex);
           
            // We enable or not the sensor and actuator combo box.
View Full Code Here

    }

    @Override
    public void notifyPostScanBehaviour(String code) {
        if (config != null) {
            Behaviour b = Behaviour.valueOf(Behaviour.class, code);
            if (getPostScanBehaviour(config) != null) {
                getPostScanBehaviour(config).setBehaviour(b);
                if (view != null) {
                    int nbArgs = b.getArgumentCount();
                    // System.out.println("nbArgs=" + nbArgs);
                    view.setSensorsComboEnabled(nbArgs > 0);
                    view.setActuatorsComboEnabled(nbArgs == 2);
                }
                config.setModified(true);
View Full Code Here

                    view.setDataRecorderConfig(currentConfig.getDataRecorderConfig());

                    // Behaviour
                    IPostScanBehaviour postScanBehaviour = getPostScanBehaviour(currentConfig);
                    if (postScanBehaviour != null && postScanBehaviour.getBehaviour() != null) {
                        Behaviour selectedBehaviour = postScanBehaviour.getBehaviour();
                        int selectedIndex = 0;
                        view.clearPostScanBehaviour();
                        Behaviour[] behaviours = Behaviour.values();
                        for (int i = 0; i < behaviours.length; i++) {
                            Behaviour b = behaviours[i];
                            view.addPostScanBehaviour(b.name(), b.getShortDescription());
                            if (selectedBehaviour == b) {
                                selectedIndex = i;
                                view.setDescription(b.getLongDescription());
                            }
                        }
                        view.setPostScanSelected(selectedIndex);

                        // We enable or not the sensor and actuator combo box.
View Full Code Here

TOP

Related Classes of fr.soleil.salsa.entity.Behaviour

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.