Package com.cburch.logisim.tools

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


        } 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

 
  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

    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

    }
    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

      }
      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

    }
   
    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

    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

          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

          ((JLabel) ret).setIcon(new ToolIcon(tool));
          ((JLabel) ret).setToolTipText(tool.getDescription());
        }
      } else if (value instanceof Library) {
        if (ret instanceof JLabel) {
          Library lib = (Library) value;
          String text = lib.getDisplayName();
          if (lib.isDirty()) text += DIRTY_MARKER;
          ((JLabel) ret).setText(text);
        }
      }
      return ret;
    }
View Full Code Here

TOP

Related Classes of com.cburch.logisim.tools.Library

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.