use of net.sourceforge.processdash.data.ListData in project processdash by dtuma.
the class DefectAnalysisPage method writePhasePieArgs.
private void writePhasePieArgs(String titleKey, String dataElem) {
out.println("for=.");
out.println("colorScheme=byPhase");
out.println("skipRowHdr=true");
out.print("title=");
out.println(resources.getString(titleKey));
ListData allPhases = getProcessList("Phase_List");
for (int i = 0; i < allPhases.size(); i++) {
String num = Integer.toString(i + 1);
String phaseName = (String) allPhases.get(i);
String displayName = Translator.translate(phaseName);
out.println("h" + num + "=" + displayName);
out.println("d" + num + "=" + phaseName + "/" + dataElem);
}
}
use of net.sourceforge.processdash.data.ListData in project processdash by dtuma.
the class PlanAnalysisPage method writeHTML.
protected void writeHTML() throws IOException {
writeHTMLHeader("Plan.Title");
// get information about the current process
ListData overheadPhases = getProcessList("Overhead_Phase_List");
ListData failurePhases = getProcessList("Failure_Phase_List");
// write the size charts
if (metricIsDefined("SIZE_METRIC_NAME")) {
writeChartHTML(LINE_CHART, SIZE_CHART);
writeChartHTML(LINE_CHART, SIZE_ERR_CHART);
}
// write the total time charts
writeChartHTML(LINE_CHART, TIME_CHART);
writeChartHTML(LINE_CHART, TIME_ERR_CHART);
// write overhead time charts
for (int i = 0; i < overheadPhases.size(); i++) writeChartHTML(LINE_CHART, PCT_TIME_CHART, fmtArg("phase", overheadPhases.get(i)));
if (overheadPhases.size() > 1)
writeChartHTML(LINE_CHART, PCT_OVERHEAD_TIME_CHART);
// write failure time charts
for (int i = 0; i < failurePhases.size(); i++) writeChartHTML(LINE_CHART, PCT_TIME_CHART, fmtArg("phase", failurePhases.get(i)));
if (failurePhases.size() > 1)
writeChartHTML(LINE_CHART, PCT_FAILURE_TIME_CHART);
// write time in phase chart
writeChartHTML(PIE_CHART, PHASE_TIME_CHART);
out.write("</body></html>\n");
}
use of net.sourceforge.processdash.data.ListData in project processdash by dtuma.
the class ProcessDashboard method registerHierarchyDataElement.
private void registerHierarchyDataElement() {
ListData propItem = new ListData();
propItem.add(props);
propItem.add(String.valueOf(hierChangeCount++));
data.putValue(DashHierarchy.DATA_REPOSITORY_NAME, propItem);
}
use of net.sourceforge.processdash.data.ListData in project processdash by dtuma.
the class TaskScheduleChartSettings method savePreferredChartOrdering.
/**
* In some settings, the user is given an option of selecting a subset of
* charts and arranging them in a preferred ordering. This method will
* save that preferred ordering for a given task list.
*/
public static void savePreferredChartOrdering(String taskListID, List<String> chartIds, DataRepository data) {
// When more than one person opens a particular dataset, someone may
// have a older version of the charts (or may not have the charting
// add-on installed at all). In that case, the person with fewer
// charts may save a list that is incomplete (does not contain all of
// the available chart IDs). Look through the previous version of our
// saved setting, find any items that are missing from the new list,
// and insert them into the new list in our best guess of the right
// order. Note that we can't reliably infer the ordering intent of a
// user who isn't working with a full set of charts. But fortunately,
// if the user with missing charts makes no changes to the order, the
// algorithm below will effectively retain the previous ordering
// without changes.
List<String> newChartIds = new ArrayList<String>(chartIds);
List<String> oldOrder = getPreferredChartOrdering(taskListID, data);
int insertPos = 0;
for (String oneId : oldOrder) {
int pos = newChartIds.indexOf(oneId);
if (pos == -1) {
newChartIds.add(insertPos++, oneId);
} else {
insertPos = pos + 1;
}
}
// Now that we have constructed the list, save it to the repository.
ListData l = new ListData();
for (String id : newChartIds) l.add(id);
data.putValue(SETTINGS_PREFIX + taskListID + CHART_ORDERING_SETTING, l);
}
use of net.sourceforge.processdash.data.ListData in project processdash by dtuma.
the class TaskScheduleChartSettings method getPreferredChartOrdering.
/**
* In some settings, the user is given an option of selecting a subset of
* charts and arranging them in a preferred ordering. This method will
* retrieve that preferred ordering for a given task list.
*/
public static List<String> getPreferredChartOrdering(String taskListID, DataRepository data) {
SimpleData sd = data.getSimpleValue(SETTINGS_PREFIX + taskListID + CHART_ORDERING_SETTING);
if (sd == null)
sd = data.getSimpleValue(SETTINGS_PREFIX + GLOBAL_QUALIFIER + CHART_ORDERING_SETTING);
ListData l = ListData.asListData(sd);
return (l == null ? Collections.EMPTY_LIST : l.asList());
}
Aggregations