use of net.sourceforge.processdash.data.SimpleData in project processdash by dtuma.
the class ProcessDashboard method getOwnerName.
public static String getOwnerName(DataContext data) {
SimpleData val = data.getSimpleValue("/Owner");
if (val == null)
return null;
String result = val.format();
String defaultVal = Resources.getDashBundle("ProcessDashboard").getString("Enter_your_name");
if (result.equals(defaultVal))
return null;
else
return result;
}
use of net.sourceforge.processdash.data.SimpleData 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());
}
use of net.sourceforge.processdash.data.SimpleData in project processdash by dtuma.
the class TaskScheduleChartSettings method getSettingsForTaskList.
/**
* Find a list of chart setting objects that apply to a particular task list.
*
* @param taskListID the ID of the task list.
* @param data the data repository
* @return a list of
*/
public static Map<String, TaskScheduleChartSettings> getSettingsForTaskList(String taskListID, DataRepository data) {
Map<String, TaskScheduleChartSettings> globalSettings = new HashMap();
Map<String, TaskScheduleChartSettings> taskListSettings = new HashMap();
String taskListPrefix = getTaskListPrefix(taskListID);
Iterator i = data.getKeys(SETTINGS_PREFIX, DataNameFilter.EXPLICIT_ONLY);
while (i.hasNext()) {
String dataName = (String) i.next();
Map dest;
if (dataName.startsWith(GLOBAL_SETTINGS_PREFIX))
dest = globalSettings;
else if (dataName.startsWith(taskListPrefix))
dest = taskListSettings;
else
continue;
SimpleData sd = data.getSimpleValue(dataName);
if (!(sd instanceof StringData))
continue;
try {
StringData str = (StringData) sd;
TaskScheduleChartSettings s = new TaskScheduleChartSettings(dataName, str.format());
dest.put(s.getSettingsIdentifier(), s);
} catch (Exception e) {
TaskScheduleChart.logger.warning("Could not load chart settings for " + dataName);
}
}
Map result = globalSettings;
result.putAll(taskListSettings);
return result;
}
use of net.sourceforge.processdash.data.SimpleData in project processdash by dtuma.
the class DefectTypeStandard method getNameOfMostPreferredStandard.
private static String getNameOfMostPreferredStandard() {
if (mostPreferredName != null)
return mostPreferredName;
String bestName = DEFAULT_NAME;
double bestPriority = -1;
for (String oneName : getDefinedStandards(data)) {
SimpleData sd = data.getSimpleValue(PRIORITY_PREFIX + oneName);
if (sd instanceof DoubleData) {
double onePriority = ((DoubleData) sd).getDouble();
if (onePriority > bestPriority) {
bestName = oneName;
bestPriority = onePriority;
}
}
}
mostPreferredName = bestName;
return mostPreferredName;
}
use of net.sourceforge.processdash.data.SimpleData in project processdash by dtuma.
the class TopDownBottomUpJanitor method getValueAt.
protected double getValueAt(DataContext data, PropertyKey node) {
String fullDataName = getDataName(node);
SimpleData sd = data.getSimpleValue(fullDataName);
if (sd instanceof DoubleData) {
DoubleData dd = (DoubleData) sd;
return dd.getDouble();
}
return 0;
}
Aggregations