Package com.cburch.logisim.comp

Examples of com.cburch.logisim.comp.ComponentFactory


        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


        HashMap<ComponentFactory, ComponentFactory> factoryReplacements;
        factoryReplacements = new HashMap<ComponentFactory, ComponentFactory>();
        for (Component comp : comps) {
            if (comp instanceof Wire) continue;

            ComponentFactory compFactory = comp.getFactory();
            ComponentFactory copyFactory = findComponentFactory(compFactory, libs, false);
            if (factoryReplacements.containsKey(compFactory)) {
                copyFactory = factoryReplacements.get(compFactory);
            } else if (copyFactory == null) {
                ComponentFactory candidate = findComponentFactory(compFactory, libs, true);
                if (candidate == null) {
                    if (dropped == null) {
                        dropped = new ArrayList<String>();
                    }
                    dropped.add(compFactory.getDisplayName());
View Full Code Here

        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()
                                && !(fact instanceof SubcircuitFactory)) {
                            return fact;
                        }
                    }
                }
View Full Code Here

        boolean changed = false;
        for (Map.Entry<Integer,Tool> entry : map.entrySet()) {
            Integer key = entry.getKey();
            Tool tool = entry.getValue();
            if (tool instanceof AddTool) {
                ComponentFactory factory = ((AddTool) tool).getFactory();
                if (toolMap.containsKey(factory)) {
                    changed = true;
                    Tool newTool = toolMap.get(factory);
                    if (newTool == null) {
                        map.remove(key);
View Full Code Here

    }

    AttributeSet getBase() {
        AttributeSet ret = baseAttrs;
        if (ret == null) {
            ComponentFactory fact = factory;
            if (fact == null) {
                fact = desc.getFactory(descBase);
                factory = fact;
            }
            if (fact == null) {
                ret = AttributeSets.EMPTY;
            } else {
                ret = fact.createAttributeSet();
                ret.addAttributeListener(this);
            }
            baseAttrs = ret;
        }
        return ret;
View Full Code Here

        HashMap<Component, KeyConfigurator> handlers = keyHandlers;
        if (handlers == null) {
            handlers = new HashMap<Component, KeyConfigurator>();
            Selection sel = canvas.getSelection();
            for (Component comp : sel.getComponents()) {
                ComponentFactory factory = comp.getFactory();
                AttributeSet attrs = comp.getAttributeSet();
                Object handler = factory.getFeature(KeyConfigurator.class, attrs);
                if (handler != null) {
                    KeyConfigurator base = (KeyConfigurator) handler;
                    handlers.put(comp, base.clone());
                }
            }
View Full Code Here

TOP

Related Classes of com.cburch.logisim.comp.ComponentFactory

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.