Package com.cburch.logisim.tools

Examples of com.cburch.logisim.tools.AddTool$MyAttributeListener


    //
    public static LogisimFile createNew(Loader loader) {
        LogisimFile ret = new LogisimFile(loader);
        ret.main = new Circuit("main");
        // The name will be changed in LogisimPreferences
        ret.tools.add(new AddTool(ret.main.getSubcircuitFactory()));
        return ret;
    }
View Full Code Here


    public void selectionChanged(ProjectExplorerEvent event) {
        Object selected = event.getTarget();
        if (selected instanceof ProjectExplorerToolNode) {
            Tool tool = ((ProjectExplorerToolNode) selected).getValue();
            if (tool instanceof AddTool) {
                AddTool addTool = (AddTool) tool;
                ComponentFactory source = addTool.getFactory();
                if (source instanceof SubcircuitFactory) {
                    SubcircuitFactory circFact = (SubcircuitFactory) source;
                    Circuit circ = circFact.getSubcircuit();
                    if (proj.getCurrentCircuit() == circ) {
                        AttrTableModel m = new AttrTableCircuitModel(proj, circ);
View Full Code Here

    public void doubleClicked(ProjectExplorerEvent event) {
        Object clicked = event.getTarget();
        if (clicked instanceof ProjectExplorerToolNode) {
            Tool baseTool = ((ProjectExplorerToolNode) clicked).getValue();
            if (baseTool instanceof AddTool) {
                AddTool tool = (AddTool) baseTool;
                ComponentFactory source = tool.getFactory();
                if (source instanceof SubcircuitFactory) {
                    SubcircuitFactory circFact = (SubcircuitFactory) source;
                    proj.setCurrentCircuit(circFact.getSubcircuit());
                    proj.getFrame().setEditorView(Frame.EDIT_LAYOUT);
                    if (lastSelected != null) {
View Full Code Here

    public JPopupMenu menuRequested(ProjectExplorerEvent event) {
        Object clicked = event.getTarget();
        if (clicked instanceof ProjectExplorerToolNode) {
            Tool baseTool = ((ProjectExplorerToolNode) clicked).getValue();
            if (baseTool instanceof AddTool) {
                AddTool tool = (AddTool) baseTool;
                ComponentFactory source = tool.getFactory();
                if (source instanceof SubcircuitFactory) {
                    Circuit circ = ((SubcircuitFactory) source).getSubcircuit();
                    return Popups.forCircuit(proj, tool, circ);
                } else {
                    return null;
View Full Code Here

            }
        }
    }

    public static void doMoveCircuit(Project proj, Circuit cur, int delta) {
        AddTool tool = proj.getLogisimFile().getAddTool(cur);
        if (tool != null) {
            int oldPos = proj.getLogisimFile().getCircuits().indexOf(cur);
            int newPos = oldPos + delta;
            int toolsCount = proj.getLogisimFile().getTools().size();
            if (newPos >= 0 && newPos < toolsCount) {
View Full Code Here

            ArrayList<Library> libs, boolean acceptNameMatch) {
        String name = factory.getName();
        for (Library lib : libs) {
            for (Tool tool : lib.getTools()) {
                if (tool instanceof AddTool) {
                    AddTool addTool = (AddTool) tool;
                    if (name.equals(addTool.getName())) {
                        ComponentFactory fact = addTool.getFactory(true);
                        if (acceptNameMatch) {
                            return fact;
                        } else if (fact == factory) {
                            return fact;
                        } else if (fact.getClass() == factory.getClass()
View Full Code Here

TOP

Related Classes of com.cburch.logisim.tools.AddTool$MyAttributeListener

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.