Package com.cburch.logisim.tools

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


  public void selectionChanged(ProjectExplorer.Event event) {
    Object selected = event.getTarget();
    if (selected instanceof Tool) {
      if (selected instanceof AddTool) {
        AddTool addTool = (AddTool) selected;
        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(ProjectExplorer.Event event) {
    Object clicked = event.getTarget();
    if (clicked instanceof AddTool) {
      AddTool tool = (AddTool) clicked;
      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) proj.setTool(lastSelected);
View Full Code Here

  }

  public JPopupMenu menuRequested(ProjectExplorer.Event event) {
    Object clicked = event.getTarget();
    if (clicked instanceof AddTool) {
      AddTool tool = (AddTool) clicked;
      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

      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

            new EditTool(select, wiring),
            select,
            wiring,
            new TextTool(),
            new MenuTool(),
            new AddTool(Text.FACTORY),
        });
    }
View Full Code Here

public class Gates extends Library {
    private List<Tool> tools = null;

    public Gates() {
        tools = Arrays.asList(new Tool[] {
            new AddTool(NotGate.FACTORY),
            new AddTool(Buffer.FACTORY),
            new AddTool(AndGate.FACTORY),
            new AddTool(OrGate.FACTORY),
            new AddTool(NandGate.FACTORY),
            new AddTool(NorGate.FACTORY),
            new AddTool(XorGate.FACTORY),
            new AddTool(XnorGate.FACTORY),
            new AddTool(OddParityGate.FACTORY),
            new AddTool(EvenParityGate.FACTORY),
            new AddTool(ControlledBuffer.FACTORY_BUFFER),
            new AddTool(ControlledBuffer.FACTORY_INVERTER),
        });
    }
View Full Code Here

     * Logisim accesses first when it opens the JAR file: It looks for
     * a no-arguments constructor method of the user-designated class.
     */
    public Components() {
        tools = Arrays.asList(new AddTool[] {
                new AddTool(new GrayIncrementer()),
                new AddTool(new SimpleGrayCounter()),
                new AddTool(new GrayCounter()),
        });
    }
View Full Code Here

    public void addCircuit(Circuit circuit) {
        addCircuit(circuit, tools.size());
    }

    public void addCircuit(Circuit circuit, int index) {
        AddTool tool = new AddTool(circuit.getSubcircuitFactory());
        tools.add(index, tool);
        if (tools.size() == 1) {
            setMainCircuit(circuit);
        }
View Full Code Here

        int index = getCircuits().indexOf(circuit);
        if (index >= 0) {
            Tool circuitTool = tools.remove(index);

            if (main == circuit) {
                AddTool dflt_tool = tools.get(0);
                SubcircuitFactory factory = (SubcircuitFactory) dflt_tool.getFactory();
                setMainCircuit(factory.getSubcircuit());
            }
            fireEvent(LibraryEvent.REMOVE_TOOL, circuitTool);
        }
    }
View Full Code Here

        int oldIndex = tools.indexOf(tool);
        if (oldIndex < 0) {
            tools.add(index, tool);
            fireEvent(LibraryEvent.ADD_TOOL, tool);
        } else {
            AddTool value = tools.remove(oldIndex);
            tools.add(index, value);
            fireEvent(LibraryEvent.MOVE_TOOL, tool);
        }
    }
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.