Package org.openquark.cal.valuenode

Examples of org.openquark.cal.valuenode.ValueNode


            // Build and execute the test program in non-threaded mode.
            buildTestProgram(inputPolicies, argTypes);
            executeTestProgram(inputValues, false);

            // The returned value node won't have a type expression set, so it's up to us to do it.
            ValueNode outputValueNode = getOutputValueNode();
            if (outputValueNode == null) {
                String errorString = "Null value executing text: " + getTarget().getTargetDef(null, currentModuleTypeInfo).toString();
                GemCutter.CLIENT_LOGGER.log(Level.WARNING, errorString);
               
                return null;
            }
           
            if (error != null) {
                String errorString = "Null value executing text: " + getTarget().getTargetDef(null, currentModuleTypeInfo).toString();
                GemCutter.CLIENT_LOGGER.log(Level.WARNING, errorString, error);
               
                return null;
            }
           
            ValueNode returnNode = outputValueNode.copyValueNode();
            returnNode.setOutputJavaValue(executionResult);
            return returnNode;
        }
    }
View Full Code Here


                    // HACK: We have to remove the listener so that it doesn't cancel editing
                    // as a result of our own change.
                    valueGem.removeValueChangeListener(editorValueGemListener);
                   
                    ValueEditor valueEditor = ((ValueEditor)editorComponent);
                    ValueNode vn = valueEditor.getValueNode();
                    explorerOwner.changeValueNode(valueGem, vn);
                    valueEditor.changeOwnerValue(explorerOwner.getValueNode(valueGem));

                    valueGem.addValueChangeListener(editorValueGemListener);
                }
View Full Code Here

                }
               
                public void valueCommitted(ValueEditorEvent evt) {
                    explorerOwner.changeValueNode(input, ((ValueEditor)editorComponent).getValueNode());
               
                    ValueNode valueNode = explorerOwner.getValueNode(input);
                    if (valueNode != null) {
       
                        // todoFW: What is the correct behaviour in this case?
                        // Sometimes the returned value will be null.
                        // This should really never happen, but since the client
View Full Code Here

        // Update the valuegems with their new types and post any value edits to the undo manager.
        boolean valueGemChangesPosted = false;
        for (final Map.Entry<ValueGem, ValueNode> mapEntry : valueGemToNewValueMap.entrySet()) {
            ValueGem valueGemChanged = mapEntry.getKey();
            ValueNode valueGemChangedValue = mapEntry.getValue();

            ValueNode preChangeValue = (valueGemChanged == committedValueGem) ? oldValue : valueGemChanged.getValueNode();

            if (!preChangeValue.sameValue(valueGemChangedValue)) {
                valueGemChanged.changeValue(valueGemChangedValue);
                undoableEditSupport.postEdit(new UndoableValueChangeEdit(valueGemChanged, preChangeValue));
                valueGemChangesPosted = true;
            }
        }
View Full Code Here

        boolean valueGemChangesPosted = false;

        // Post a ValueChangeEdit for each value gem that changed.
        for (final Map.Entry<ValueGem, ValueNode> mapEntry : valueGemToOldValueMap.entrySet()) {
            ValueGem valueGem = mapEntry.getKey();
            ValueNode oldValue = mapEntry.getValue();

            if (!oldValue.sameValue(valueGem.getValueNode())) {
                undoableEditSupport.postEdit(new UndoableValueChangeEdit(valueGem, oldValue));
                valueGemChangesPosted = true;
            }
        }
View Full Code Here

                customIcon = ExplorerRootNode.rootNodeIcon;

            } else if (treeNode.getUserObject() instanceof Gem.PartInput) {

                Gem.PartInput input = (Gem.PartInput) treeNode.getUserObject();
                ValueNode valueNode = tableTopExplorerOwner.getValueNode(input);
                ArgumentMetadata metadata = input.getDesignMetadata();

                if (tableTopExplorerOwner.highlightInput(input)) {
                    // TODO: instead of hardcoding the highlighted font style, perhaps the renderer
                    //       should be passed to the highlight fn and let it set whatever is appropriate...
                    setTextNonSelectionColor(Color.RED);
                    setFont(tree.getFont().deriveFont(Font.ITALIC));
                }

                if (tableTopExplorerOwner.canEditInputsAsValues() && valueNode != null && !input.isBurnt()) {
                    customText = input.getArgumentName().getCompositeName() + ":  " + valueNode.getTextValue();

                } else {
                    customIcon = partInputIcon;

                    if (input.isBurnt()) {
View Full Code Here

     */
    public DateTimeValueEntryField(ValueEntryPanel valueEntryPanel) {

        super(valueEntryPanel);
       
        ValueNode valueNode = valueEntryPanel.getValueNode();
       
        TypeExpr typeExpr = valueNode.getTypeExpr();

        if (typeExpr.isNonParametricType(CAL_RelativeTime.TypeConstructors.RelativeTime)) {

            m_timeOrDateType = RELATIVETIME;

View Full Code Here

     */
    private class SliderChangeListener implements ChangeListener {

        public void stateChanged(ChangeEvent evt) {

            ValueNode oldValue = getValueNode();
            Integer newValue = new Integer(slider.getValue());

            TypeExpr typeExpr = getValueNode().getTypeExpr();
            replaceValueNode(new LiteralValueNode(newValue, typeExpr), true);

View Full Code Here

     */
    @Override
    protected void commitValue() {

        String stringValue = getTextArea().getText();
        ValueNode valueNode = getValueNode();

        if (valueNode instanceof ListOfCharValueNode ||
            valueNode instanceof ListValueNode) {       // TEMP (?): Lists of Chars are collapsed to ListOfChars

            ValueNode returnVN = new ListOfCharValueNode(stringValue, getValueNode().getTypeExpr());
            replaceValueNode(returnVN, true);

        } else if (valueNode instanceof LiteralValueNode){
            ValueNode returnVN = new LiteralValueNode(stringValue, getValueNode().getTypeExpr());
            replaceValueNode(returnVN, true);

        } else {
            throw new IllegalStateException("This value node cannot be handled by the string editor: " + valueNode.getClass());
        }
View Full Code Here

                uiCalendar.get(Calendar.HOUR_OF_DAY),
                uiCalendar.get(Calendar.MINUTE),
                uiCalendar.get(Calendar.SECOND));
               
        // Update the value in the ValueNode.
        ValueNode returnVN = new JTimeValueNode(Time.fromDate(localCalendar.getTime()), getValueNode().getTypeExpr());
        replaceValueNode(returnVN, false);

        notifyValueCommitted();
    }
View Full Code Here

TOP

Related Classes of org.openquark.cal.valuenode.ValueNode

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.