Examples of CompositeEntity


Examples of ptolemy.kernel.CompositeEntity

                director.fireAt(this, time);
            } else if (getName().equals(routeTo) || (hops == 0)) {
                // Change the color of the icon to green.
                _circle2.fillColor.setToken("{0.0, 1.0, 0.0, 1.0}");

                CompositeEntity container = (CompositeEntity) getContainer();
                Entity destNode = container.getEntity(destination);
                Locatable destLocation = (Locatable) destNode.getAttribute(
                        "_location", Locatable.class);
                Locatable myLocation = (Locatable) this.getAttribute(
                        "_location", Locatable.class);
View Full Code Here

Examples of ptolemy.kernel.CompositeEntity

     *   evaluated.
     */
    protected List nodesInRange(WirelessIOPort sourcePort)
            throws IllegalActionException {
        List nodesInRangeList = new LinkedList();
        CompositeEntity container = (CompositeEntity) getContainer();
        Iterator ports = ModelTopology.listeningInputPorts(container,
                outputChannelName.stringValue()).iterator();

        while (ports.hasNext()) {
            WirelessIOPort port = (WirelessIOPort) ports.next();
View Full Code Here

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

Examples of ptolemy.kernel.CompositeEntity

            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

Examples of ptolemy.kernel.CompositeEntity

            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

Examples of ptolemy.kernel.CompositeEntity

            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

Examples of ptolemy.kernel.CompositeEntity

     */
    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

Examples of ptolemy.kernel.CompositeEntity

     */
    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

Examples of ptolemy.kernel.CompositeEntity

                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

Examples of ptolemy.kernel.CompositeEntity

        //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
TOP
Copyright © 2018 www.massapi.com. 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.