Package ptolemy.kernel

Examples of ptolemy.kernel.CompositeEntity


            if (workspace().getVersion() == _listeningInputPortsVersion) {
                return _listeningInputPorts;
            }

            List result = new LinkedList();
            CompositeEntity container = (CompositeEntity) getContainer();
            Iterator entities = container.entityList().iterator();

            while (entities.hasNext()) {
                Entity entity = (Entity) entities.next();
                Iterator ports = entity.portList().iterator();
View Full Code Here


            if (workspace().getVersion() == _listeningOutputPortsVersion) {
                return _listeningOutputPorts;
            }

            List result = new LinkedList();
            CompositeEntity container = (CompositeEntity) getContainer();
            Iterator ports = container.portList().iterator();

            while (ports.hasNext()) {
                Port port = (Port) ports.next();

                if (port instanceof WirelessIOPort) {
View Full Code Here

            if (workspace().getVersion() == _sendingInputPortsVersion) {
                return _sendingInputPorts;
            }

            List result = new LinkedList();
            CompositeEntity container = (CompositeEntity) getContainer();
            Iterator ports = container.portList().iterator();

            while (ports.hasNext()) {
                Port port = (Port) ports.next();

                if (port instanceof WirelessIOPort) {
View Full Code Here

            if (workspace().getVersion() == _sendingOutputPortsVersion) {
                return _sendingOutputPorts;
            }

            List result = new LinkedList();
            CompositeEntity container = (CompositeEntity) getContainer();
            Iterator entities = container.entityList().iterator();

            while (entities.hasNext()) {
                Entity entity = (Entity) entities.next();
                Iterator ports = entity.portList().iterator();
View Full Code Here

     */
    private List _statefulComponents() {
        if (_workspace.getVersion() != _statefulComponentsVersion) {
            // Construct the list.
            _statefulComponents.clear();
            CompositeEntity container = (CompositeEntity) getContainer();
            Iterator actors = container.deepEntityList().iterator();
            while (actors.hasNext()) {
                Object actor = actors.next();
                if (actor instanceof ContinuousStatefulComponent) {
                    _statefulComponents.add(actor);
                } else if ((actor instanceof CompositeActor)
View Full Code Here

     */
    private List _stepSizeControllers() {
        if (_workspace.getVersion() != _stepSizeControllersVersion) {
            // Construct the list.
            _stepSizeControllers.clear();
            CompositeEntity container = (CompositeEntity) getContainer();
            Iterator actors = container.deepEntityList().iterator();
            while (actors.hasNext()) {
                Object actor = actors.next();
                if (actor instanceof ContinuousStepSizeController) {
                    _stepSizeControllers.add(actor);
                } else if ((actor instanceof CompositeActor)
View Full Code Here

                foundOne = true;

                Entity container = (Entity) (port.getContainer());
                String channelName = ((WirelessIOPort) port).outsideChannel
                        .stringValue();
                CompositeEntity container2 = (CompositeEntity) container
                        .getContainer();

                if (container2 == null) {
                    throw new IllegalActionException(this,
                            "The port's container does not have a container.");
                }

                Entity channel = container2.getEntity(channelName);

                if (channel instanceof WirelessChannel) {
                    // Cache it here, so no need to do it again in wrapup().
                    _outputWirelessChannel = (WirelessChannel) channel;
                    _wirelessOutputPort = (WirelessIOPort) port;
                    ((WirelessChannel) channel).registerPropertyTransformer(
                            this, (WirelessIOPort) port);
                } else {
                    throw new IllegalActionException(this,
                            "The connected output port does not refer to a "
                                    + "valid channel.");
                }
            }
        }

        //register this property transformer for the connected wireless
        //input port. It assumes there is only one.
        Iterator connectedInputPorts = input.sourcePortList().iterator();

        while (connectedInputPorts.hasNext()) {
            //register this property transformer for the connected wireless
            //output port. It assumes there is only one.
            IOPort port = (IOPort) connectedInputPorts.next();

            if (port.isInput() && port instanceof WirelessIOPort) {
                // Found the port.
                foundOne = true;

                Entity container = (Entity) (port.getContainer());
                String channelName = ((WirelessIOPort) port).outsideChannel
                        .stringValue();
                CompositeEntity container2 = (CompositeEntity) container
                        .getContainer();

                if (container2 == null) {
                    throw new IllegalActionException(this,
                            "The port's container does not have a container.");
                }

                Entity channel = container2.getEntity(channelName);

                if (channel instanceof WirelessChannel) {
                    // Cache it here, so no need to do it again in wrapup().
                    _inputWirelessChannel = (WirelessChannel) channel;
                    _wirelessInputPort = (WirelessIOPort) port;
View Full Code Here

        //refers to the center of the polygon. We adjust the
        //offset here.
        _offset[0] = location.getLocation()[0] + center[0];
        _offset[1] = location.getLocation()[1] + center[1];

        CompositeEntity container = (CompositeEntity) getContainer();
        _channelName = channelName.stringValue();

        Entity channel = container.getEntity(_channelName);

        if (channel instanceof WirelessChannel) {
            _channel = (WirelessChannel) channel;
            ((WirelessChannel) channel).registerPropertyTransformer(this, null);
        } else {
View Full Code Here

     */
    public void preinitialize() throws IllegalActionException {
        super.preinitialize();

        // Find the channel.
        CompositeEntity container = (CompositeEntity) getContainer();

        if (container != null) {
            Entity channel = container
                    .getEntity(inputChannelName.stringValue());

            if (channel instanceof AtomicWirelessChannel) {
                Parameter channelProperties = ((AtomicWirelessChannel) channel).defaultProperties;

View Full Code Here

    public ExampleSystem() throws IllegalActionException,
            NameDuplicationException {
        super();

        // Create composite entities
        e0 = new CompositeEntity();
        e0.setName("E0");
        e3 = new CompositeEntity(e0, "E3");
        e4 = new CompositeEntity(e3, "E4");
        e7 = new CompositeEntity(e0, "E7");
        e10 = new CompositeEntity(e0, "E10");

        // Create component entities
        e1 = new ComponentEntity(e4, "E1");
        e2 = new ComponentEntity(e4, "E2");
        e5 = new ComponentEntity(e3, "E5");
View Full Code Here

TOP

Related Classes of ptolemy.kernel.CompositeEntity

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.