Package com.cburch.logisim.circuit

Examples of com.cburch.logisim.circuit.ReplacementMap


    }
   
    public void circuitChanged(CircuitEvent event) {
      if (event.getAction() == CircuitEvent.TRANSACTION_DONE) {
        Circuit circuit = event.getCircuit();
        ReplacementMap repl = event.getResult().getReplacementMap(circuit);
        boolean change = false;
       
        ArrayList<Component> oldAnchored;
        oldAnchored = new ArrayList<Component>(getComponents());
        for (Component comp : oldAnchored) {
          Collection<Component> replacedBy = repl.get(comp);
          if (replacedBy != null) {
            change = true;
            selected.remove(comp);
            lifted.remove(comp);
            for (Component add : replacedBy) {
View Full Code Here


          }
        }
      }
    }
    if (bestResult == null) { // should only happen for no connections
      bestResult = new MoveResult(req, new ReplacementMap(), impossible, 0);
    } else {
      bestResult.addUnsatisfiedConnections(impossible);
    }
    return bestResult;
  }
View Full Code Here

      int dx, int dy, HashMap<ConnectionData,Set<Location>> pathLocs,
      HashMap<ConnectionData,List<SearchNode>> initNodes, long stopTime) {
    AvoidanceMap avoid = gesture.getFixedAvoidanceMap().cloneMap();
    avoid.markAll(gesture.getSelected(), dx, dy);

    ReplacementMap replacements = new ReplacementMap();
    ArrayList<ConnectionData> unconnected = new ArrayList<ConnectionData>();
    int totalDistance = 0;
    for (ConnectionData conn : connects) {
      if (ConnectorThread.isOverrideRequested()) {
        return null;
View Full Code Here

        }
      } catch (Throwable t) {
        t.printStackTrace();
        if (wasOverride) {
          MoveResult result = new MoveResult(req,
              new ReplacementMap(),
              req.getMoveGesture().getConnections(),
              0);
          req.getMoveGesture().notifyResult(req, result);
        }
      }
View Full Code Here

        } else if (proj.getSelection().hasConflictWhenMoved(dx, dy)) {
          canvas.setErrorMessage(Strings.getter("exclusiveError"));
        } else {
          boolean connect = shouldConnect(canvas, e.getModifiersEx());
          drawConnections = false;
          ReplacementMap repl;
          if (connect) {
            MoveGesture gesture = moveGesture;
            if (gesture == null) {
              gesture = new MoveGesture(new MoveRequestHandler(canvas),
                  canvas.getCircuit(), canvas.getSelection().getAnchoredComponents());
View Full Code Here

                }
            }
        }
        // should only happen for no connections
        if (bestResult == null) {
            bestResult = new MoveResult(req, new ReplacementMap(), impossible, 0);
        } else {
            bestResult.addUnsatisfiedConnections(impossible);
        }
        return bestResult;
    }
View Full Code Here

            int dx, int dy, HashMap<ConnectionData,Set<Location>> pathLocs,
            HashMap<ConnectionData,List<SearchNode>> initNodes, long stopTime) {
        AvoidanceMap avoid = gesture.getFixedAvoidanceMap().cloneMap();
        avoid.markAll(gesture.getSelected(), dx, dy);

        ReplacementMap replacements = new ReplacementMap();
        ArrayList<ConnectionData> unconnected = new ArrayList<ConnectionData>();
        int totalDistance = 0;
        for (ConnectionData conn : connects) {
            if (ConnectorThread.isOverrideRequested()) {
                return null;
View Full Code Here

                }
            } catch (Exception t) {
                t.printStackTrace();
                if (wasOverride) {
                    MoveResult result = new MoveResult(req,
                            new ReplacementMap(),
                            req.getMoveGesture().getConnections(),
                            0);
                    req.getMoveGesture().notifyResult(req, result);
                }
            }
View Full Code Here

        @Override
        public void circuitChanged(CircuitEvent event) {
            if (event.getAction() == CircuitEvent.TRANSACTION_DONE) {
                Circuit circuit = event.getCircuit();
                ReplacementMap repl = event.getResult().getReplacementMap(circuit);
                boolean change = false;

                ArrayList<Component> oldAnchored;
                oldAnchored = new ArrayList<Component>(getComponents());
                for (Component comp : oldAnchored) {
                    Collection<Component> replacedBy = repl.get(comp);
                    if (replacedBy != null) {
                        change = true;
                        selected.remove(comp);
                        lifted.remove(comp);
                        for (Component add : replacedBy) {
View Full Code Here

                } else if (proj.getSelection().hasConflictWhenMoved(dx, dy)) {
                    canvas.setErrorMessage(getFromLocale("exclusiveError"), dx, dy);
                } else {
                    boolean connect = shouldConnect(canvas, e.getModifiersEx());
                    drawConnections = false;
                    ReplacementMap repl;
                    if (connect) {
                        MoveGesture gesture = moveGesture;
                        if (gesture == null) {
                            gesture = new MoveGesture(new MoveRequestHandler(canvas),
                                    canvas.getCircuit(), canvas.getSelection().getAnchoredComponents());
View Full Code Here

TOP

Related Classes of com.cburch.logisim.circuit.ReplacementMap

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.