Package ptolemy.kernel.util

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


                // 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

            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

            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

     *  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

    /** Insert a new clock.
     */
    public void insertClock() {
        // Create an anonymous inner class
        ChangeRequest change = new ChangeRequest(this, "test2") {
            protected void _execute() throws Exception {
                _clock.output.unlinkAll();
                _rec.input.unlinkAll();

                Clock clock2 = new Clock(_top, "clock2");
View Full Code Here

                    // result in creation of yet another figure before this
                    // method even returns!
                    GraphController controller = IconController.this
                            .getController();
                    GraphModel graphModel = controller.getGraphModel();
                    ChangeRequest request = new ChangeRequest(graphModel,
                            "Set the container of a new XMLIcon.") {
                        // NOTE: The KernelException should not be thrown,
                        // but if it is, it will be handled properly.
                        protected void _execute() throws KernelException {
                            _iconsPendingContainer.remove(object);

                            // If the icon already has a container, do nothing.
                            if (icon.getContainer() != null) {
                                return;
                            }

                            // If the container already has an icon, do nothing.
                            if (object.getAttribute("_icon") != null) {
                                return;
                            }

                            icon.setContainer(object);
                        }
                    };

                    request.setPersistent(false);
                    object.requestChange(request);
                } else if (iconList.size() >= 1) {
                    // Use only the last icon in the list.
                    EditorIcon icon = (EditorIcon) iconList
                            .get(iconList.size() - 1);
View Full Code Here

     @exception IllegalActionException If the change is not acceptable
     *   to the container.
     */
    public void setExpression(String expression) throws IllegalActionException {
        if (expression.equals("")) {
            ChangeRequest request = new ChangeRequest(this,
                    "Delete empty doc tag.") {
                protected void _execute() throws Exception {
                    setContainer(null);
                }
            };
View Full Code Here

    public void managerStateChanged(Manager manager) {
        Manager.State newState = manager.getState();

        if (newState != _previousState) {
            // Clear any error reporting highlights that may be present.
            ChangeRequest request = new ChangeRequest(this,
                    "Error Highlight Clearer") {
                protected void _execute() throws Exception {
                    for (Attribute highlight : _errorHighlights) {
                        highlight.setContainer(null);
                    }
                }
            };

            // Mark the Error Highlight Clearer request as
            // non-persistant so that we don't mark the model as being
            // modified.  ptolemy/actor/lib/jni/test/Scale/Scale.xml
            // required this change.
            request.setPersistent(false);
            manager.requestChange(request);

            getFrame().report(manager.getState().getDescription());
            _previousState = newState;
View Full Code Here

     *  indicate that it is the source of an error.
     *  @param culprit The culprit.
     */
    private void _highlightError(final Nameable culprit) {
        if (culprit instanceof NamedObj) {
            ChangeRequest request = new ChangeRequest(this, "Error Highlighter") {
                protected void _execute() throws Exception {
                    _addErrorHighlightIfNeeded(culprit);
                    NamedObj container = culprit.getContainer();
                    while (container != null) {
                        _addErrorHighlightIfNeeded(container);
View Full Code Here

TOP

Related Classes of ptolemy.kernel.util.ChangeRequest

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.