Package ptolemy.kernel

Examples of ptolemy.kernel.CompositeEntity$ContainedObjectsIterator


        //         prnPanel.setBackground(null);
        //         prnPanel.setLayout(new BorderLayout());
        //         prnPanel.add(new JLabel("SNR (dB)"), BorderLayout.NORTH);
        //         displayPanel.add(prnPanel, BorderLayout.SOUTH);

        CompositeEntity toplevel = (CompositeEntity) _toplevel;
        ImageDisplay consumer = (ImageDisplay) toplevel.getEntity("Compressed");
        compressedPanel.add(new JLabel("Compressed"), BorderLayout.NORTH);
        consumer.place(compressedPanel);
        displayPanel.add(compressedPanel, BorderLayout.EAST);
        consumer.setBackground(null);

        ImageDisplay original = (ImageDisplay) toplevel.getEntity("Original");
        originalPanel.add(new JLabel("Original"), BorderLayout.NORTH);
        original.place(originalPanel);
        displayPanel.add(originalPanel, BorderLayout.WEST);
        original.setBackground(null);

        SequencePlotter plot = (SequencePlotter) toplevel
                .getEntity("Signal To Noise Ratio");

        JPanel plotPanel = new JPanel();
        plot.place(plotPanel);
        plotPanel.setBackground(null);
View Full Code Here


     *  indicates that the user has canceled the action.
     *  @return False if the user cancels the clear.
     */
    protected boolean _clear() {
        if (super._clear()) {
            setModel(new CompositeEntity());
            return true;
        } else {
            return false;
        }
    }
View Full Code Here

     *   using the same channel.
     */
    private List _findSubscribers() throws IllegalActionException {
        LinkedList result = new LinkedList();
        // Find the nearest opaque container above in the hierarchy.
        CompositeEntity container = (CompositeEntity) getContainer();
        while (container != null && !container.isOpaque()) {
            container = (CompositeEntity) container.getContainer();
        }
        if (container != null) {
            Iterator actors = container.deepEntityList().iterator();
            while (actors.hasNext()) {
                Object actor = actors.next();
                if (actor instanceof Subscriber) {
                    if (((Subscriber) actor).channelMatches(_channel)) {
                        result.add(actor);
View Full Code Here

     @return A unique channel name.
     */
    private String _uniqueChannelName() {
        int suffix = 1;
        // Find the nearest opaque container above in the hierarchy.
        CompositeEntity container = (CompositeEntity) getContainer();
        while (container != null && !container.isOpaque()) {
            container = (CompositeEntity) container.getContainer();
        }
        if (container != null) {
            Iterator actors = container.deepEntityList().iterator();
            while (actors.hasNext()) {
                Object actor = actors.next();
                if (actor instanceof Publisher && actor != this) {
                    String nameInUse = ((Publisher) actor)._channel;
                    if (nameInUse != null && nameInUse.startsWith("channel")) {
View Full Code Here

     @return A list of publishers.
     */
    private List _findPublishers() {
        List result = new LinkedList();
        // Find the nearest opaque container above in the hierarchy.
        CompositeEntity container = (CompositeEntity) getContainer();
        while (container != null && !container.isOpaque()) {
            container = (CompositeEntity) container.getContainer();
        }
        if (container != null) {
            Iterator actors = container.deepEntityList().iterator();
            while (actors.hasNext()) {
                Object actor = actors.next();
                if (actor instanceof Publisher) {
                    if (channelMatches(((Publisher) actor)._channel)) {
                        result.add(actor);
View Full Code Here

        super.invalidateSchedule();

        // Kill the firing counts, which may be invalid.  If we don't
        // kill them, then the manager might complain that they cannot
        // be evaluated.
        CompositeEntity container = (CompositeEntity) getContainer();

        if (container != null) {
            for (Iterator entities = container.deepEntityList().iterator(); entities
                    .hasNext();) {
                Entity actor = (Entity) entities.next();
                Variable parameter = (Variable) actor
                        .getAttribute("firingCount");
View Full Code Here

        super.initialize();

        _isOff = Boolean.TRUE;

        // Get the channel specified by the channelName parameter.
        CompositeEntity container = (CompositeEntity) getContainer();
        Entity channel = container.getEntity(channelName.stringValue());

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

        super.preinitialize();

        // Check that no relation has multiple sources of data connected to it.
        // FIXME: This only detects the error at this level of the hierarchy.
        // Probably need to recursively descend into composite actors.
        CompositeEntity container = (CompositeEntity) getContainer();
        Iterator relations = container.relationList().iterator();

        while (relations.hasNext()) {
            IORelation relation = (IORelation) relations.next();

            if (relation.linkedSourcePortList().size() > 1) {
View Full Code Here

                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

     *   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

TOP

Related Classes of ptolemy.kernel.CompositeEntity$ContainedObjectsIterator

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.