Package ptolemy.gui

Examples of ptolemy.gui.Query$QueryFileChooser


            while (arguments.hasNext()) {
                Argument argument = (Argument) arguments.next();
                argumentNames[index++] = argument.getName();
            }

            Query query = new Query();
            query.addChoice("delete", "Argument to delete", argumentNames,
                    null, false);

            ComponentDialog dialog = new ComponentDialog(_owner,
                    "Delete a argument for " + _target.getFullName(), query,
                    null);

            // If the OK button was pressed, then queue a mutation
            // to delete the argument.
            if (dialog.buttonPressed().equals("OK")) {
                String argumentName = query.getStringValue("delete");

                if (argumentName != null) {
                    Argument argument = _target.getArgument(argumentName);

                    if (argument != null) {
View Full Code Here


            NameDuplicationException {
        // Create a new dialog to add an argument, then open a new
        // ArgumentConfigurerDialog.
        //name = "new ";
        Set optionsDefault = new HashSet();
        _query = new Query();

        if (message != null) {
            _query.setMessage(message);
        }
View Full Code Here

     */
    protected JFileChooser _saveAsFileDialog() {
        JFileChooser fileDialog = super._saveAsFileDialog();

        if ((_model != null) && (_model.getContainer() != null)) {
            _query = new Query();
            _query.addCheckBox("submodel", "Save submodel only", false);
            fileDialog.setAccessory(_query);
        }

        return fileDialog;
View Full Code Here

                if (Configurer.isVisible(target, parameter)) {
                    attributeNames[index++] = ((Attribute) parameter).getName();
                }
            }

            Query query = new Query();
            query.addChoice("delete", "Parameter to delete", attributeNames,
                    null, false);

            ComponentDialog dialog = new ComponentDialog(_owner,
                    "Delete a parameter for " + _target.getFullName(), query,
                    null);

            // If the OK button was pressed, then queue a mutation
            // to delete the parameter.
            String deleteName = query.getStringValue("delete");

            if (dialog.buttonPressed().equals("OK") && !deleteName.equals("")) {
                String moml = "<deleteProperty name=\"" + deleteName + "\"/>";
                _target.addChangeListener(this);
View Full Code Here

     */
    protected ComponentDialog _openAddDialog(String message, String name,
            String defValue, String className) {
        // Create a new dialog to add a parameter, then open a new
        // EditParametersDialog.
        _query = new Query();

        if (message != null) {
            _query.setMessage(message);
        }

View Full Code Here

     */
    public FileChooserQuery() {
        super("FileChooserQuery");

        JPanel contentPane = new JPanel();
        _query = new Query();
        contentPane.add(_query);

        _query.addCheckBox("check", "Check box", true);
        _query.setTextWidth(20);
        _query.addLine("line", "Entry box", "default entry");
View Full Code Here

    /** Create a Query object and configure it.
     */
    public void init() {
        super.init();
        _query = new Query();
        _query.addCheckBox("check", "Check box", true);
        _query.setTextWidth(20);
        _query.addLine("line", "Entry box", "default entry");
        _query.addDisplay("display", "Display", "displayed string");

View Full Code Here

    public PlotFormatter(PlotBox plot) {
        super();
        _plot = plot;

        setLayout(new BorderLayout());
        _wideQuery = new Query();
        add(_wideQuery, BorderLayout.WEST);
        _narrowQuery = new Query();
        add(_narrowQuery, BorderLayout.EAST);

        // Populate the wide query.
        _wideQuery.setTextWidth(20);
        _originalTitle = plot.getTitle();
View Full Code Here

                    DebugListenerTableau tableau = new DebugListenerTableau(
                            textEffigy, textEffigy.uniqueName("debugListener"));
                    tableau.setDebuggable(getModel());
                } else if (actionCommand.equals("Animate States")) {
                    // Dialog to ask for a delay time.
                    Query query = new Query();
                    query.addLine("delay", "Time (in ms) to hold highlight",
                            Long.toString(_lastDelayTime));

                    ComponentDialog dialog = new ComponentDialog(
                            FSMGraphFrame.this, "Delay for Animation", query);

                    if (dialog.buttonPressed().equals("OK")) {
                        try {
                            _lastDelayTime = Long.parseLong(query
                                    .getStringValue("delay"));
                            _controller.setAnimationDelay(_lastDelayTime);

                            NamedObj model = getModel();
View Full Code Here

    }

    /** Open a dialog to select a dataset to edit.
     */
    protected void _selectDataset() {
        Query query = new Query();
        int numSets = ((EditablePlot) plot).getNumDataSets();
        String[] choices = new String[numSets + 1];

        for (int i = 0; i < numSets; i++) {
            choices[i + 1] = plot.getLegend(i);

            if (choices[i + 1] == null) {
                choices[i + 1] = "" + i;
            }
        }

        choices[0] = "none";
        query.setTextWidth(20);
        query.addChoice("choice",
                "Choose a data set, then drag the right mouse button", choices,
                choices[0]);

        ComponentDialog dialog = new ComponentDialog(this, "Select dataset",
                query);
        String buttonPressed = dialog.buttonPressed();

        if (buttonPressed.equals("OK")) {
            int result = query.getIntValue("choice");

            if (result > 0) {
                ((EditablePlot) plot).setEditable(result - 1);
            } else {
                // none...
View Full Code Here

TOP

Related Classes of ptolemy.gui.Query$QueryFileChooser

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.