Package ptolemy.kernel.util

Examples of ptolemy.kernel.util.Attribute


        try {
            // NOTE: Used to call uniqueName() here to choose the name for the
            // marker.  This is a bad idea.  This calls getEntity(), which
            // triggers populate() on the library, defeating deferred
            // evaluation.
            new Attribute(this, "_libraryMarker");
        } catch (KernelException ex) {
            throw new InternalErrorException(ex.toString());
        }
    }
View Full Code Here


        // NOTE: Used to call uniqueName() here to choose the name for the
        // marker.  This is a bad idea.  This calls getEntity(), which
        // triggers populate() on the library, defeating deferred
        // evaluation.
        new Attribute(this, "_libraryMarker");
    }
View Full Code Here

     * GeneratorAttribute.
     *  @exception IllegalActionException If no Settable object with
     *  the given name exists in this GeneratorAttribute.
     */
    public String getParameter(String name) throws IllegalActionException {
        Attribute attribute = getAttribute(name);

        if (attribute instanceof StringAttribute) {
            StringAttribute stringAttribute = (StringAttribute) attribute;
            return stringAttribute.getExpression();
        } else if (attribute instanceof Parameter) {
View Full Code Here

    /** Return true if a parameter with the given name is defined in this
     *  GeneratorAttribute.
     */
    public boolean hasParameter(String name) throws IllegalActionException {
        Attribute attribute = getAttribute(name);
        return (attribute != null);
    }
View Full Code Here

     @exception IllegalActionException If no Settable object with
     *  the given name exists in this GeneratorAttribute.
     */
    public void setParameter(String name, String value)
            throws IllegalActionException {
        Attribute attribute = getAttribute(name);

        if (attribute instanceof Settable) {
            ((Settable) attribute).setExpression(value);
            ((Settable) attribute).validate();
        } else {
View Full Code Here

        // this method every time we add a field.
        StringBuffer results = new StringBuffer();
        Iterator attributes = attributeList().iterator();

        while (attributes.hasNext()) {
            Attribute attribute = (Attribute) attributes.next();

            if (attribute instanceof Parameter) {
                StringBuffer value = new StringBuffer("\n Value:         ");

                try {
                    value.append(((Parameter) attribute).getToken().toString());
                } catch (Exception ex) {
                    value.append(ex.toString());
                }

                String className = "Parameter";

                if (attribute instanceof StringParameter) {
                    className = "StringParameter";
                }

                results.append(className + ":      " + attribute.getName()
                        + "\n Expression:    "
                        + ((Parameter) attribute).getExpression()
                        + value.toString());
            } else {
                results.append("Attribute:      " + attribute.getName());
            }

            Attribute tooltipAttribute = ((NamedObj) attribute)
                    .getAttribute("tooltip");

            if ((tooltipAttribute != null)
                    && tooltipAttribute instanceof Documentation) {
                results
View Full Code Here

            Parameter iterations = (StringParameter) getAttribute("iterations");

            if (director == null) {
                iterations.setExpression("1000");
            } else {
                Attribute directorIterations = director
                        .getAttribute("iterations");

                if (directorIterations != null) {
                    Token iterationsToken = ((Parameter) directorIterations)
                            .getToken();
View Full Code Here

            this.description = "";
            this.userLevelDocumentation = "";

            Iterator attItt = target.attributeList().iterator();
            while (attItt.hasNext()) {
                Attribute a = (Attribute) attItt.next();
                String aname = a.getName();
                if (!aname.substring(0, 1).equals("_")
                        && !aname.equals("KeplerDocumentation")) {
                    propertyHash.put(a.getName(), "");
                }
            }

            if (target instanceof Entity) {
                Iterator portItt = ((Entity) target).portList().iterator();
View Full Code Here

                    .iterator();
            while (entities.hasNext()) {
                Entity entity = (Entity) entities.next();
                Iterator attributes = entity.attributeList().iterator();
                while (attributes.hasNext()) {
                    Attribute attribute = (Attribute) attributes.next();
                    if (attribute instanceof Variable) {
                        Variable variable = (Variable) attribute;

                        boolean doGetToken = true;
                        while (doGetToken) {
View Full Code Here

        // Get the name of the variable without the .auto.
        String variableName = exception.getNameable1().getFullName().substring(
                ((NamedObj) exception.getNameable1()).toplevel().getName()
                        .length() + 2);

        Attribute masterAttribute = container.getAttribute(variableName);

        if (masterAttribute instanceof Variable) {
            Variable masterVariable = (Variable) masterAttribute;
            ParserScope parserScope = masterVariable.getParserScope();
            if (parserScope instanceof ModelScope) {
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.