Package ptolemy.kernel

Examples of ptolemy.kernel.ComponentRelation


                    // real need to subclass this to remove it.
                    Iterator relations = ((CompositeEntity) composite)
                            .relationList().iterator();

                    while (relations.hasNext()) {
                        ComponentRelation relation = (ComponentRelation) relations
                                .next();
                        List vertexList = relation.attributeList(Vertex.class);

                        if (vertexList.size() != 0) {
                            // Add in all the vertexes.
                            Iterator vertexes = vertexList.iterator();

                            while (vertexes.hasNext()) {
                                Vertex v = (Vertex) vertexes.next();
                                nodes.add(v);
                            }
                        } else {
                            // See if we need to create a vertex.
                            // Count the linked ports.
                            int count = relation.linkedPortList().size();

                            if (count != 2) {
                                // A vertex is needed, so create one.
                                try {
                                    String name = relation.uniqueName("vertex");
                                    Vertex vertex = new Vertex(relation, name);
                                    nodes.add(vertex);

                                    // Have to manually handle propagation, since
                                    // the MoML parser is not involved.
View Full Code Here


     @param connector The connector.
     *  @return The order index of the connection.
     */
    public int getOrderIndex(LinkManhattanConnector connector) {
        Link link = connector.getLink();
        ComponentRelation relation = link.getRelation();
        List relations;

        if (_inside) {
            relations = _port.insideRelationList();
        } else {
View Full Code Here

            int index = -1;

            while (relations.hasNext()) {
                index++;

                ComponentRelation relation = (ComponentRelation) relations
                        .next();

                if (relation == null) {
                    // Gap in the links.  The next link has to use an
                    // explicit index.
View Full Code Here

                int index = -1;

                while (relations.hasNext()) {
                    index++;

                    ComponentRelation relation = (ComponentRelation) relations
                            .next();

                    if (relation == null) {
                        // Gap in the links.  The next link has to use an
                        // explicit index.
View Full Code Here

                protected void _execute() throws Exception {
                    super._execute();
                    link.setHead(newArcHead);

                    if (relationNameToAdd != null) {
                        ComponentRelation relation = ((CompositeEntity) getPtolemyModel())
                                .getRelation(relationNameToAdd);
                        link.setRelation(relation);
                    }
                }
            };
View Full Code Here

            // remove incoming transitions
            ComponentPort inPort = state.incomingPort;
            Iterator transitions = inPort.linkedRelationList().iterator();

            while (transitions.hasNext()) {
                ComponentRelation transition = (ComponentRelation) transitions
                        .next();
                transition.setContainer(null);
            }

            // remove outgoing transitions
            ComponentPort outPort = state.outgoingPort;
            transitions = outPort.linkedRelationList().iterator();

            while (transitions.hasNext()) {
                ComponentRelation transition = (ComponentRelation) transitions
                        .next();
                transition.setContainer(null);
            }

            // remove the state
            state.setContainer(null);
        } catch (IllegalActionException exception) {
View Full Code Here

TOP

Related Classes of ptolemy.kernel.ComponentRelation

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.