Package ptolemy.actor.gt

Examples of ptolemy.actor.gt.GTIngredientList


            tableau.setTitle("Operations editor for " + target.getName());
        }

        _attribute = (GTIngredientsAttribute) attribute;

        _temporaryIngredientList = new GTIngredientList(_attribute);
        _createComponents();
    }
View Full Code Here


                    + "criterion or operation instance.");
        }
    }

    public boolean apply() {
        GTIngredientList ingredientList = new GTIngredientList(_attribute);
        Vector<?> dataVector = _tableModel.getDataVector();
        for (Object rowData : dataVector) {
            Vector<?> rowVector = (Vector<?>) rowData;
            Row row = (Row) rowVector.get(1);
            GTIngredient incredient = _createIngredientFromRow(row);
            ingredientList.add(incredient);
        }

        try {
            ingredientList.validate();
        } catch (ValidationException e) {
            String message = e.getMessage()
                    + "\nPress Edit to return to modify the criterion or "
                    + "operation, or press Revert to revert to its previous "
                    + "value.";

            String[] options = new String[] { "Edit", "Revert" };
            int selected = JOptionPane.showOptionDialog(null, message,
                    "Validation Error", JOptionPane.OK_CANCEL_OPTION,
                    JOptionPane.ERROR_MESSAGE, null, options, options[1]);
            if (selected == 1) {
                resetTable(_initialIngredientList);
            }
            return false;
        }

        String moml = "<property name=\"" + _attribute.getName()
                + "\" value=\""
                + StringUtilities.escapeForXML(ingredientList.toString())
                + "\"/>";
        MoMLChangeRequest request = new MoMLChangeRequest(this, _target, moml,
                null);
        request.setUndoable(true);
        _attribute.requestChange(request);
View Full Code Here

TOP

Related Classes of ptolemy.actor.gt.GTIngredientList

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.