Examples of MetricsCalculator


Examples of org.woped.metrics.metricsCalculation.MetricsCalculator

   * creates the statistics with the individual components and adds there to the panel
   */
  private void addComponents() {

    // instance for the calculation of the values
    MetricsCalculator request = new MetricsCalculator(editor);

    // main container for the statistic
    JPanel statistics = new JPanel(new GridLayout(0, 2));

    // header label
    JLabel netStatisticLabel = new JLabel(
        Messages.getString(PREFIX_QUALANALYSIS + "NetStatistics"));
    netStatisticLabel.setFont(HEADER_FONT);
    netStatisticLabel
        .setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));

    this.add(netStatisticLabel, BorderLayout.NORTH);

    // places

    ClickLabel clickLabel = new ClickLabel(
        Messages.getString(PREFIX_QUALANALYSIS + "NumPlaces") + ":",
        qualanalysisService.getPlaces().iterator(), editor);
    clickLabel.setFont(ITEMS_FONT);
    statistics.add(clickLabel);

    JLabel count = new JLabel(String.valueOf(qualanalysisService
        .getPlaces().size()), JLabel.RIGHT);
    count.setFont(ITEMS_FONT);
    statistics.add(count);

    // transitions

    clickLabel = new ClickLabel(Messages.getString(PREFIX_QUALANALYSIS
        + "NumTransitions")
        + ":", qualanalysisService.getTransitions().iterator(), editor);
    clickLabel.setFont(ITEMS_FONT);
    statistics.add(clickLabel);

    count = new JLabel((int) request.calculateT() + "", JLabel.RIGHT);
    count.setFont(ITEMS_FONT);
    statistics.add(count);

    // operators

    clickLabel = new ClickLabel(SUB_POINT
        + Messages.getString(PREFIX_QUALANALYSIS + "NumOperators")
        + ":", qualanalysisService.getOperators().iterator(), editor);
    clickLabel.setFont(ITEMS_FONT);
    statistics.add(clickLabel);

    count = new JLabel(String.valueOf(qualanalysisService.getOperators()
        .size()), JLabel.RIGHT);
    count.setFont(ITEMS_FONT);
    statistics.add(count);

    // subprocesses

    clickLabel = new ClickLabel(SUB_POINT
        + Messages.getString(PREFIX_QUALANALYSIS + "NumSubprocesses")
        + ":", qualanalysisService.getSubprocesses().iterator(), editor);
    clickLabel.setFont(ITEMS_FONT);
    statistics.add(clickLabel);

    count = new JLabel(String.valueOf(qualanalysisService.getSubprocesses()
        .size()), JLabel.RIGHT);
    count.setFont(ITEMS_FONT);
    statistics.add(count);

    // arcs

    JLabel arcLabel = new JLabel(Messages.getString(PREFIX_QUALANALYSIS
        + "NumArcs")
        + ":");
    arcLabel.setFont(ITEMS_FONT);
    statistics.add(arcLabel);

    count = new JLabel((int) request.calculateA() + "", JLabel.RIGHT);
    count.setFont(ITEMS_FONT);
    statistics.add(count);

    this.add(statistics, BorderLayout.CENTER);

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.