Package com.cburch.logisim.comp

Examples of com.cburch.logisim.comp.ComponentFactory.createComponent()


      Location loc = Location.create(e.getX(), e.getY());
      AttributeSet attrsCopy = (AttributeSet) attrs.clone();
      ComponentFactory source = getFactory();
      if (source == null) return;
      Component c = source.createComponent(loc, attrsCopy);
     
      if (circ.hasConflict(c)) {
        canvas.setErrorMessage(Strings.getter("exclusiveError"));
        return;
      }
View Full Code Here


      for (Component comp : toReplace) {
        xn.remove(comp);
        ComponentFactory factory = compMap.get(comp.getFactory());
        if (factory != null) {
          AttributeSet newAttrs = createAttributes(factory, comp.getAttributeSet());
          xn.add(factory.createComponent(comp.getLocation(), newAttrs));
        }
      }
      xn.execute();
    }
  }
View Full Code Here

    if (loc_str == null || loc_str.equals("")) {
      throw new XmlReaderException(Strings.get("compLocMissingError", source.getName()));
    } else {
      try {
        Location loc = Location.parse(loc_str);
        return source.createComponent(loc, attrs);
      } catch (NumberFormatException e) {
        throw new XmlReaderException(Strings.get("compLocInvalidError",
          source.getName(), loc_str));
      }
    }
View Full Code Here

    AttributeSet attrs = factory.createAttributeSet();
    attrs.setValue(StdAttr.FACING, Direction.WEST);
    attrs.setValue(Pin.ATTR_TYPE, Boolean.TRUE);
    attrs.setValue(StdAttr.LABEL, name);
    attrs.setValue(Pin.ATTR_LABEL_LOC, Direction.NORTH);
    result.add(factory.createComponent(loc, attrs));
  }
 
  //
  // placeInputs
  //
View Full Code Here

      attrs.setValue(StdAttr.FACING, Direction.EAST);
      attrs.setValue(Pin.ATTR_TYPE, Boolean.FALSE);
      attrs.setValue(Pin.ATTR_TRISTATE, Boolean.FALSE);
      attrs.setValue(StdAttr.LABEL, name);
      attrs.setValue(Pin.ATTR_LABEL_LOC, Direction.NORTH);
      result.add(factory.createComponent(loc, attrs));
     
      ArrayList<Location> spine = singleInput.ys;
      if (spine.size() > 0) {
        // create wire connecting pin to spine
        /* This should no longer matter - the wires will be repaired
View Full Code Here

            for (Component comp : toReplace) {
                xn.remove(comp);
                ComponentFactory factory = compMap.get(comp.getFactory());
                if (factory != null) {
                    AttributeSet newAttrs = createAttributes(factory, comp.getAttributeSet());
                    xn.add(factory.createComponent(comp.getLocation(), newAttrs));
                }
            }
            xn.execute();
        }
    }
View Full Code Here

        if (loc_str == null || loc_str.equals("")) {
            throw new XmlReaderException(getFromLocale("compLocMissingError", source.getName()));
        } else {
            try {
                Location loc = Location.parse(loc_str);
                return source.createComponent(loc, attrs);
            } catch (NumberFormatException e) {
                throw new XmlReaderException(getFromLocale("compLocInvalidError",
                    source.getName(), loc_str));
            }
        }
View Full Code Here

            ComponentFactory source = getFactory();
            if (source == null) {
                return;
            }

            Component c = source.createComponent(loc, attrsCopy);

            if (circ.hasConflict(c)) {
                canvas.setErrorMessage(getFromLocale("exclusiveError"), 0, 0);
                return;
            }
View Full Code Here

        AttributeSet attrs = factory.createAttributeSet();
        attrs.setValue(StdAttr.FACING, Direction.WEST);
        attrs.setValue(Pin.ATTR_TYPE, Boolean.TRUE);
        attrs.setValue(StdAttr.LABEL, name);
        attrs.setValue(Pin.ATTR_LABEL_LOC, Direction.NORTH);
        result.add(factory.createComponent(loc, attrs));
    }

    //
    // placeInputs
    //
View Full Code Here

            attrs.setValue(StdAttr.FACING, Direction.EAST);
            attrs.setValue(Pin.ATTR_TYPE, Boolean.FALSE);
            attrs.setValue(Pin.ATTR_TRISTATE, Boolean.FALSE);
            attrs.setValue(StdAttr.LABEL, name);
            attrs.setValue(Pin.ATTR_LABEL_LOC, Direction.NORTH);
            result.add(factory.createComponent(loc, attrs));

            ArrayList<Location> spine = singleInput.ys;
            if (spine.size() > 0) {
                // create wire connecting pin to spine
                /* This should no longer matter - the wires will be repaired
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.