Package com.cburch.logisim.circuit

Examples of com.cburch.logisim.circuit.CircuitMutation.execute()


        if (factory != null) {
          AttributeSet newAttrs = createAttributes(factory, comp.getAttributeSet());
          xn.add(factory.createComponent(comp.getLocation(), newAttrs));
        }
      }
      xn.execute();
    }
  }
 
  private static AttributeSet createAttributes(ComponentFactory factory, AttributeSet src) {
    AttributeSet dest = factory.createAttributeSet();
View Full Code Here


        compAttrs.setValue(attr, value);   
      }
    }
   
    if (!xn.isEmpty()) {
      CircuitTransactionResult result = xn.execute();
      xnReverse = result.getReverseTransaction();
    }
  }

  @Override
View Full Code Here

      sel.translateHelper(xn, dx, dy);
      if (replacements != null) {
        xn.replace(replacements);
      }

      CircuitTransactionResult result = xn.execute();
      xnReverse = result.getReverseTransaction();
    }

    @Override
    public void undo(Project proj) {
View Full Code Here

    } else {
      // add the circuit
      Circuit circuit = new Circuit(name);
      CircuitMutation xn = CircuitBuilder.build(circuit, model, twoInputs,
          useNands);
      xn.execute();
      dest.doAction(LogisimFileActions.addCircuit(circuit));
      dest.setCurrentCircuit(circuit);
    }
  }
}
View Full Code Here

      Circuit circuit = proj.getCurrentCircuit();
      CircuitMutation xn = new CircuitMutation(circuit);
      for (Component comp : drops) {
        sel.remove(xn, comp);
      }
      CircuitTransactionResult result = xn.execute();
      xnReverse = result.getReverseTransaction();
    }

    @Override
    public void undo(Project proj) {
View Full Code Here

    @Override
    public void doIt(Project proj) {
      Circuit circuit = proj.getCurrentCircuit();
      CircuitMutation xn = new CircuitMutation(circuit);
      sel.deleteAllHelper(xn);
      CircuitTransactionResult result = xn.execute();
      xnReverse = result.getReverseTransaction();
    }

    @Override
    public void undo(Project proj) {
View Full Code Here

    public void doIt(Project proj) {
      Circuit circuit = proj.getCurrentCircuit();
      CircuitMutation xn = new CircuitMutation(circuit);
      sel.duplicateHelper(xn);

      CircuitTransactionResult result = xn.execute();
      xnReverse = result.getReverseTransaction();
      after = SelectionSave.create(sel);
    }

    @Override
View Full Code Here

      CircuitMutation xn = new CircuitMutation(circuit);
      Collection<Component> comps = clip.getComponents();
      Collection<Component> toAdd = computeAdditions(comps);
      if (toAdd.size() > 0) {
        sel.pasteHelper(xn, toAdd);
        CircuitTransactionResult result = xn.execute();
        xnReverse = result.getReverseTransaction();
        after = SelectionSave.create(sel);
      } else {
        xnReverse = null;
      }
View Full Code Here

        } else {
            // add the circuit
            Circuit circuit = new Circuit(name);
            CircuitMutation xn = CircuitBuilder.build(circuit, model, twoInputs,
                    useNands);
            xn.execute();
            dest.doAction(LogisimFileActions.addCircuit(circuit));
            dest.setCurrentCircuit(circuit);
        }
    }
}
View Full Code Here

                if (factory != null) {
                    AttributeSet newAttrs = createAttributes(factory, comp.getAttributeSet());
                    xn.add(factory.createComponent(comp.getLocation(), newAttrs));
                }
            }
            xn.execute();
        }
    }

    private static AttributeSet createAttributes(ComponentFactory factory, AttributeSet src) {
        AttributeSet dest = factory.createAttributeSet();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.