Package ptolemy.kernel.util

Examples of ptolemy.kernel.util.ChangeRequest


                                + "\"" + entity.getName() + "\".");
            }

            entity.exportMoML(buffer, 1);

            ChangeRequest request = new MoMLChangeRequest(entity, library,
                    buffer.toString());
            library.requestChange(request);
        } catch (IOException ex) {
            // Ignore.
        } catch (KernelException ex) {
View Full Code Here


     */
    private static void _instantiateLibrary(final CompositeEntity library,
            final ModelDirectory directory, Configuration configuration,
            File file, final CompositeEntity libraryContainer,
            final PtolemyEffigy finalLibraryEffigy) throws Exception {
        ChangeRequest request = new ChangeRequest(configuration, file.toURI()
                .toURL().toString()) {
            protected void _execute() throws Exception {
                // The library is a class!
                library.setClassDefinition(true);
                library.instantiate(libraryContainer, library.getName());
                finalLibraryEffigy.setContainer(directory);
            }
        };

        libraryContainer.requestChange(request);
        request.waitForCompletion();
    }
View Full Code Here

                    + target.getFullName()
                    + " because the position is set by the class.");
            return;
        }

        ChangeRequest request = new ChangeRequest(target, "Move towards last") {
            protected void _execute() throws IllegalActionException {
                // Static method takes a list, so we construct a
                // list with one element.
                LinkedList targets = new LinkedList();
                targets.add(target);
View Full Code Here

                // If the director does not already have a
                // DebugController, create one.
                String moml = "<property name=\""
                        + _DEBUGCONTROLLER
                        + "\" class=\"ptolemy.vergil.debugger.DebugController\"/>";
                ChangeRequest request = new MoMLChangeRequest(this, // originator
                        director, // context
                        moml);
                request.addChangeListener(this);
                director.requestChange(request);
            }
        } else {
            // If BreakpointConfigurerDialog()._handlClosing()
            // calls this in appropriately, then debugController might be
View Full Code Here

        super.actionPerformed(e);

        final NamedObj object = getTarget();

        // Do this as a change request since it may add a new icon.
        ChangeRequest request = new ChangeRequest(this, "Edit Custom Icon") {
            protected void _execute() throws Exception {
                EditorIcon icon = null;
                List iconList = object.attributeList(EditorIcon.class);

                if (iconList.size() > 0) {
View Full Code Here

                        ingredientList = ((GTIngredientsAttribute) attributes
                                .get(0)).getIngredientList();
                    }
                }
                for (GTIngredient ingredient : ingredientList) {
                    ChangeRequest request;
                    try {
                        request = ((Operation) ingredient).getChangeRequest(
                                _pattern, _replacement, _matchResult,
                                patternEntity, replacementEntity, hostEntity);
                        if (request != null) {
                            request.execute();
                        }
                    } catch (IllegalActionException e) {
                        throw new TransformationException(
                                "Unable to obtain change request.", e);
                    }
View Full Code Here

                        + "\" class=\"ptolemy.kernel.util.Location\""
                        + " value=\"[" + x + ", " + y + "]\"/>\n"
                        + "</entity>\n";
            }

            ChangeRequest request = new MoMLChangeRequest(this, toplevel, moml);
            toplevel.requestChange(request);

            try {
                request.waitForCompletion();
            } catch (Exception ex) {
                throw new GraphException(ex);
            }
        }
View Full Code Here

                    port.setMultiport(isMultiport);
                } else if (ingredient instanceof SubclassCriterion
                        && !isIconSet) {
                    SubclassCriterion criterion = (SubclassCriterion) ingredient;
                    final String superclass = criterion.getSuperclass();
                    ((NamedObj) entity).requestChange(new ChangeRequest(entity,
                            "Deferred load actor icon action.") {
                        protected void _execute() throws Exception {
                            _loadActorIcon(entity, superclass);
                        }
                    });
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.