Package org.openquark.cal.valuenode

Examples of org.openquark.cal.valuenode.ValueNode


           
        } else {
            displayLabel.setForeground(Color.gray);
        }

        ValueNode valueVN = (ValueNode) value;

        // Special case when handling Colour data types.
        if (valueVN instanceof ColourValueNode) {      

            ColourValueNode colourValueNode = (ColourValueNode) valueVN;
            Color colour = colourValueNode.getColourValue();
           
            displayLabel.setBackground(colour);
            displayLabel.setForeground(colour);
           
        } else {
            displayLabel.setBackground(Color.white);
        }

        displayLabel.setText(valueVN.getTextValue());

        elementNumber = row + 1;

        return this;
    }
View Full Code Here


   
        // The value node of this editor will be updated to contain the value nodes
        // of the child editors as range endpoints, and the current form from the
        // editor settings.
       
        ValueNode start = leftEditor.getValueNode()
        ValueNode end = rightEditor.getValueNode();
        ValueNode returnVN = new RangeValueNode(getValueNode().getTypeExpr(), getRangeForm(), start, end);
        replaceValueNode(returnVN, false);
       
        notifyValueCommitted();
    }
View Full Code Here

        @Override
        public void valueCommitted(ValueEditorEvent e) {

            // Retrieve old and new node values
           
            ValueNode oldChild = e.getOldValue();
            ValueNode newChild = ((ValueEditor) e.getSource()).getValueNode();
            if (oldChild.sameValue(newChild)) {
                return;
            }

            // Apply the changes in the child node to the other nodes in this editor
View Full Code Here

       
        @Override
        public void valueCommitted(ValueEditorEvent e) {
           
            ValueEditor source = (ValueEditor) e.getSource();
            ValueNode oldChildValueNode = e.getOldValue();
            ValueNode newChildValueNode = source.getValueNode();
           
            if (!isEditable() || oldChildValueNode.sameValue(newChildValueNode)) {
                return;
            }

            // Get the commit value map and update the editor panel value nodes.
            Map<ValueNode, TypeExpr> valueNodeToUnconstrainedTypeMap = getValueNodeToUnconstrainedTypeMap();
            Map<ValueNode, ValueNode> commitValueMap = valueEditorManager.getValueNodeCommitHelper().getCommitValues(oldChildValueNode, newChildValueNode, valueNodeToUnconstrainedTypeMap);
           
            for (final DataConstructorEditorPanel editorPanel : editorPanelList) {
                editorPanel.updateValueNode(commitValueMap);
            }

            // Replace the current value node with the value node of the active panel.
            ValueNode newValueNode = null;
            if (editorPanelList.size() == 1) {
                newValueNode = editorPanelList.get(0).getValueNode().copyValueNode();
            } else {
                newValueNode = focusChangeListener.getFocusedPanel().getValueNode().copyValueNode();
            }
View Full Code Here

        // Add an argument editor panel for each argument.       
        editorPanels = new ArgumentEditorPanel[size];
               
        for (int i = 0; i < size; i++) {
           
            ValueNode childValueNode = childValueNodes.get(i);
           
            ValueEntryPanel vep = new ValueEntryPanel(parentEditor.valueEditorHierarchyManager);
               
            vep.setContext(getValueEntryPanelContext(i));
            vep.setParentValueEditor(parentEditor);
View Full Code Here

        // Iterate over the argument panels and update their value nodes.
        for (int i = 0; i < editorPanels.length; i++) {
               
            ValueEntryPanel vep = editorPanels[i].getValueEntryPanel();

            ValueNode oldChildValueNode = vep.getOwnerValueNode();
            ValueNode newChildValueNode = commitValueMap.get(oldChildValueNode);

            if (newChildValueNode != null) {

                vep.changeOwnerValue(newChildValueNode);
                vep.validate();
View Full Code Here

       
        returnMap.put(valueNode, leastConstrainedType);

        for (int i = 0; i < editorPanels.length; i++) {

            ValueNode argValueNode = editorPanels[i].getValueEntryPanel().getOwnerValueNode();

            TypeExpr argType = TypeExpr.getComponentTypeExpr(leastConstrainedType, i, dataCons);

            returnMap.put(argValueNode, argType);
        }
View Full Code Here

    @Override
    protected void commitValue() {
        // If there is a selected file, then update the value, else keep old value.
        File file = fileNameChooser.getSelectedFile();
        if (file != null) {
            ValueNode returnVN = new FileNameValueNode(file.getPath(), getValueNode().getTypeExpr());
            replaceValueNode(returnVN, true);

            notifyValueCommitted();
        }
    }
View Full Code Here

    @Override
    protected void commitValue() {
        // Get the current value and if it's changed the replace our current value and commit
        Object selection = comboBox.getSelectedItem();
        if (selection instanceof ValueNode) {
            ValueNode newVN = (ValueNode)selection;
            if (newVN != getValueNode()) {
                replaceValueNode(newVN, false);
                super.commitValue();
            }
        } else {
View Full Code Here

       
        if (listEntry != null) {
       
            // Note: For TypeExpr which contains uninstantiated TypeVars, we must 'duplicate' them somehow.
            TypeExpr instanceTypeExpr = ((TypeExpr) listEntry.getData()).copyTypeExpr();
            ValueNode replacement = getOwnerValueNode().transmuteValueNode(valueEditorManager.getValueNodeBuilderHelper(), valueEditorManager.getValueNodeTransformer(), instanceTypeExpr);
   
            // Get the TypeVar that we are instantiating.
            replaceValueNode(replacement, true);

            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.