Package nodebox.function

Examples of nodebox.function.FunctionLibrary


    }

    private void addLibrary(String prefix, File libraryFile) {
        String relativePath = FileUtils.getRelativePath(libraryFile, document.getDocumentFile().getParentFile());
        FunctionLibrary library = FunctionLibrary.load(document.getDocumentFile(), prefix + ":" + relativePath);
        functionRepository = functionRepository.withLibraryAdded(library);
        reloadListModel();
        repositoryChanged = true;

    }
View Full Code Here


    }

    private void removeSelectedLibrary() {
        int index = functionLibraryList.getSelectedIndex();
        if (index >= 0) {
            FunctionLibrary library = (FunctionLibrary) functionLibraryListModel.getElementAt(index);
            functionRepository = functionRepository.withLibraryRemoved(library);
            reloadListModel();
            repositoryChanged = true;
        }
    }
View Full Code Here

            setPreferredSize(new Dimension(300, 40));
        }

        public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
            assert (value instanceof FunctionLibrary);
            FunctionLibrary library = (FunctionLibrary) value;
            setText(library.getSimpleIdentifier());
            setIcon(ICON_LANGUAGE_MAP.get(library.getLanguage()));
            if (isSelected) {
                setBackground(Theme.NODE_SELECTION_ACTIVE_BACKGROUND_COLOR);
            } else {
                setBackground(Theme.NODE_SELECTION_BACKGROUND_COLOR);
            }
View Full Code Here

        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

            if (eventType == XMLStreamConstants.START_ELEMENT) {
                String tagName = reader.getLocalName();
                if (tagName.equals("property")) {
                    parseProperty(reader, propertyMap);
                } else if (tagName.equals("link")) {
                    FunctionLibrary functionLibrary = parseLink(file, reader);
                    functionLibraries.add(functionLibrary);
                } else if (tagName.equals("device")) {
                    Device device = parseDevice(reader);
                    devices.add(device);
                } else if (tagName.equals("node")) {
View Full Code Here

TOP

Related Classes of nodebox.function.FunctionLibrary

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.