Package ptolemy.data.expr

Examples of ptolemy.data.expr.StringParameter


    public QueuedTypedIOPort newFixOutputPort(String name)
            throws IllegalActionException, NameDuplicationException {

        // For each output port, we want to have an assoicated
        // precision, overflow and rounding parameters.
        Parameter precision = new StringParameter(this, name + "Precision");
        precision.setExpression("31:0");

        Parameter overflow = new StringParameter(this, name + "Overflow");
        Parameter rounding = new StringParameter(this, name + "Rounding");

        overflow.setExpression("CLIP");

        Iterator iterator = Overflow.nameIterator();
        while (iterator.hasNext()) {
            overflow.addChoice(((String) iterator.next()).toUpperCase());
        }

        rounding.setExpression("HALF_EVEN");

        iterator = Rounding.nameIterator();
        while (iterator.hasNext()) {
            rounding.addChoice(((String) iterator.next()).toUpperCase());
        }

        QueuedTypedIOPort port = new QueuedTypedIOPort(this, name, false, true);

        port.setTypeEquals(BaseType.FIX);
View Full Code Here


    public VisualModelReference(CompositeEntity container, String name)
            throws IllegalActionException, NameDuplicationException {
        super(container, name);

        // Create the openOnFiring parameter.
        openOnFiring = new StringParameter(this, "openOnFiring");

        // Set the options for the parameters.
        openOnFiring.setExpression("do not open");
        openOnFiring.addChoice("doNotOpen");
        openOnFiring.addChoice("open in Vergil");
        openOnFiring.addChoice("open in Vergil (full screen)");

        // Create the closeOnPostfire parameter.
        closeOnPostfire = new StringParameter(this, "closeOnPostfire");
        closeOnPostfire.setExpression("do nothing");
        closeOnPostfire.addChoice("do nothing");
        closeOnPostfire.addChoice("close Vergil graph");

        // Create a tableau factory to override look inside behavior.
View Full Code Here

        backgroundColor = new ColorAttribute(this, "backgroundColor");
        backgroundColor.setExpression("{0.9, 0.9, 0.9, 1.0}");
        backgroundColor.setDisplayName("Background Color");

        StringParameter _showParameters = new StringParameter(this,
                "_showParameters");
        _showParameters.addChoice("None");
        _showParameters.addChoice("Overridden parameters only");
        _showParameters.addChoice("All");
        _showParameters.setExpression("None");
        _showParameters.setDisplayName("Show parameters");

        // The icon.
        EditorIcon _icon = new EditorIcon(this, "_icon");
        RectangleAttribute rectangle = new RectangleAttribute(_icon,
                "rectangle");
View Full Code Here

    public Parameter subdirs;

    protected void _initParameter() throws IllegalActionException,
            NameDuplicationException {
        parameter = new StringParameter(this, "display");
        parameter.setDisplayName("Display (./)");
        parameter.setPersistent(false);
        parameter.setVisibility(NONE);

        directory = new FileParameter(this, "directory");
        directory.setDisplayName("Directory");
        directory.setExpression(".");
        directory.addValueListener(this);
        Parameter allowFiles = new Parameter(directory, "allowFiles");
        allowFiles.setTypeEquals(BaseType.BOOLEAN);
        allowFiles.setToken(BooleanToken.FALSE);
        Parameter allowDirectories = new Parameter(directory,
                "allowDirectories");
        allowDirectories.setTypeEquals(BaseType.BOOLEAN);
        allowDirectories.setToken(BooleanToken.TRUE);

        fileFilter = new StringParameter(this, "filter");
        fileFilter.setDisplayName("File filter (*.xml)");
        fileFilter.setExpression("");
        fileFilter.addValueListener(this);

        subdirs = new Parameter(this, "subdirs");
View Full Code Here

        modelInput = new TypedIOPort(this, "modelInput", true, false);
        modelInput.setTypeEquals(ActorToken.TYPE);
        modelOutput = new TypedIOPort(this, "modelOutput", false, true);
        modelOutput.setTypeEquals(ActorToken.TYPE);

        mode = new StringParameter(this, "mode");
        for (int i = Mode.values().length - 1; i >= 0; i--) {
            mode.addChoice(Mode.values()[i].toString());
        }
        mode.addValueListener(this);
        mode.setExpression(Mode.REPLACE_FIRST.toString());
View Full Code Here

                        "_showName");
                show.setExpression("true");
            }
        }
        // Next, set options to display parameter values.
        StringParameter show = new StringParameter(container, "_showParameters");
        show.setExpression("All");

        // Defer this to get it to happen after rendering.
        Runnable defer = new Runnable() {
            public void run() {
                Rectangle2D bounds = graphPane.getForegroundLayer()
View Full Code Here

        }

        public void clear() throws IllegalActionException {
            IOPort container = getContainer();
            if (container != null) {
                StringParameter receiverClass = (StringParameter) container
                        .getAttribute("receiverClass", StringParameter.class);
                if (receiverClass != null) {
                    String className = ((StringToken) receiverClass.getToken())
                            .stringValue();
                    try {
                        Class desiredClass = Class.forName(className);
                        _receiver = (Receiver) desiredClass.newInstance();
                    } catch (Exception e) {
View Full Code Here

        // FIXME: what is the initial value of this parameter?
        template = new PortParameter(this, "template");
        template.setStringMode(true);

        headerParameter = new StringParameter(this, "headerParameter");
        headerParameter
                .setExpression("<?xml version=\"1.0\" standalone=\"no\"?>");

        // Set the type of the output port.
        output.setTypeEquals(BaseType.XMLTOKEN);
View Full Code Here

            } else {
                try {
                    if (fileOrURLParameter.asURL() == null) {
                        ModelDirectory directory = configuration.getDirectory();

                        StringParameter initialDefaultContentsParameter = (StringParameter) object
                                .getAttribute("initialDefaultContents");
                        String defaultText = "";
                        if (initialDefaultContentsParameter != null) {
                            defaultText = initialDefaultContentsParameter
                                    .getExpression();
                        }
                        Effigy effigy = TextEffigy.newTextEffigy(directory,
                                defaultText);
                        configuration.createPrimaryTableau(effigy);
View Full Code Here

        above = new Parameter(this, "above");
        above.setExpression("false");
        above.setTypeEquals(BaseType.BOOLEAN);

        scale = new StringParameter(this, "scale");
        scale.setExpression("absolute");
        scale.addChoice("absolute");
        scale.addChoice("relative linear");
        scale.addChoice("relative amplitude decibels");
        scale.addChoice("relative power decibels");
View Full Code Here

TOP

Related Classes of ptolemy.data.expr.StringParameter

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.