Package com.cburch.logisim.comp

Examples of com.cburch.logisim.comp.EndData


    int y = origin.getY() + parms.getEnd0Y();
    int dx = parms.getEndToEndDeltaX();
    int dy = parms.getEndToEndDeltaY();
   
    EndData[] ends = new EndData[fanout + 1];
    ends[0] = new EndData(origin, BitWidth.create(bit_end.length), EndData.INPUT_OUTPUT);
    for (int i = 0; i < fanout; i++) {
      ends[i + 1] = new EndData(Location.create(x, y),
          BitWidth.create(end_width[i + 1]), EndData.INPUT_OUTPUT);
      x += dx;
      y += dy;
    }
    wire_data = new CircuitWires.SplitterData(fanout);
View Full Code Here


    }

    @Override
    protected void run(CircuitMutator mutator) {
      for (Location loc : toRemove.keySet()) {
        EndData removed = toRemove.get(loc);
        EndData replaced = toAdd.remove(loc);
        if (replaced == null) {
          wires.remove(comp, removed);
        } else if (!replaced.equals(removed)) {
          wires.replace(comp, removed, replaced);
        }
      }
      for (EndData end : toAdd.values()) {
        wires.add(comp, end);
View Full Code Here

          if (end != null) {
            map.put(end.getLocation(), end);
          }
        }
      } else if (val instanceof EndData) {
        EndData end = (EndData) val;
        map.put(end.getLocation(), end);
      }
      return map;
    }
View Full Code Here

    ArrayList<EndData> endsChangedOld = null;
    ArrayList<EndData> endsChangedNew = null;
    Iterator<Port> pit = ports.iterator();
    for (int i = 0; pit.hasNext() || i < esOldLength; i++) {
      Port p = pit.hasNext() ? pit.next() : null;
      EndData oldEnd = i < esOldLength ? esOld[i] : null;
      EndData newEnd = p == null ? null : p.toEnd(loc, attrs);
      if (oldEnd == null || !oldEnd.equals(newEnd)) {
        if (newEnd != null) es[i] = newEnd;
        if (endsChangedOld == null) {
          endsChangedOld = new ArrayList<EndData>();
          endsChangedNew = new ArrayList<EndData>();
View Full Code Here

    return new EndList();
  }

  public EndData getEnd(int index) {
    Location loc = getEndLocation(index);
    return new EndData(loc, BitWidth.UNKNOWN,
        EndData.INPUT_OUTPUT);
  }
View Full Code Here

  }
 
  public EndData toEnd(Location loc, AttributeSet attrs) {
    Location pt = loc.translate(dx, dy);
    if (widthFixed != null) {
      return new EndData(pt, widthFixed, type, exclude);
    } else {
      Object val = attrs.getValue(widthAttr);
      if (!(val instanceof BitWidth)) {
        throw new IllegalArgumentException("Width attribute not set");
      }
      return new EndData(pt, (BitWidth) val, type, exclude);
    }
  }
View Full Code Here

  public <E> E getAttributeValue(Attribute<E> attr) {
    return component.getAttributeSet().getValue(attr);
  }
 
  public Value getPort(int portIndex) {
    EndData data = component.getEnd(portIndex);
    return circuitState.getValue(data.getLocation());
  }
View Full Code Here

    Location loc = component.getEnd(index).getLocation();
    return circ.isConnected(loc, component);
  }
 
  public void setPort(int portIndex, Value value, int delay) {
    EndData end = component.getEnd(portIndex);
    circuitState.setValue(end.getLocation(), value, component, delay);
  }
View Full Code Here

        }

        @Override
        protected void run(CircuitMutator mutator) {
            for (Location loc : toRemove.keySet()) {
                EndData removed = toRemove.get(loc);
                EndData replaced = toAdd.remove(loc);
                if (replaced == null) {
                    wires.remove(comp, removed);
                } else if (!replaced.equals(removed)) {
                    wires.replace(comp, removed, replaced);
                }
            }
            for (EndData end : toAdd.values()) {
                wires.add(comp, end);
View Full Code Here

                    if (end != null) {
                        map.put(end.getLocation(), end);
                    }
                }
            } else if (val instanceof EndData) {
                EndData end = (EndData) val;
                map.put(end.getLocation(), end);
            }
            return map;
        }
View Full Code Here

TOP

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

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.