Package com.cburch.logisim.tools

Examples of com.cburch.logisim.tools.Library


            LogisimFile src = ProjectActions.createNewFile(proj);
            LogisimFile dst = proj.getLogisimFile();

            copyToolAttributes(src, dst);
            for (Library srcLib : src.getLibraries()) {
                Library dstLib = dst.getLibrary(srcLib.getName());
                if (dstLib == null) {
                    String desc = src.getLoader().getDescriptor(srcLib);
                    dstLib = dst.getLoader().loadLibrary(desc);
                    proj.getLogisimFile().addLibrary(dstLib);
                    if (libraries == null) {
View Full Code Here


    void setBase(Library value) {
        if (base instanceof LibraryEventSource) {
            ((LibraryEventSource) base).removeLibraryListener(myListener);
        }
        Library old = base;
        base = value;
        resolveChanges(old);
        if (base instanceof LibraryEventSource) {
            ((LibraryEventSource) base).addLibraryListener(myListener);
        }
View Full Code Here

        if (name == null || name.equals("")) {
            throw new XmlReaderException(getFromLocale("compNameMissingError"));
        }

        String libName = elt.getAttribute("lib");
        Library lib = reader.findLibrary(libName);
        if (lib == null) {
            throw new XmlReaderException(getFromLocale("compUnknownError", "no-lib"));
        }

        Tool tool = lib.getTool(name);
        if (tool == null || !(tool instanceof AddTool)) {
            if (libName == null || libName.equals("")) {
                throw new XmlReaderException(getFromLocale("compUnknownError", name));
            } else {
                throw new XmlReaderException(getFromLocale("compAbsentError", name, libName));
View Full Code Here

        }
        String type = desc.substring(0, sep);
        String name = desc.substring(sep + 1);

        if (type.equals("")) {
            Library ret = loader.getBuiltin().getLibrary(name);
            if (ret == null) {
                loader.showError(getFromLocale("fileBuiltinMissingError", name));
                return null;
            }
            return ret;
View Full Code Here

            }
            if (lib instanceof LoadedLibrary) {
                LoadedLibrary loadedLib = (LoadedLibrary) lib;
                if (loadedLib.getBase() instanceof LogisimFile) {
                    LogisimFile loadedProj = (LogisimFile) loadedLib.getBase();
                    Library ret = findReference(loadedProj, query);
                    if (ret != null) {
                        return lib;
                    }

                }
View Full Code Here

        }
        String fmt = "%" + countDigits(total.getUniqueCount()) + "d\t"
            + "%" + countDigits(total.getRecursiveCount()) + "d\t";
        String fmtNormal = fmt + "%-" + maxName + "s\t%s\n";
        for (FileStatistics.Count count : stats.getCounts()) {
            Library lib = count.getLibrary();
            String libName = lib == null ? "-" : lib.getDisplayName();
            //OK
            System.out.printf(fmtNormal,
                    Integer.valueOf(count.getUniqueCount()),
                    Integer.valueOf(count.getRecursiveCount()),
                    count.getFactory().getDisplayName(), libName);
View Full Code Here

                    ((JLabel) ret).setIcon(new ToolIcon(tool));
                    ((JLabel) ret).setToolTipText(tool.getDescription());
                }
            } else if (value instanceof ProjectExplorerLibraryNode) {
                ProjectExplorerLibraryNode libNode = (ProjectExplorerLibraryNode) value;
                Library lib = libNode.getValue();
                if (ret instanceof JLabel) {
                    String text = lib.getDisplayName();
                    if (lib.isDirty()) {
                        text += DIRTY_MARKER;
                    }

                    ((JLabel) ret).setText(text);
                }
View Full Code Here

            }
        }
    }

    private void buildChildren() {
        Library lib = getValue();
        if (lib != null) {
            buildChildren(new ProjectExplorerToolNode(getModel(), null), lib.getTools(), 0);
            buildChildren(new ProjectExplorerLibraryNode(getModel(), null), lib.getLibraries(), lib.getTools().size());
        }
    }
View Full Code Here

        @Override
        public void libraryChanged(LibraryEvent event) {
            int action = event.getAction();
            if (action == LibraryEvent.REMOVE_LIBRARY) {
                Library unloaded = (Library) event.getData();
                if (tool != null && unloaded.containsFromSource(tool)) {
                    setTool(null);
                }
            } else if (action == LibraryEvent.REMOVE_TOOL) {
                Object data = event.getData();
                if (data instanceof AddTool) {
View Full Code Here

                } else {
                    return getFromLocale("statsTotalWith");
                }
            case 1:
                if (row < countsLen) {
                    Library lib = count.getLibrary();
                    return lib == null ? "-" : lib.getDisplayName();
                } else {
                    return "";
                }
            case 2: return Integer.valueOf(count.getSimpleCount());
            case 3: return Integer.valueOf(count.getUniqueCount());
View Full Code Here

TOP

Related Classes of com.cburch.logisim.tools.Library

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.