Package com.cburch.logisim.file

Examples of com.cburch.logisim.file.FileStatistics$Count


    int simCode = runSimulation(circState, outputPins, haltPin, ttyFormat);
    System.exit(simCode);
  }
 
  private static void displayStatistics(LogisimFile file) {
    FileStatistics stats = FileStatistics.compute(file, file.getMainCircuit());
    FileStatistics.Count total = stats.getTotalWithSubcircuits();
    int maxName = 0;
    for (FileStatistics.Count count : stats.getCounts()) {
      int nameLength = count.getFactory().getDisplayName().length();
      if (nameLength > maxName) maxName = nameLength;
    }
    String fmt = "%" + countDigits(total.getUniqueCount()) + "d\t"
      + "%" + countDigits(total.getRecursiveCount()) + "d\t";
    String fmtNormal = fmt + "%-" + maxName + "s\t%s\n";
    for (FileStatistics.Count count : stats.getCounts()) {
      Library lib = count.getLibrary();
      String libName = lib == null ? "-" : lib.getDisplayName();
      System.out.printf(fmtNormal, //OK
          Integer.valueOf(count.getUniqueCount()),
          Integer.valueOf(count.getRecursiveCount()),
          count.getFactory().getDisplayName(), libName);
    }
    FileStatistics.Count totalWithout = stats.getTotalWithoutSubcircuits();
    System.out.printf(fmt + "%s\n", //OK
        Integer.valueOf(totalWithout.getUniqueCount()),
        Integer.valueOf(totalWithout.getRecursiveCount()),
        Strings.get("statsTotalWithout"));
    System.out.printf(fmt + "%s\n", //OK
View Full Code Here


import com.cburch.logisim.tools.Library;
import com.cburch.logisim.util.TableSorter;

public class StatisticsDialog extends JDialog implements ActionListener {
  public static void show(JFrame parent, LogisimFile file, Circuit circuit) {
    FileStatistics stats = FileStatistics.compute(file, circuit);
    StatisticsDialog dlog = new StatisticsDialog(parent,
        circuit.getName(), new StatisticsTableModel(stats));
    dlog.setVisible(true);
  }
View Full Code Here

        int simCode = runSimulation(circState, outputPins, haltPin, ttyFormat);
        System.exit(simCode);
    }

    private static void displayStatistics(LogisimFile file) {
        FileStatistics stats = FileStatistics.compute(file, file.getMainCircuit());
        FileStatistics.Count total = stats.getTotalWithSubcircuits();
        int maxName = 0;
        for (FileStatistics.Count count : stats.getCounts()) {
            int nameLength = count.getFactory().getDisplayName().length();
            if (nameLength > maxName) {
                maxName = nameLength;
            }

        }
        String fmt = "%" + countDigits(total.getUniqueCount()) + "d\t"
            + "%" + countDigits(total.getRecursiveCount()) + "d\t";
        String fmtNormal = fmt + "%-" + maxName + "s\t%s\n";
        for (FileStatistics.Count count : stats.getCounts()) {
            Library lib = count.getLibrary();
            String libName = lib == null ? "-" : lib.getDisplayName();
            //OK
            System.out.printf(fmtNormal,
                    Integer.valueOf(count.getUniqueCount()),
                    Integer.valueOf(count.getRecursiveCount()),
                    count.getFactory().getDisplayName(), libName);
        }
        FileStatistics.Count totalWithout = stats.getTotalWithoutSubcircuits();
        //OK
        System.out.printf(fmt + "%s\n",
                Integer.valueOf(totalWithout.getUniqueCount()),
                Integer.valueOf(totalWithout.getRecursiveCount()),
                getFromLocale("statsTotalWithout"));
View Full Code Here

import static com.cburch.logisim.util.LocaleString.*;

@SuppressWarnings("serial")
public class StatisticsDialog extends JDialog implements ActionListener {
    public static void show(JFrame parent, LogisimFile file, Circuit circuit) {
        FileStatistics stats = FileStatistics.compute(file, circuit);
        StatisticsDialog dlog = new StatisticsDialog(parent,
                circuit.getName(), new StatisticsTableModel(stats));
        dlog.setVisible(true);
    }
View Full Code Here

TOP

Related Classes of com.cburch.logisim.file.FileStatistics$Count

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.