Package nodebox.node

Examples of nodebox.node.Node


    }


    @Test
    public void testAdd() {
        Node addNode = Node.ROOT
                .withName("add")
                .withFunction("py-functions/add");
        Iterable<?> results = context.renderNode(addNode);
        assertResultsEqual(results, 0L);
    }
View Full Code Here


        assertResultsEqual(results, 0L);
    }

    @Test
    public void testAddWithArguments() {
        Node addNode = Node.ROOT
                .withName("add")
                .withFunction("py-functions/add")
                .withInputAdded(Port.intPort("v1", 1))
                .withInputAdded(Port.intPort("v2", 2))
                .withInputAdded(Port.intPort("v3", 3));
View Full Code Here

        assertResultsEqual(results, 6L);
    }

    @Test
    public void testMultiplyFloat() {
        Node multiplyNode = Node.ROOT
                .withName("multiply")
                .withFunction("py-functions/multiply")
                .withInputAdded(Port.floatPort("v1", 10))
                .withInputAdded(Port.floatPort("v2", 2));
        Iterable<?> results = context.renderNode(multiplyNode);
View Full Code Here

        assertResultsEqual(results, 20.0);
    }

    @Test
    public void testMultiplyString() {
        Node multiplyNode = Node.ROOT
                .withName("multiply")
                .withFunction("py-functions/multiply")
                .withInputAdded(Port.stringPort("v1", "spam"))
                .withInputAdded(Port.intPort("v2", 3));
        Iterable<?> results = context.renderNode(multiplyNode);
View Full Code Here

    private Node getNode() {
        return nodeAttributesDialog.getNode();
    }

    public void updateValues() {
        Node node = getNode();
        categoryField.setText(node.getCategory());
        descriptionField.setText(node.getDescription());
        imageField.setText(node.getImage());
        outputTypeField.setText(node.getOutputType());
        outputRangeBox.setSelectedItem(getHumanizedRange(node.getOutputRange()));
        functionField.setText(node.getFunction());
        handleField.setText(node.getHandle());
    }
View Full Code Here

        else if (e.getSource() == handleField)
            setHandle();
    }

    private void setCategory() {
        Node node = getNode();
        String newValue = categoryField.getText();
        if (node.getCategory() != null && node.getCategory().equals(newValue)) return;
        nodeAttributesDialog.setNodeCategory(newValue);
    }
View Full Code Here

        if (node.getCategory() != null && node.getCategory().equals(newValue)) return;
        nodeAttributesDialog.setNodeCategory(newValue);
    }

    private void setDescription() {
        Node node = getNode();
        String newValue = descriptionField.getText();
        if (node.getDescription() != null && node.getDescription().equals(newValue)) return;
        nodeAttributesDialog.setNodeDescription(newValue);
    }
View Full Code Here

        if (node.getDescription() != null && node.getDescription().equals(newValue)) return;
        nodeAttributesDialog.setNodeDescription(newValue);
    }

    private void setImage() {
        Node node = getNode();
        String newValue = imageField.getText();
        if (node.getImage() != null && node.getImage().equals(newValue)) return;
        nodeAttributesDialog.setNodeImage(newValue);
    }
View Full Code Here

        if (node.getImage() != null && node.getImage().equals(newValue)) return;
        nodeAttributesDialog.setNodeImage(newValue);
    }

    private void setOutputType() {
        Node node = getNode();
        String newValue = outputTypeField.getText().toLowerCase(Locale.US);
        if (node.getOutputType() != null && node.getOutputType().equals(newValue)) return;
        nodeAttributesDialog.setNodeOutputType(newValue);
    }
View Full Code Here

        if (node.getOutputType() != null && node.getOutputType().equals(newValue)) return;
        nodeAttributesDialog.setNodeOutputType(newValue);
    }

    private void setOutputRange() {
        Node node = getNode();
        HumanizedObject newRange = (HumanizedObject) outputRangeBox.getSelectedItem();
        if (node.getOutputRange() == newRange.getObject()) return;
        nodeAttributesDialog.setNodeOutputRange((Port.Range) newRange.getObject());
    }
View Full Code Here

TOP

Related Classes of nodebox.node.Node

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.