Package ptolemy.kernel.util

Examples of ptolemy.kernel.util.StringAttribute


                + " r=\"5\" style=\"fill:white\"/>\n"
                + "<circle cx=\"15\" cy=\"0\""
                + " r=\"5\" style=\"fill:white\"/>\n" + "</svg>\n");

        try {
            initialStateName = new StringAttribute(this, "initialStateName");
            initialStateName.setExpression("");
            initialStateName.setVisibility(Settable.EXPERT);

            finalStateNames = new StringAttribute(this, "finalStateNames");
            finalStateNames.setExpression("");
            finalStateNames.setVisibility(Settable.EXPERT);
        } catch (KernelException ex) {
            // This should never happen.
            throw new InternalErrorException("Constructor error "
View Full Code Here


        channel = new TypedIOPort(this, "channel");
        channel.setOutput(true);
        channel.setTypeEquals(BaseType.INT);

        // Add an attribute to get the port placed on the bottom.
        StringAttribute channelCardinal = new StringAttribute(channel,
                "_cardinal");
        channelCardinal.setExpression("SOUTH");

        _attachText("_iconDescription", "<svg>\n"
                + "<polygon points=\"-10,20 10,10 10,-10, -10,-20\" "
                + "style=\"fill:red\"/>\n" + "</svg>\n");
View Full Code Here

        // Add a hint to indicate to the PtolemyQuery class to open with a text style.
        Variable variable = new Variable(annotation, "_textHeightHint");
        variable.setExpression("5");
        variable.setPersistent(false);

        guardExpression = new StringAttribute(this, "guardExpression");
        // Add a hint to indicate to the PtolemyQuery class to open with a text style.
        variable = new Variable(guardExpression, "_textHeightHint");
        variable.setExpression("5");
        variable.setPersistent(false);

        outputActions = new OutputActionsAttribute(this, "outputActions");
        // Add a hint to indicate to the PtolemyQuery class to open with a text style.
        variable = new Variable(outputActions, "_textHeightHint");
        variable.setExpression("5");
        variable.setPersistent(false);

        setActions = new CommitActionsAttribute(this, "setActions");
        // Add a hint to indicate to the PtolemyQuery class to open with a text style.
        variable = new Variable(setActions, "_textHeightHint");
        variable.setExpression("5");
        variable.setPersistent(false);

        exitAngle = new Parameter(this, "exitAngle");
        exitAngle.setVisibility(Settable.NONE);
        exitAngle.setExpression("PI/5.0");
        exitAngle.setTypeEquals(BaseType.DOUBLE);
        gamma = new Parameter(this, "gamma");
        gamma.setVisibility(Settable.NONE);
        gamma.setExpression("0.0");
        gamma.setTypeEquals(BaseType.DOUBLE);
        reset = new Parameter(this, "reset");
        reset.setTypeEquals(BaseType.BOOLEAN);
        reset.setToken(BooleanToken.FALSE);
        preemptive = new Parameter(this, "preemptive");
        preemptive.setTypeEquals(BaseType.BOOLEAN);
        preemptive.setToken(BooleanToken.FALSE);

        // default attributes.
        defaultTransition = new Parameter(this, "defaultTransition");
        defaultTransition.setTypeEquals(BaseType.BOOLEAN);
        defaultTransition.setToken(BooleanToken.FALSE);

        // Nondeterministic attributes.
        nondeterministic = new Parameter(this, "nondeterministic");
        nondeterministic.setTypeEquals(BaseType.BOOLEAN);
        nondeterministic.setToken(BooleanToken.FALSE);

        // Add refinement name parameter
        refinementName = new StringAttribute(this, "refinementName");
    }
View Full Code Here

                "tokenConsumptionRate");
        control_tokenConsumptionRate.setVisibility(Settable.NOT_EDITABLE);
        control_tokenConsumptionRate.setTypeEquals(BaseType.INT);

        // Put the control input on the bottom of the actor.
        StringAttribute controlCardinal = new StringAttribute(control,
                "_cardinal");
        controlCardinal.setExpression("SOUTH");
    }
View Full Code Here

     */
    public AttributeValueAttribute(NamedObj container, String name)
            throws IllegalActionException, NameDuplicationException {
        super(container, name);

        attributeName = new StringAttribute(this, "attributeName");
        displayWidth = new Parameter(this, "displayWidth");
        displayWidth.setExpression("6");
        displayWidth.setTypeEquals(BaseType.INT);
    }
View Full Code Here

     */
    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) {
            Parameter parameter = (Parameter) attribute;
            Token token = parameter.getToken();

            if (token instanceof StringToken) {
View Full Code Here

        createInstanceFromExisting(this);
        try {
            DocAttribute da = new DocAttribute(target.workspace());
            da.setContainer(target);
            //da.setName("keplerFormattedPTIIDocumentation");
            da.author = new StringAttribute(da, "author");
            da.author.setExpression(author);
            da.version = new StringAttribute(da, "version");
            da.version.setExpression(version);
            da.since = new StringAttribute(da, "since");
            da.since.setExpression("");
            da.description = new StringParameter(da, "description");
            da.description.setExpression(userLevelDocumentation);

            //add ports and params
            Enumeration portItt = portHash.keys();
            while (portItt.hasMoreElements()) {
                String name = (String) portItt.nextElement();
                String desc = (String) portHash.get(name);
                StringAttribute sa = new StringAttribute(da, name + " (port)");
                sa.setExpression(desc);
            }

            Enumeration propItt = propertyHash.keys();
            while (propItt.hasMoreElements()) {
                String name = (String) propItt.nextElement();
View Full Code Here

            // Check to see if it has
            // attributes that specify its color or an explanation.
            // Old way to specify a color.
            try {
                StringAttribute colorAttr = (StringAttribute) (object
                        .getAttribute("_color", StringAttribute.class));
                if (colorAttr != null) {
                    String color = colorAttr.getExpression();
                    AnimationRenderer animationRenderer = new AnimationRenderer(
                            SVGUtilities.getColor(color));
                    animationRenderer.renderSelected(result);
                }
            } catch (IllegalActionException e) {
                // Ignore
            }
            // New way to specify a highlight color.
            try {
                ColorAttribute highlightAttribute = (ColorAttribute) (object
                        .getAttribute("_highlightColor", ColorAttribute.class));
                if (highlightAttribute != null
                        && !highlightAttribute.getExpression().trim()
                                .equals("")) {
                    Color color = highlightAttribute.asColor();
                    AnimationRenderer animationRenderer = new AnimationRenderer(
                            color);
                    animationRenderer.renderSelected(result);
                }
            } catch (IllegalActionException e) {
                // Ignore.
            }
            try {
                StringAttribute explanationAttribute = (StringAttribute) (object
                        .getAttribute("_explanation", StringAttribute.class));
                if (explanationAttribute != null) {
                    result.setToolTipText(explanationAttribute.getExpression());
                }
            } catch (IllegalActionException e) {
                // Ignore.
            }
View Full Code Here

            throw new KernelRuntimeException("Could not find "
                    + "configuration, list of configurations was "
                    + configsList.size() + " elements, all were null.");
        }
        // Look up the attribute (if it exists)
        StringAttribute multipleDocumentationAllowed = (StringAttribute) config
                .getAttribute("_multipleDocumentationAllowed");
        if (multipleDocumentationAllowed != null) {
            retVal = Boolean.parseBoolean(multipleDocumentationAllowed
                    .getExpression());
        }
        return retVal;
    }
View Full Code Here

                for (Iterator it = configsList.iterator(); it.hasNext();) {
                    config = (Configuration) it.next();
                    if (config != null)
                        break;
                }
                StringAttribute alternateGetMomlActionAttribute = (StringAttribute) config
                        .getAttribute("_alternateGetMomlAction");
                if ((alternateGetMomlActionAttribute != null) && (lsidFlag)) {
                    String alternateGetMomlClassName = alternateGetMomlActionAttribute
                            .getExpression();
                    try {
                        Class getMomlClass = Class
                                .forName(alternateGetMomlClassName);
                        object = getMomlClass.newInstance();
View Full Code Here

TOP

Related Classes of ptolemy.kernel.util.StringAttribute

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.