Search in sources :

Example 1 with EVMetrics

use of net.sourceforge.processdash.ev.EVMetrics in project processdash by dtuma.

the class EVMetricsWidget method getWidgetComponent.

public Component getWidgetComponent(Map environment, Map parameters) {
    EVSchedule schedule = (EVSchedule) environment.get(EVSnippetEnvironment.SCHEDULE_KEY);
    EVMetrics m = schedule.getMetrics();
    JTable table = new JTable(m);
    table.removeColumn(table.getColumnModel().getColumn(3));
    JScrollPane scrollPane = new JScrollPane(table);
    scrollPane.setPreferredSize(new Dimension(100, 100));
    DescriptionPane descr = new DescriptionPane(m, table.getSelectionModel());
    Box result = Box.createVerticalBox();
    result.add(scrollPane);
    result.add(Box.createVerticalStrut(2));
    result.add(descr);
    return result;
}
Also used : JScrollPane(javax.swing.JScrollPane) EVSchedule(net.sourceforge.processdash.ev.EVSchedule) JTable(javax.swing.JTable) EVMetrics(net.sourceforge.processdash.ev.EVMetrics) Box(javax.swing.Box) Dimension(java.awt.Dimension)

Example 2 with EVMetrics

use of net.sourceforge.processdash.ev.EVMetrics in project processdash by dtuma.

the class EVReport method writeHTML.

/** Generate a page of HTML displaying the Task and Schedule templates,
     *  and including img tags referencing charts.
     */
public void writeHTML() throws IOException {
    isSnippet = (env.containsKey(SnippetEnvironment.SNIPPET_ID));
    String namespace = (isSnippet ? "$$$_" : "");
    String taskListDisplayName = EVTaskList.cleanupName(taskListName);
    String taskListHTML = HTMLUtils.escapeEntities(taskListDisplayName);
    String title = resources.format("Report.Title_FMT", taskListHTML);
    EVTaskFilter taskFilter = settings.getEffectiveFilter(evModel);
    EVSchedule s = getEvSchedule(taskFilter);
    EVTaskDataWriter taskDataWriter = getEffectiveTaskDataWriter();
    StringBuffer header = new StringBuffer(HEADER_HTML);
    StringUtils.findAndReplace(header, TITLE_VAR, title);
    if (taskFilter != null && isSnippet == false)
        header.append(FILTER_HEADER_HTML);
    out.print(header);
    out.print(taskDataWriter.getHeaderItems());
    out.print("</head><body>");
    out.print(isSnippet ? "<h2>" : "<h1>");
    out.print(title);
    if (!exportingToExcel()) {
        interpOutLink(SHOW_WEEK_LINK, EVReportSettings.PURPOSE_WEEK);
        interpOutLink(SHOW_MONTH_LINK, EVReportSettings.PURPOSE_WEEK);
        printAlternateViewLinks();
        interpOutLink(SHOW_CHARTS_LINK, EVReportSettings.PURPOSE_OTHER);
    }
    printCustomizationLink();
    out.print(isSnippet ? "</h2>" : "</h1>");
    if (!isSnippet)
        printFilterInfo(out, taskFilter, settings, isExporting(), exportingToExcel());
    if (!exportingToExcel()) {
        writeImageHtml(taskFilter != null);
        out.print("<div style='clear:both'></div>");
        writeCharts(evModel, s, taskFilter, settings.getBool(CUSTOMIZE_HIDE_NAMES), 350, 300, ChartListPurpose.ReportMain, null, null);
        out.print("<div style='clear:both'>&nbsp;</div>");
        out.print(HTMLTreeTableWriter.TREE_ICON_HEADER);
    }
    EVMetrics m = s.getMetrics();
    printScheduleErrors(out, m.getErrors());
    boolean hidePlan = settings.getBool(CUSTOMIZE_HIDE_PLAN_LINE);
    boolean hideReplan = settings.getBool(CUSTOMIZE_HIDE_REPLAN_LINE);
    boolean hideForecast = settings.getBool(CUSTOMIZE_HIDE_FORECAST_LINE);
    out.print("<table name='STATS'>");
    for (int i = 0; i < m.getRowCount(); i++) writeMetric(m, i, hidePlan, hideReplan, hideForecast);
    out.print("</table>");
    out.print("<h2><a name='" + namespace + "tasks'></a>" + getResource("TaskList.Title"));
    printTaskStyleLinks(taskDataWriter, namespace);
    out.print("</h2>\n");
    taskDataWriter.write(out, evModel, taskFilter, settings, namespace);
    out.print("<h2>" + getResource("Schedule.Title") + "</h2>\n");
    writeScheduleTable(s);
    if (isExporting() && !isSnippet)
        writeExportFooter(out);
    out.print("<p class='doNotPrint'>");
    if (!isSnippet && !exportingToExcel())
        interpOutLink(EXPORT_TEXT_LINK);
    if (!parameters.containsKey("EXPORT")) {
        if (taskFilter == null) {
            interpOutLink(EXPORT_CHARTS_LINK);
            interpOutLink(EXPORT_MSPROJ_LINK);
        }
        if (!isSnippet) {
            String link = EXPORT_ARCHIVE_LINK;
            String filenamePat = HTMLUtils.urlEncode(resources.getString("Report.Archive_Filename"));
            link = StringUtils.findAndReplace(link, "FILENAME", filenamePat);
            interpOutLink(link);
        }
    }
    out.print("</p>");
    out.print("</body></html>");
}
Also used : EVSchedule(net.sourceforge.processdash.ev.EVSchedule) EVTaskFilter(net.sourceforge.processdash.ev.EVTaskFilter) EVMetrics(net.sourceforge.processdash.ev.EVMetrics)

Aggregations

EVMetrics (net.sourceforge.processdash.ev.EVMetrics)2 EVSchedule (net.sourceforge.processdash.ev.EVSchedule)2 Dimension (java.awt.Dimension)1 Box (javax.swing.Box)1 JScrollPane (javax.swing.JScrollPane)1 JTable (javax.swing.JTable)1 EVTaskFilter (net.sourceforge.processdash.ev.EVTaskFilter)1