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;
}
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'> </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>");
}
Aggregations