Package ptolemy.actor.lib.hoc

Examples of ptolemy.actor.lib.hoc.Refinement


        _tabbedPane.addChangeListener(this);
        Iterator cases = ((Case) entity).entityList(Refinement.class)
                .iterator();
        boolean first = true;
        while (cases.hasNext()) {
            Refinement refinement = (Refinement) cases.next();
            JGraph jgraph = _addTabbedPane(refinement, false);
            // The first JGraph is the one with the focus.
            if (first) {
                first = false;
                setJGraph(jgraph);
View Full Code Here


                        // Mirror the ports of the container in the refinement.
                        // Note that this is done here rather than as part of
                        // the MoML because we have set protected variables
                        // in the refinement to prevent it from trying to again
                        // mirror the changes in the container.
                        Refinement entity = (Refinement) _case
                                .getEntity(pattern);

                        // Get the initial port configuration from the container.
                        Iterator ports = _case.portList().iterator();

                        while (ports.hasNext()) {
                            Port port = (Port) ports.next();
                            // No need to mirror the control port, as it's a PortParameter.
                            // Hence, its value is available as a parameter.
                            if (port == _case.control.getPort()) {
                                continue;
                            }

                            try {
                                entity.setMirrorDisable(true);
                                Port newPort = entity.newPort(port.getName());
                                if (newPort instanceof RefinementPort
                                        && port instanceof IOPort) {
                                    try {
                                        ((RefinementPort) newPort)
                                                .setMirrorDisable(true);

                                        if (((IOPort) port).isInput()) {
                                            ((RefinementPort) newPort)
                                                    .setInput(true);
                                        }

                                        if (((IOPort) port).isOutput()) {
                                            ((RefinementPort) newPort)
                                                    .setOutput(true);
                                        }

                                        if (((IOPort) port).isMultiport()) {
                                            ((RefinementPort) newPort)
                                                    .setMultiport(true);
                                        }
                                    } finally {
                                        ((RefinementPort) newPort)
                                                .setMirrorDisable(false);
                                    }
                                }
                            } finally {
                                entity.setMirrorDisable(false);
                            }
                        }
                        _addTabbedPane(entity, true);
                    }
                };
View Full Code Here

TOP

Related Classes of ptolemy.actor.lib.hoc.Refinement

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.