Package ptolemy.kernel.util

Examples of ptolemy.kernel.util.Attribute


     *  token.intValue throws an exception, which may happen if the
     *  weight assigned to the relation is not an integer.
     */
    private int _getWeightNumber(IORelation weights)
            throws IllegalActionException {
        Attribute temporaryAttribute = weights.getAttribute("Weight");

        if (temporaryAttribute == null) {
            return 1;
        } else if (temporaryAttribute instanceof Variable) {
            Variable weightAttribute = (Variable) temporaryAttribute;
View Full Code Here


                if (micaCompositeActor instanceof MicaCompositeActor) {
                    // Get the director of the MicaCompositeActor.
                    Director director = ((MicaCompositeActor) micaCompositeActor)
                            .getDirector();
                    if (director instanceof PtinyOSDirector) {
                        Attribute nodeID = director.getAttribute("nodeID");
                        if (nodeID instanceof PtinyOSNodeParameter) {
                            // Get the token that stores the node ID.
                            try {
                                Token nodeIDToken = ((PtinyOSNodeParameter) nodeID)
                                        .getToken();
View Full Code Here

    public Attribute getAttribute(String name) {
        try {
            _workspace.getReadAccess();

            // Check attributes and ports first.
            Attribute result = super.getAttribute(name);

            if (result == null) {
                // Check entities first.
                String[] subnames = _splitName(name);
View Full Code Here

                        entityClassCount++;
                    } else {
                        // Search the attributes
                        Iterator attributes = attributeList.iterator();
                        while (attributes.hasNext()) {
                            Attribute attribute = (Attribute) attributes.next();
                            if (clazz.isAssignableFrom(attribute.getClass())) {
                                entityClassCount++;
                            }
                        }
                    }
                }
View Full Code Here

                    "Expected library to be in an instance of CompositeEntity,"
                            + " but it is: " + library.getClass().getName());
        }

        // Ensure that the library is marked as a library.
        Attribute marker = library.getAttribute("_libraryMarker");

        if (marker == null) {
            new SingletonAttribute(library, "_libraryMarker");
        }
View Full Code Here

    public void setLibrary(CompositeEntity library) {
        _library = library;
        _librarySet = true;

        if (_library != null) {
            Attribute marker = _library.getAttribute("_libraryMarker");

            if (marker == null) {
                try {
                    new SingletonAttribute(_library, "_libraryMarker");
                } catch (KernelException ex) {
View Full Code Here

        // This port should be oke
        directoryOrURLPort = new Port(this, "directoryOrURL");

        startTrigger = new Port(this, "startTrigger");
        new Attribute(startTrigger, "_showName");

        startTrigger.setContainer(null);
    }
View Full Code Here

     */
    public Attribute getAttribute(String name) {
        try {
            _workspace.getReadAccess();

            Attribute result = super.getAttribute(name);

            if (result == null) {
                // Check ports.
                String[] subnames = _splitName(name);

View Full Code Here

        while (actors.hasNext()) {
            Entity node = (Entity) actors.next();

            // Skip actors that are not properly marked.
            Attribute mark = node.getAttribute("randomize");

            if (!(mark instanceof Variable)) {
                continue;
            }
View Full Code Here

            Entity node, double[] location) throws IllegalActionException {
        // First figure out the name of the class of the _location
        // attribute.  Usually, it is ptolemy.kernel.util.Location,
        // but another possibility is
        // ptolemy.actor.parameters.LocationParameter.
        Attribute locationAttribute = node.getAttribute("_location");
        String className = null;
        if (locationAttribute != null) {
            className = locationAttribute.getClass().getName();
            return "<property name=\"" + node.getName(container)
                    + "._location\" " + "class=\"" + className + "\" value=\"["
                    + location[0] + ", " + location[1] + "]\"/>\n";
        } else {
            // The _location attribute does not exist.
View Full Code Here

TOP

Related Classes of ptolemy.kernel.util.Attribute

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.