Package ptolemy.actor.gt.ingredients.criteria

Examples of ptolemy.actor.gt.ingredients.criteria.StringCriterionElement


            if (element instanceof BooleanCriterionElement) {
                JCheckBox checkBox = new JCheckBox();
                checkBox.setHorizontalAlignment(SwingConstants.CENTER);
                component = checkBox;
            } else if (element instanceof StringCriterionElement) {
                StringCriterionElement stringElement = (StringCriterionElement) element;
                boolean acceptRE = stringElement.acceptRegularExpression();
                boolean acceptExp = stringElement.acceptPtolemyExpression();
                Color background;
                if (acceptRE) {
                    background = _REGULAR_EXPRESSION_BACKGROUND;
                } else if (acceptExp) {
                    background = _PTOLEMY_EXPRESSION_BACKGROUND;
                } else {
                    background = _NON_REGULAR_EXPRESSION_BACKGROUND;
                }

                if (element instanceof ChoiceCriterionElement) {
                    ChoiceCriterionElement choiceElement = (ChoiceCriterionElement) element;
                    ColorizedComboBox comboBox = new ColorizedComboBox(
                            background);
                    comboBox.setEditable(choiceElement.isEditable());
                    for (Object choice : choiceElement.getChoices()) {
                        comboBox.addItem(choice);
                    }
                    component = comboBox;
                } else {
                    component = new ColorizedTextField(background);
                }
            } else if (element instanceof StringOperationElement) {
                StringOperationElement stringElement = (StringOperationElement) element;
                boolean acceptExp = stringElement.acceptPtolemyExpression();
                Color background;
                if (acceptExp) {
                    background = _PTOLEMY_EXPRESSION_BACKGROUND;
                } else {
                    background = _NON_REGULAR_EXPRESSION_BACKGROUND;
View Full Code Here

TOP

Related Classes of ptolemy.actor.gt.ingredients.criteria.StringCriterionElement

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.