Examples of ChangeRequest


Examples of ptolemy.kernel.util.ChangeRequest

    protected void _saveFiringCounts(final Map entityToFiringsPerIteration) {
        Director director = (Director) getContainer();
        final CompositeActor container = (CompositeActor) director
                .getContainer();

        ChangeRequest request = new ChangeRequest(this,
                "Record firings per iteration") {
            protected void _execute() throws KernelException {
                Iterator entities = entityToFiringsPerIteration.keySet()
                        .iterator();

                while (entities.hasNext()) {
                    Entity entity = (Entity) entities.next();
                    int firingCount = ((Integer) entityToFiringsPerIteration
                            .get(entity)).intValue();
                    DFUtilities.setOrCreate(entity, "firingsPerIteration",
                            firingCount);

                    if (_debugging) {
                        _debug("Adding firingsPerIteration parameter to "
                                + entity.getName() + " with value "
                                + firingCount);
                    }
                }
            }
        };

        // Indicate that the change is non-persistent, so that
        // the UI doesn't prompt to save.
        request.setPersistent(false);
        container.requestChange(request);
    }
View Full Code Here

Examples of ptolemy.kernel.util.ChangeRequest

                // requests.
                if (_changeRequests != null) {
                    Iterator requests = _changeRequests.iterator();

                    while (requests.hasNext()) {
                        ChangeRequest request = (ChangeRequest) requests.next();
                        entity.requestChange(request);
                    }

                    _changeRequests = null;
                }
View Full Code Here

Examples of ptolemy.kernel.util.ChangeRequest

                // requests.
                if (_changeRequests != null) {
                    Iterator requests = _changeRequests.iterator();

                    while (requests.hasNext()) {
                        ChangeRequest request = (ChangeRequest) requests.next();
                        container.requestChange(request);
                    }

                    _changeRequests = null;
                }
View Full Code Here

Examples of ptolemy.kernel.util.ChangeRequest

     @exception IllegalActionException If the superclass throws it.
     */
    public void fire() throws IllegalActionException {
        super.fire();

        ChangeRequest doRandomize = new ChangeRequest(this, "randomize nodes") {
            protected void _execute() throws IllegalActionException {
                _randomize();
            }
        };

View Full Code Here

Examples of ptolemy.kernel.util.ChangeRequest

        _top.connect(_clock.output, _rec.input);
    }

    public void insertClock() {
        // Create an anonymous inner class
        ChangeRequest change = new ChangeRequest(_top, "test2") {
            public void _execute() throws IllegalActionException,
                    NameDuplicationException {
                _clock.output.unlinkAll();
                _rec.input.unlinkAll();
View Full Code Here

Examples of ptolemy.kernel.util.ChangeRequest

        director.fireAt(this, director.getModelTime().add(firingPeriodValue));

        if (output.getWidth() > 0) {
            output.send(0, new IntToken(_count++));
        } else {
            ChangeRequest request = new ChangeRequest(this,
                    "Find a destination") {
                protected void _execute() throws IllegalActionException {
                    CompositeEntity container = (CompositeEntity) getContainer();
                    List entityList = container.entityList();
                    Iterator entities = entityList.iterator();
View Full Code Here

Examples of ptolemy.kernel.util.ChangeRequest

                // or this is getting invoked in the constructor, and the
                // attribute being referenced has not yet been constructed.
                // To support the latter situation, we try again (just one
                // more time) in a ChangeRequest.
                if (!_deferred) {
                    ChangeRequest request = new ChangeRequest(this,
                            "AttributeValueAttribute") {
                        protected void _execute() {
                            _setAttributeName(attributeName);
                            _deferred = false;
                        }
View Full Code Here

Examples of ptolemy.kernel.util.ChangeRequest

            if (_checkForImplied(elements)) {
                return;
            }

            // Issue a change request, since this requires write access.
            ChangeRequest request = new ChangeRequest(container, "Send to back") {
                protected void _execute() throws IllegalActionException {
                    MoveAction.move(elements, MoveAction.TO_FIRST, container);
                }
            };
View Full Code Here

Examples of ptolemy.kernel.util.ChangeRequest

            if (_checkForImplied(elements)) {
                return;
            }

            // Issue a change request, since this requires write access.
            ChangeRequest request = new ChangeRequest(container,
                    "Bring to front") {
                protected void _execute() throws IllegalActionException {
                    MoveAction.move(elements, MoveAction.TO_LAST, container);
                }
            };
View Full Code Here

Examples of ptolemy.kernel.util.ChangeRequest

     *  after the next event is processed, because the next firing
     *  has already been queued.
     */
    public void doublePeriod() {
        // Create an anonymous inner class
        ChangeRequest change = new ChangeRequest(this, "test") {
            protected void _execute() throws Exception {
                _clock.period.setExpression("2.0");
                _clock.period.validate();
            }
        };
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.