Package jni

Examples of jni.Argument


        while (arguments.hasNext()) {
            Object candidate = arguments.next();

            if (candidate instanceof Argument) {
                Argument argument = (Argument) candidate;
                setColumns(1);
                addLine(argument.getName() + " Name", argument.getName()
                        + "Name", argument.getName());
                addLine(argument.getName() + " CType", argument.getName()
                        + " C or C++ Type", argument.getCType());

                Set optionsDefault = new HashSet();

                if (argument.isInput()) {
                    optionsDefault.add("input");
                }

                if (argument.isOutput()) {
                    optionsDefault.add("output");
                }

                if (argument.isReturn()) {
                    optionsDefault.add("return");
                }

                addSelectButtons(argument.getName() + " Kind", argument
                        .getName()
                        + " Kind:", _optionsArray, optionsDefault);
            }
        }
    }
View Full Code Here


        while (arguments.hasNext()) {
            Object candidate = arguments.next();

            if (candidate instanceof Argument) {
                Argument argument = (Argument) candidate;
                String type = argument.getName() + " CType";
                String name = argument.getName() + " Name";
                String kind = argument.getName() + " Kind";

                if (!type.equals(argument.getCType())
                        && !name.equals(argument.getName())
                        && !kind.equals(argument.getKind())) {
                    String newName = getStringValue(name);

                    try {
                        argument.setName(newName);
                    } catch (Exception e) {
                        MessageHandler.error("This name is already used ! : ",
                                e);
                        continue;
                    }

                    String newCType = getStringValue(type);
                    argument.setCType(newCType);

                    String newKind = getStringValue(kind);
                    argument.setKind(newKind);
                    argument.checkType();
                    foundOne = true;
                }

                if (foundOne) {
                    argument.setExpression();

                    _object = (GenericJNIActor) argument.getContainer();

                    try {
                        argument.validate();
                    } catch (IllegalActionException e) {
                        MessageHandler.error("TRT :No way to update MoML! : ",
                                e);
                    }
                }
View Full Code Here

            String[] argumentNames = new String[argumentsList.size()];
            Iterator arguments = argumentsList.iterator();
            int index = 0;

            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) {
                        try {
                            _target.removeArgument(argument);
                        } catch (Exception e) {
                            MessageHandler.error("Unable to remove argument '"
                                    + argument + "'.", e);
                        }

                        // The context for the MoML should be the first
                        // container above this port in the hierarchy
                        // that defers its MoML definition, or the
                        // immediate parent if there is none.
                        NamedObj container = argument.getContainer();
                        String moml = "<deleteProperty name=\""
                                + argument.getName() + "\"/>\n";

                        ChangeRequest request = new MoMLChangeRequest(this,
                                container, moml);
                        container.addChangeListener(this);
                        container.requestChange(request);
View Full Code Here

        String newKind = _query.getStringValue(name + " Kind");

        if (dialog.buttonPressed().equals("OK") && !newName.equals("")
                && !newCType.equals("") && !newKind.equals("")) {
            //set name
            Argument argument = _target.getArgument(newName);

            if (argument == null) {
                argument = new Argument(_target, newName);
                argument.setName(newName);
            } else {
                MessageHandler.error("This name is already used !");
            }

            argument.setKind(newKind.trim());
            argument.setCType(newCType.trim());
            argument.setExpression();

            String moml = "<property name=\"" + argument.getName()
                    + "\" value=\"" + argument.getExpression() + "\""
                    + " class=\"" + "jni.Argument" + "\"/>";
            _target.addChangeListener(this);
            _target.requestChange(new MoMLChangeRequest(this, _target, moml));
        }
View Full Code Here

TOP

Related Classes of jni.Argument

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.