Package ptolemy.data.expr

Examples of ptolemy.data.expr.SingletonParameter


        // Create new parameters and ports.
        // Set default values of the parameters and type constraints.
        pattern = new PortParameter(this, "pattern");
        pattern.setStringMode(true);
        pattern.setExpression("");
        (new SingletonParameter(pattern.getPort(), "_showName"))
                .setToken(BooleanToken.TRUE);

        replaceAll = new Parameter(this, "replaceAll");
        replaceAll.setExpression("true");
        replaceAll.setTypeEquals(BaseType.BOOLEAN);

        replacement = new PortParameter(this, "replacement");
        replacement.setStringMode(true);
        replacement.setExpression("");
        (new SingletonParameter(replacement.getPort(), "_showName"))
                .setToken(BooleanToken.TRUE);

        stringToEdit = new PortParameter(this, "stringToEdit");
        stringToEdit.setStringMode(true);
        stringToEdit.setExpression("");
        (new SingletonParameter(stringToEdit.getPort(), "_showName"))
                .setToken(BooleanToken.TRUE);

        output = new TypedIOPort(this, "output", false, true);
        output.setTypeEquals(BaseType.STRING);
    }
View Full Code Here


        TextAttribute text = new TextAttribute(_icon, "text");
        text.text.setExpression("LocalPreferences");

        // Hide the name.
        SingletonParameter _hideName = new SingletonParameter(this, "_hideName");
        _hideName.setToken(BooleanToken.TRUE);
        _hideName.setVisibility(Settable.EXPERT);
    }
View Full Code Here

        // to display them.
        if (sample instanceof Entity) {
            Iterator ports = ((Entity) sample).portList().iterator();
            while (ports.hasNext()) {
                Port port = (Port) ports.next();
                SingletonParameter show = new SingletonParameter(port,
                        "_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

            // or if the value of the preference and the checkbox differ.
            try {
                PtolemyPreferences preferences = PtolemyPreferences
                        .getPtolemyPreferencesWithinConfiguration(configuration);
                // FIXME: is ok to create a new parameter each time?
                SingletonParameter showWelcomeWindowAtStartupParameter = new SingletonParameter(
                        preferences, "_showWelcomeWindowAtStartup");

                // FIXME: is there a better way to set a BooleanToken?
                showWelcomeWindowAtStartupParameter.setToken(_startupCheck
                        .isSelected() ? BooleanToken.TRUE : BooleanToken.FALSE);
                preferences.save();
            } catch (Exception ex) {
                MessageHandler.error("Failed to update preferences and"
                        + "save _showWelcomeWindowAtStarupPreferences", ex);
View Full Code Here

                + "style=\"font-size:12; font-family:SansSerif; fill:white\">"
                + "Double click to\ngenerate code.</text></svg>");

        _instantiateEditorFactoryClass();

        SingletonParameter hide = new SingletonParameter(this, "_hideName");
        hide.setToken(BooleanToken.TRUE);
        hide.setVisibility(Settable.EXPERT);
    }
View Full Code Here

        super(container, name);

        start = new PortParameter(this, "start");
        start.setExpression("0");
        start.setTypeEquals(BaseType.INT);
        (new SingletonParameter(start.getPort(), "_showName"))
                .setToken(BooleanToken.TRUE);

        forwards = new Parameter(this, "forwards");
        forwards.setExpression("true");
        forwards.setTypeEquals(BaseType.BOOLEAN);
View Full Code Here

TOP

Related Classes of ptolemy.data.expr.SingletonParameter

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.