Package ptolemy.vergil.basic

Examples of ptolemy.vergil.basic.DocAttribute


        _className = target.getClassName();
        try {
            List docAttributes = _target.attributeList(DocAttribute.class);
            // Get the last doc attribute.
            if (docAttributes.size() > 0) {
                DocAttribute instanceDoc = (DocAttribute) docAttributes
                        .get(docAttributes.size() - 1);
                // Populate fields from the attribute.
                String descriptionValue = instanceDoc.description.stringValue();
                if (descriptionValue != null
                        && !descriptionValue.trim().equals("")) {
                    _isInstanceDoc = true;
                    _description = descriptionValue;
                }
                /* No rating fields in instance documentation.
                 String acceptedRatingValue = instanceDoc.acceptedRating.getExpression();
                 if (!acceptedRatingValue.trim().equals("")) {
                 _isInstanceDoc = true;
                 _ptAcceptedRating = acceptedRatingValue;
                 }
                 */
                String authorValue = instanceDoc.author.getExpression();
                if (authorValue != null && !authorValue.trim().equals("")) {
                    _isInstanceDoc = true;
                    _author = authorValue;
                }
                /* No rating fields in instance documentation.
                 String proposedRatingValue = instanceDoc.proposedRating.getExpression();
                 if (!proposedRatingValue.trim().equals("")) {
                 _isInstanceDoc = true;
                 _ptProposedRating = proposedRatingValue;
                 }
                 */
                String sinceValue = instanceDoc.since.getExpression();
                if (sinceValue != null && !sinceValue.trim().equals("")) {
                    _isInstanceDoc = true;
                    _since = sinceValue;
                }
                String versionValue = instanceDoc.version.getExpression();
                if (versionValue != null && !versionValue.trim().equals("")) {
                    _isInstanceDoc = true;
                    _version = versionValue;
                }

                // Next look for attributes.
                Iterator attributes = target.attributeList(Settable.class)
                        .iterator();
                while (attributes.hasNext()) {
                    NamedObj attribute = (NamedObj) attributes.next();
                    if (((Settable) attribute).getVisibility() != Settable.NONE) {
                        String attributeDoc = instanceDoc
                                .getParameterDoc(attribute.getName());
                        if (attributeDoc != null
                                && !attributeDoc.trim().equals("")) {
                            _isInstanceDoc = true;
                            _properties.put(attribute.getName(), attributeDoc);
                        }
                    }
                }
                // Next look for ports.
                if (target instanceof Entity) {
                    Iterator ports = ((Entity) target).portList().iterator();
                    while (ports.hasNext()) {
                        Port port = (Port) ports.next();
                        String portDoc = instanceDoc.getPortDoc(port.getName());
                        if (portDoc != null && !portDoc.trim().equals("")) {
                            _isInstanceDoc = true;
                            _ports.put(port.getName(), portDoc);
                        }
                    }
View Full Code Here


            // Nonetheless, we look for exceptions and report them.
            try {
                NamedObj parent = (NamedObj) ((Instantiable) _target)
                        .getParent();
                List docAttributes = parent.attributeList(DocAttribute.class);
                DocAttribute attribute = (DocAttribute) docAttributes
                        .get(docAttributes.size() - 1);
                Effigy effigy = getEffigy();
                DocEffigy newEffigy = new DocEffigy((CompositeEntity) effigy
                        .getContainer(), effigy.getContainer().uniqueName(
                        "parentClass"));
View Full Code Here

        super(container, name);
        if (!(container instanceof DocEffigy)) {
            throw new IllegalActionException(container,
                    "Needs to be an instance of DocEffigy to contain a DocTableau.");
        }
        DocAttribute docAttribute = ((DocEffigy) container).getDocAttribute();
        if (docAttribute != null) {
            // Have a doc attribute.
            DocViewer frame = new DocViewer(docAttribute.getContainer(),
                    (Configuration) container.toplevel());
            setFrame(frame);
            frame.setTableau(this);
        } else {
            // No doc attribute. Find the URL of the enclosing effigy.
View Full Code Here

TOP

Related Classes of ptolemy.vergil.basic.DocAttribute

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.