Package com.cburch.logisim.file

Examples of com.cburch.logisim.file.LogisimFile


import com.cburch.logisim.proj.Project;

@SuppressWarnings("serial")
class CircuitJList extends JList<Circuit> {
    public CircuitJList(Project proj, boolean includeEmpty) {
        LogisimFile file = proj.getLogisimFile();
        Circuit current = proj.getCurrentCircuit();
        Vector<Circuit> options = new Vector<Circuit>();
        boolean currentFound = false;
        for (Circuit circ : file.getCircuits()) {
            if (!includeEmpty || circ.getBounds() != Bounds.EMPTY_BOUNDS) {
                if (circ == current) currentFound = true;
                options.add(circ);
            }
        }
View Full Code Here


            return this.getSelectedValuesList().toArray(new Library[]{});
        }
    }

    public static void doLoadBuiltinLibrary(Project proj) {
        LogisimFile file = proj.getLogisimFile();
        List<Library> baseBuilt = file.getLoader().getBuiltin().getLibraries();
        ArrayList<Library> builtins = new ArrayList<Library>(baseBuilt);
        builtins.removeAll(file.getLibraries());
        if (builtins.isEmpty()) {
            JOptionPane.showMessageDialog(proj.getFrame(),
                    getFromLocale("loadBuiltinNoneError"),
                    getFromLocale("loadBuiltinErrorTitle"),
                    JOptionPane.INFORMATION_MESSAGE);
View Full Code Here

            }
        }
    }

    public static void doUnloadLibraries(Project proj) {
        LogisimFile file = proj.getLogisimFile();
        ArrayList<Library> canUnload = new ArrayList<Library>();
        for (Library lib : file.getLibraries()) {
            String message = file.getUnloadLibraryMessage(lib);
            if (message == null) {
                canUnload.add(lib);
            }

        }
View Full Code Here

        }
    }

    @Override
    public void moveRequested(ProjectExplorerEvent event, AddTool dragged, AddTool target) {
        LogisimFile file = proj.getLogisimFile();
        int draggedIndex = file.getTools().indexOf(dragged);
        int targetIndex = file.getTools().indexOf(target);
        if (targetIndex > draggedIndex) {
            targetIndex++;
        }

        proj.doAction(LogisimFileActions.moveCircuit(dragged, targetIndex));
View Full Code Here

    private static HashMap<Component, Component> getReplacementMap(Project proj) {
        HashMap<Component, Component> replMap;
        replMap = new HashMap<Component, Component>();

        LogisimFile file = proj.getLogisimFile();
        ArrayList<Library> libs = new ArrayList<Library>();
        libs.add(file);
        libs.addAll(file.getLibraries());

        ArrayList<String> dropped = null;
        Clipboard clip = Clipboard.get();
        Collection<Component> comps = clip.getComponents();
        HashMap<ComponentFactory, ComponentFactory> factoryReplacements;
View Full Code Here

            addSeparator();
            add(main); main.addActionListener(this);
            add(remove); remove.addActionListener(this);

            boolean canChange = proj.getLogisimFile().contains(circuit);
            LogisimFile file = proj.getLogisimFile();
            if (circuit == proj.getCurrentCircuit()) {
                if (proj.getFrame().getEditorView().equals(Frame.EDIT_APPEARANCE)) {
                    editAppearance.setEnabled(false);
                } else {
                    editLayout.setEnabled(false);
                }
            }
            main.setEnabled(canChange && file.getMainCircuit() != circuit);
            remove.setEnabled(canChange && file.getCircuitCount() > 1
                    && proj.getDependencies().canRemove(circuit));
        }
View Full Code Here

TOP

Related Classes of com.cburch.logisim.file.LogisimFile

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.