Package ptolemy.kernel.util

Examples of ptolemy.kernel.util.NamedObj


            Object[] selection = _selectionModel.getSelectionAsArray();

            for (int i = 0; i < selection.length; i++) {
                if (selection[i] instanceof Figure) {
                    Object userObject = ((Figure) selection[i]).getUserObject();
                    NamedObj actual = (NamedObj) _graphModel
                            .getSemanticObject(userObject);

                    if (actual instanceof ComponentEntity) {
                        nodes.add(actual);
                    }
View Full Code Here


            Object[] selection = _selectionModel.getSelectionAsArray();

            for (int i = 0; i < selection.length; i++) {
                if (selection[i] instanceof Figure) {
                    Object userObject = ((Figure) selection[i]).getUserObject();
                    NamedObj actual = (NamedObj) _graphModel
                            .getSemanticObject(userObject);

                    if ((actual instanceof Relation)
                            && (!relations.contains(actual))) {
                        relations.add(actual);
View Full Code Here

        Iterator nodes = _graphModel.nodes(_model);

        while (nodes.hasNext()) {
            Location node = (Location) nodes.next();
            NamedObj entity = (NamedObj) _graphModel.getSemanticObject(node);

            if (_entities.contains(entity)) {
                Figure figure = _controller.getFigure(node);
                _selectionModel.addSelection(figure);
View Full Code Here

            actualPort = (Port) (actualPorts.next());

            // 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 = actualPort.getContainer();
            NamedObj composite = container.getContainer();

            if (composite != null) {
                moml.append("<deletePort name=\"" + actualPort.getName()
                        + "\" entity=\"" + container.getName() + "\" />");
            } else {
View Full Code Here

    public static NamedList getScope(NamedObj object) {
        try {
            object.workspace().getReadAccess();

            NamedList scope = new NamedList();
            NamedObj container = object.getContainer();

            while (container != null) {
                Iterator level1 = container.attributeList().iterator();
                Attribute var = null;

                while (level1.hasNext()) {
                    // add the variables in the same NamedObj to scope,
                    // excluding this
                    var = (Attribute) level1.next();

                    if ((var instanceof Variable) && (var != object)) {
                        if (var.workspace() != object.workspace()) {
                            continue;
                        }

                        try {
                            scope.append(var);
                        } catch (NameDuplicationException ex) {
                            // This occurs when a variable is shadowed by one
                            // that has been previously entered in the scope.
                        } catch (IllegalActionException ex) {
                            // This should not happen since we are dealing with
                            // variables which are Nameable.
                        }
                    }
                }

                level1 = container.attributeList(ScopeExtender.class)
                        .iterator();

                while (level1.hasNext()) {
                    ScopeExtender extender = (ScopeExtender) level1.next();
                    Iterator level2 = extender.attributeList().iterator();

                    while (level2.hasNext()) {
                        // add the variables in the scope extender to scope,
                        // excluding this
                        var = (Attribute) level2.next();

                        if ((var instanceof Variable) && (var != object)) {
                            if (var.workspace() != object.workspace()) {
                                continue;
                            }

                            try {
                                scope.append(var);
                            } catch (NameDuplicationException ex) {
                                // This occurs when a variable is shadowed by
                                // one that has been previously entered in the
                                // scope.
                            } catch (IllegalActionException ex) {
                                // This should not happen since we are dealing
                                // with variables which are Nameable.
                            }
                        }
                    }
                }

                container = container.getContainer();
            }

            return scope;
        } finally {
            object.workspace().doneReading();
View Full Code Here

        // method for each parameter, once when it is being constructed
        // and once when it's value is being set.
        // EAL 9/16/03
        // if (!_isLazy && !neededEvaluation) {
        if (!_isLazy) {
            NamedObj container = getContainer();

            if (container != null) {
                container.attributeChanged(this);
            }
        }

        // The propagate call has evaluated all the value
        // listeners that are instances of Variable,
View Full Code Here

        Token oldInitialToken = _initialToken;

        try {
            _setToken(newToken);

            NamedObj container = getContainer();

            if (container != null) {
                if (!oldVarType.equals(_varType)
                        && (oldVarType != BaseType.UNKNOWN)) {
                    container.attributeTypeChanged(this);
                }

                container.attributeChanged(this);
            }

            _notifyValueListeners();
        } catch (IllegalActionException ex) {
            // reverse the changes
View Full Code Here

                    variable.invalidate();
                }
            }
        }

        NamedObj container = object.getContainer();

        if (container != null) {
            _invalidateShadowedSettables(container);
        }
    }
View Full Code Here

         @exception IllegalActionException If a value in the scope
         *  exists with the given name, but cannot be evaluated.
         */
        public ptolemy.data.type.Type getType(String name)
                throws IllegalActionException {
            NamedObj reference = _reference;

            if (_reference == null) {
                reference = Variable.this.getContainer();
            }

View Full Code Here

         @exception IllegalActionException If a value in the scope
         *  exists with the given name, but cannot be evaluated.
         */
        public ptolemy.graph.InequalityTerm getTypeTerm(String name)
                throws IllegalActionException {
            NamedObj reference = _reference;

            if (_reference == null) {
                reference = Variable.this.getContainer();
            }

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.