Examples of Library


Examples of com.cburch.logisim.tools.Library

    Library findLibrary(String lib_name) throws XmlReaderException {
      if (lib_name == null || lib_name.equals("")) {
        return file;
      }

      Library ret = libs.get(lib_name);
      if (ret == null) {
        throw new XmlReaderException(StringUtil.format(
          Strings.get("libMissingError"), lib_name));
      } else {
        return ret;
View Full Code Here

Examples of com.cburch.logisim.tools.Library

      LogisimFile src = ProjectActions.createNewFile(proj);
      LogisimFile dst = proj.getLogisimFile();
     
      copyToolAttributes(src, dst);
      for (Library srcLib : src.getLibraries()) {
        Library dstLib = dst.getLibrary(srcLib.getName());
        if (dstLib == null) {
          String desc = src.getLoader().getDescriptor(srcLib);
          dstLib = dst.getLoader().loadLibrary(desc);
          proj.getLogisimFile().addLibrary(dstLib);
          if (libraries == null) libraries = new ArrayList<Library>();
View Full Code Here

Examples of com.cburch.logisim.tools.Library

        } else {
          return Strings.get("statsTotalWith");
        }
      case 1:
        if (row < countsLen) {
          Library lib = count.getLibrary();
          return lib == null ? "-" : lib.getDisplayName();
        } else {
          return "";
        }
      case 2: return Integer.valueOf(count.getSimpleCount());
      case 3: return Integer.valueOf(count.getUniqueCount());
View Full Code Here

Examples of com.cburch.logisim.tools.Library

 
  void setBase(Library value) {
    if (base instanceof LibraryEventSource) {
      ((LibraryEventSource) base).removeLibraryListener(myListener);
    }
    Library old = base;
    base = value;
    resolveChanges(old);
    if (base instanceof LibraryEventSource) {
      ((LibraryEventSource) base).addLibraryListener(myListener);
    }
View Full Code Here

Examples of com.cburch.logisim.tools.Library

    if (name == null || name.equals("")) {
      throw new XmlReaderException(Strings.get("compNameMissingError"));
    }

    String libName = elt.getAttribute("lib");
    Library lib = reader.findLibrary(libName);
    if (lib == null) {
      throw new XmlReaderException(Strings.get("compUnknownError", "no-lib"));
    }

    Tool tool = lib.getTool(name);
    if (tool == null || !(tool instanceof AddTool)) {
      if (libName == null || libName.equals("")) {
        throw new XmlReaderException(Strings.get("compUnknownError", name));
      } else {
        throw new XmlReaderException(Strings.get("compAbsentError", name, libName));
View Full Code Here

Examples of com.cburch.logisim.tools.Library

    }
    String type = desc.substring(0, sep);
    String name = desc.substring(sep + 1);

    if (type.equals("")) {
      Library ret = loader.getBuiltin().getLibrary(name);
      if (ret == null) {
        loader.showError(StringUtil.format(Strings.get("fileBuiltinMissingError"), name));
        return null;
      }
      return ret;
View Full Code Here

Examples of com.cburch.logisim.tools.Library

      }
      if (lib instanceof LoadedLibrary) {
        LoadedLibrary loadedLib = (LoadedLibrary) lib;
        if (loadedLib.getBase() instanceof LogisimFile) {
          LogisimFile loadedProj = (LogisimFile) loadedLib.getBase();
          Library ret = findReference(loadedProj, query);
          if (ret != null) return lib;
        }
      }
    }
    return null;
View Full Code Here

Examples of com.cburch.logisim.tools.Library

    }
   
    public void libraryChanged(LibraryEvent event) {
      int action = event.getAction();
      if (action == LibraryEvent.REMOVE_LIBRARY) {
        Library unloaded = (Library) event.getData();
        if (tool != null && unloaded.containsFromSource(tool)) {
          setTool(null);
        }
      } else if (action == LibraryEvent.REMOVE_TOOL) {
        Object data = event.getData();
        if (data instanceof AddTool) {
View Full Code Here

Examples of com.cburch.logisim.tools.Library

    chooser.setDialogTitle(Strings.get("loadLogisimDialogTitle"));
    chooser.setFileFilter(Loader.LOGISIM_FILTER);
    int check = chooser.showOpenDialog(proj.getFrame());
    if (check == JFileChooser.APPROVE_OPTION) {
      File f = chooser.getSelectedFile();
      Library lib = loader.loadLogisimLibrary(f);
      if (lib != null) {
        proj.doAction(LogisimFileActions.loadLibrary(lib));
      }
    }
  }
View Full Code Here

Examples of com.cburch.logisim.tools.Library

          JOptionPane.QUESTION_MESSAGE);
        // if user canceled selection, abort
        if (className == null) return;
      }

      Library lib = loader.loadJarLibrary(f, className);
      if (lib != null) {
        proj.doAction(LogisimFileActions.loadLibrary(lib));
      }
    }
  }
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.