Package ptolemy.kernel.util

Examples of ptolemy.kernel.util.NamedObj


     @return A collection of settables that are also validated as a
     *  side effect, or null if there are none.
     *  @exception IllegalActionException If a error occurs
     */
    public Collection validate() throws IllegalActionException {
        NamedObj container = getContainer();

        if (container != null) {
            container.attributeChanged(this);
        }
        return null;
    }
View Full Code Here


    public JMenuItem create(final JContextMenu menu, NamedObj object) {
        String name = "Configure Arguments";

        // Removed this method since it was never used. EAL
        // final NamedObj target = _getItemTargetFromMenuTarget(object);
        final NamedObj target = object;

        // ensure that we actually have a target, and that it's an Entity.
        if (!(target instanceof GenericJNIActor)) {
            return null;
        }
View Full Code Here

                        // The context for the MoML should be the first
                        // container above this port in the hierarchy
                        // that defers its MoML definition, or the
                        // immediate parent if there is none.
                        NamedObj container = argument.getContainer();
                        String moml = "<deleteProperty name=\""
                                + argument.getName() + "\"/>\n";

                        ChangeRequest request = new MoMLChangeRequest(this,
                                container, moml);
                        container.addChangeListener(this);
                        container.requestChange(request);
                    }
                }
            }
        } else if (buttonPressed().equals("Help")) {
            help(configuration);
View Full Code Here

                        // request to the container, but this caused big
                        // problems... (weird null-pointer expections
                        // deep in diva when making connections).
                        // Is it sufficient to just go to the top level?
                        List changeListeners = new LinkedList();
                        NamedObj container = getContainer();

                        while (container != null) {
                            List list = container.getChangeListeners();

                            if (list != null) {
                                changeListeners.addAll(list);
                            }

                            container = container.getContainer();
                        }

                        change.setListeners(changeListeners);

                        change.execute();
View Full Code Here

    public static synchronized RecordToken executeModel(URL url,
            RecordToken args, String[] resultLabels)
            throws IllegalActionException {
        if (url != null) {
            MoMLParser parser = new MoMLParser();
            NamedObj model;

            try {
                model = parser.parse(null, url);
            } catch (Exception ex) {
                throw new IllegalActionException(ex
View Full Code Here

     @exception NameDuplicationException If the container already has
     *   a port with the name of this port.
     */
    public void setContainer(Entity container) throws IllegalActionException,
            NameDuplicationException {
        NamedObj oldContainer = getContainer();

        if (container == oldContainer) {
            // Nothing to do.
            return;
        }

        boolean disableStatus = _mirrorDisable;

        try {
            _workspace.getWriteAccess();

            if (_mirrorDisable || (getContainer() == null)) {
                // Have already called the super class.
                // This time, process the request.
                super.setContainer(container);
            } else {
                _mirrorDisable = true;

                boolean success = false;

                if (oldContainer != null) {
                    Nameable modal = oldContainer.getContainer();

                    if (modal instanceof MultiCompositeActor) {
                        Port port = ((MultiCompositeActor) modal)
                                .getPort(getName());

View Full Code Here

        }

        MoMLParser parser = ParserAttribute.getParser(this);
        parser.reset();

        NamedObj library = parser.parse(value());

        if (!(library instanceof CompositeEntity)) {
            throw new IllegalActionException(this,
                    "Expected library to be in an instance of CompositeEntity,"
                            + " but it is: " + library.getClass().getName());
        }

        // Ensure that the library is marked as a library.
        Attribute marker = library.getAttribute("_libraryMarker");

        if (marker == null) {
            new SingletonAttribute(library, "_libraryMarker");
        }
View Full Code Here

                    arguments[0] = this;
                    arguments[1] = "p2p_" + clsName.substring(l + 1);

                    try {
                        NamedObj newEntity = _createInstance(cls, arguments);
                        System.out.println("create an instance of " + clsName
                                + ".\n");
                        ((ComponentEntity) newEntity).setContainer(null);

                        String chg = newEntity.exportMoML();
                        System.out.println("the moml description of the "
                                + "new object is: \n" + chg + "\n");

                        ChangeRequest request = new MoMLChangeRequest(this, // originator
                                this, // context
View Full Code Here

            }

            if (match) {
                System.out.println("find a matched constructor.");

                NamedObj obj = (NamedObj) constructor.newInstance(arguments);
                System.out.println("construct a new actor instance.");
                return obj;
            }
        }
View Full Code Here

                return;
            }

            ExecEvent event = (ExecEvent) debugEvent;
            final ExecEvent.ExecEventType state = event.getState();
            NamedObj actor = event.getSource();

            // Get the corresponding graph node and its figure
            Object node = _nodeMap.get(actor);
            LabelWrapper wrapper = (LabelWrapper) _graphPane
                    .getGraphController().getFigure(node);
View Full Code Here

TOP

Related Classes of ptolemy.kernel.util.NamedObj

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.