Package nodebox.function

Examples of nodebox.function.FunctionRepository


        } catch (OutdatedLibraryException e) {
            UpgradeResult result = NodeLibraryUpgrades.upgrade(inFile);
            // The file is used here as the base name for finding relative libraries.
            library = result.getLibrary(inFile, systemRepository);
        }
        FunctionRepository functionRepository = FunctionRepository.combine(systemRepository.getFunctionRepository(), library.getFunctionRepository());
        library.getRoot();
        NodeContext ctx = new NodeContext(library, functionRepository);
        List<?> result = ctx.renderNode(library.getRoot());
        Rect bounds = library.getBounds();
        BufferedImage img = new BufferedImage(
View Full Code Here


     * The node libraries are traversed every time.
     *
     * @return the combined FunctionRepository.
     */
    public FunctionRepository getFunctionRepository() {
        FunctionRepository allFunctions = FunctionRepository.of();
        for (NodeLibrary library: getLibraries()) {
            allFunctions = FunctionRepository.combine(allFunctions, library.getFunctionRepository());
        }
        return allFunctions;
    }
View Full Code Here

     */
    @Test
    public void testRelativeImport() {
        File relativeImportFile = new File("src/test/files/relative-import.ndbx");
        NodeLibrary originalLibrary = NodeLibrary.load(relativeImportFile, NodeRepository.of());
        FunctionRepository repository = originalLibrary.getFunctionRepository();
        assertTrue(repository.hasLibrary("relative"));
        assertTrue(repository.hasFunction("relative/concat"));
        NodeLibrary library = NodeLibrary.load("test", originalLibrary.toXml(), NodeRepository.of());
        FunctionLibrary relativeLibrary = library.getFunctionRepository().getLibrary("relative");
        assertEquals("python:src/test/files/relative.py", relativeLibrary.getLink(new File(userDir, "test.ndbx")));
        assertEquals("python:relative.py", relativeLibrary.getLink(relativeImportFile));
    }
View Full Code Here

        d.setTaskCount(toValue - fromValue + 1);
        d.setVisible(true);
        exportDelegate.progressDialog = d;

        final NodeLibrary exportLibrary = getNodeLibrary();
        final FunctionRepository exportFunctionRepository = getFunctionRepository();
        final Node exportNetwork = library.getRoot();
        final Viewer viewer = new Viewer();

        final JFrame frame = new JFrame();
        frame.setLayout(new BorderLayout());
View Full Code Here

    }

    public void showCodeLibraries() {
        CodeLibrariesDialog dialog = new CodeLibrariesDialog(this, getNodeLibrary().getFunctionRepository());
        dialog.setVisible(true);
        FunctionRepository functionRepository = dialog.getFunctionRepository();
        if (functionRepository != null) {
            addEdit("Change function repository");
            controller.setFunctionRepository(functionRepository);
            invalidateFunctionRepository = true;
            requestRender();
View Full Code Here

TOP

Related Classes of nodebox.function.FunctionRepository

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.