Package nodebox.node

Examples of nodebox.node.Node


        if (node.getOutputRange() == newRange.getObject()) return;
        nodeAttributesDialog.setNodeOutputRange((Port.Range) newRange.getObject());
    }

    private void setFunction() {
        Node node = getNode();
        String newValue = functionField.getText();
        if (node.getFunction() != null && node.getFunction().equals(newValue)) return;
        nodeAttributesDialog.setNodeFunction(newValue);
    }
View Full Code Here


        if (node.getFunction() != null && node.getFunction().equals(newValue)) return;
        nodeAttributesDialog.setNodeFunction(newValue);
    }

    private void setHandle() {
        Node node = getNode();
        String newValue = handleField.getText();
        if (node.getHandle() != null && node.getHandle().equals(newValue)) return;
        nodeAttributesDialog.setNodeHandle(newValue);
    }
View Full Code Here

        add(Box.createHorizontalStrut(30));
        setBorder(Theme.PARAMETER_ROW_BORDER);
    }

    public Port getPort() {
        Node activeNode = document.getActiveNode();
        if (activeNode == null)
            activeNode = document.getActiveNetwork();
        return activeNode.getInput(portName);
    }
View Full Code Here

    public NodeBoxDocument getDocument() {
        return document;
    }

    public Node getActiveNode() {
        Node activeNode = document.getActiveNode();
        return activeNode != null ? activeNode : document.getActiveNetwork();
    }
View Full Code Here

    /**
     * Fully rebuild the port view.
     */
    public void updateAll() {
        Node activeNode = getActiveNode();
        if (activeNode == null) {
            pane.setHeaderTitle("Ports");
        } else {
            pane.setHeaderTitle(activeNode.getName());
        }
        rebuildInterface();
        validate();
        repaint();
    }
View Full Code Here

    }

    private void rebuildInterface() {
        controlPanel.removeAll();
        controlMap.clear();
        Node node = getActiveNode();

        if (node == null) return;
        int rowIndex = 0;

        ArrayList<String> portNames = new ArrayList<String>();

        String activeNodePath = document.getActiveNodePath();

        for (Port p : node.getInputs())
            portNames.add(p.getName());

        for (String portName : portNames) {
            Port p = node.getInput(portName);
            // Hide ports with names that start with an underscore.
            if (portName.startsWith("_") || p.getName().startsWith("_")) continue;
            // Hide ports whose values can't be persisted.
            if (p.isCustomType()) continue;
            // Hide ports that accept lists.
View Full Code Here

        }
    }

    public Node nodeForFunction(String identifier) {
        Function function = getFunction(identifier);
        Node n = Node.ROOT.withFunction(identifier);
        for (Function.Argument arg : function.getArguments()) {
            n = n.withInputAdded(Port.portForType(arg.getName(), arg.getType()));
        }
        return n;
    }
View Full Code Here

    }

    public void setError(Throwable e) {
        StringBuilder sb = new StringBuilder("<html>&nbsp;&nbsp;&nbsp;");
        if (e instanceof NodeRenderException) {
            Node node = ((NodeRenderException) e).getNode();
            sb.append("<b>");
            sb.append(node.getName());
            sb.append(":</b> ");
        }
        sb.append("<u>");
        nodeRenderException = getRootCause(e);
        if (nodeRenderException instanceof PyException) {
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.