Package org.openquark.cal.valuenode

Examples of org.openquark.cal.valuenode.ValueNode


       
        // Tuple elements
        Map<FieldName, TypeExpr> hasFieldsMap = unconstrainedTupleType.rootRecordType().getHasFieldsMap();
        int j = 0;
        for (final TypeExpr unconstrainedTupleElementType : hasFieldsMap.values()) {
            ValueNode currentTupleItem = currentTupleValue.getValueAt(j);
            returnMap.put(currentTupleItem, unconstrainedTupleElementType);
            ++j;
        }

        return returnMap;
View Full Code Here


           
            ValueEditorManager valueEditorManager = getValueEditorManager();
           
            for (int i = 0, size = valueNode.getTupleSize(); i < size; i++) {
           
                ValueNode elementValueNode = valueNode.getValueAt(i);
               
                if (!valueEditorManager.isSupportedValueNode(elementValueNode, providerSupportInfo)) {
                    return false;
                }
            }
View Full Code Here

        Map<ValueNode, ValueNode> commitValueMap = valueNodeCommitHelper.getCommitValues(oldValueNode, newValueNode, valueNodeToUnconstrainedTypeMap);

        // Construct the return map giving new values to the affected inputs.
        Map<PartInput, ValueNode> inputToNewValueMap = new HashMap<PartInput, ValueNode>();
        for (final Map.Entry<ValueNode, ValueNode> mapEntry : commitValueMap.entrySet()){
            ValueNode affectedValueNode = mapEntry.getKey();
            Gem.PartInput affectedInput = valueNodeInputMap.get(affectedValueNode);
            ValueNode newInputValue = mapEntry.getValue();
            inputToNewValueMap.put(affectedInput, newInputValue);
        }

        return inputToNewValueMap;
    }
View Full Code Here

        // Populate the return map.
        for (final Map.Entry<PartInput, ValueNode> mapEntry : inputToNewValueNodeMap.entrySet()) {
            Gem.PartInput input = mapEntry.getKey();

            ValueGem connectedValueGem = inputToValueGemMap.get(input);
            ValueNode newInputValue = mapEntry.getValue();
            
            valueGemToNewValueNodeMap.put(connectedValueGem, newInputValue);
        }
        valueGemToNewValueNodeMap.put(valueGemToSwitch, newValueNode)// necessary..?
View Full Code Here

            TypeExpr newSourceType = mapEntry.getValue();
                    
            // So if the type was changed, we want to swap the nodes
            if (!newSourceType.sameType(originalSourceExpr)) {
                // we transmute the node to come up with a valueNode of our desired type
                ValueNode valueNode = valueGem.getValueNode().transmuteValueNode(valueNodeBuilderHelper, valueNodeTransformer, newSourceType);
               
                // post definition changes if desired when swapping the nodes
                valueGem.changeValue(valueNode);
            }
        }
View Full Code Here

                    TypeExpr newSourceType = mapEntry.getValue();
                            
                    // If the type was changed, attach a temporary value gem of the correct type.
                    if (!newSourceType.sameType(originalSourceExpr)) {
                        // Transmute the node to come up with a valueNode of our desired type
                        ValueNode valueNode = valueGem.getValueNode().transmuteValueNode(valueNodeBuilderHelper, valueNodeTransformer, newSourceType);
                       
                        // Create a temporary value gem and connect it.
                        ValueGem tempValueGem = new ValueGem(valueNode);
                        PartInput connectedInput = outputConnection.getDestination();
                        connectedInput.bindConnection(new Connection(tempValueGem.getOutputPart(), connectedInput));
View Full Code Here

     */
    @Override
    protected void commitValue() {
       
        // Update the value in the ValueNode.
        ValueNode returnVN = new RelativeDateValueNode(getCalendar().getTime(), getValueNode().getTypeExpr());
        replaceValueNode(returnVN, false);

        notifyValueCommitted();
    }
View Full Code Here

        try {
            // Now create a target to be run by a value runner.
           
            ValueRunner valueRunner = owner.getValueRunner();
            ValueNode valueNode = valueRunner.getValue(expressionTarget, expressionModule);
           
            if (valueRunner.isErrorFlagged()) {
                result.append(valueRunner.getErrorMessage(expressionTarget, expressionModule));
                return false;
               
            } else if (valueNode == null) {
                result.append(NavigatorMessages.getString("NAV_NullValueNode_Message"));
                return false;
               
            } else {
                result.append(valueNode.getTextValue());
                return true;
            }

        } catch (ProgramCompileException ex) {
            result.append(NavigatorMessages.getString("NAV_CompilationError_Message"));
View Full Code Here

        // Lazily create the value panel on demand.
        if (!valueGemPanelMap.containsKey(valueGem)) {
           
            final ValueEditorHierarchyManager valueEditorHierarchyManager = gemCutter.getValueEditorHierarchyManager();
            ValueEditorManager valueEditorManager = valueEditorHierarchyManager.getValueEditorManager();
            ValueNode valueNode = valueGem.getValueNode();
   
            // Create the value entry panel.
            final ValueEntryPanel valueEntryPanel =
                (ValueEntryPanel)valueEditorManager.getValueEditorDirector().getRootValueEditor(valueEditorHierarchyManager,
                                                                                                valueNode, null, 0, null);
           
            // Add it to the map.
            valueGemPanelMap.put(valueGem, valueEntryPanel);
           
            // add a listener to propagate changes in the value gem to the VEP.
            valueGem.addValueChangeListener(new ValueGemChangeListener() {
                public void valueChanged(ValueGemChangeEvent e) {
                    ValueGem valueGem = (ValueGem)e.getSource();
                    valueEditorHierarchyManager.collapseHierarchy(valueEntryPanel, false);
                    valueEntryPanel.changeOwnerValue(valueGem.getValueNode());
                    valueEntryPanel.setSize(valueEntryPanel.getPreferredSize());
                    valueEntryPanel.revalidate();
                }
            });
   
            // Set size of the panel.
            valueEntryPanel.setSize(valueEntryPanel.getPreferredSize());
           
            // Add a listener to propagate changes in the VEP to the value gem.
            valueEntryPanel.addValueEditorListener(new ValueEditorAdapter() {
                public void valueCommitted(ValueEditorEvent evt) {
                    ValueNode oldValue = evt.getOldValue();
                    ValueNode newValue = ((ValueEntryPanel)evt.getSource()).getValueNode();
   
                    if (!oldValue.sameValue(newValue)) {
                        valueGem.changeValue(newValue);
                    }
                }
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.