use of net.sourceforge.processdash.data.DateData in project processdash by dtuma.
the class TimingMetricsRecorderTest method assertStartTime.
private void assertStartTime(String path, Date s) {
String dataName = path + "/Started";
SimpleData d = data.getSimpleValue(dataName);
if (d == null && s == null)
return;
assertTrue(d instanceof DateData);
DateData w = (DateData) d;
assertEquals(s, w.getValue());
}
use of net.sourceforge.processdash.data.DateData in project processdash by dtuma.
the class CompletionButton method actionPerformed.
public void actionPerformed(ActionEvent e) {
parent.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
if (isSelected()) {
parent.getData().userPutValue(dataName, new DateData());
if (selectNextTask() == false) {
// stop the timer if it is running.
parent.pauseTimer();
update();
}
} else {
parent.getData().userPutValue(dataName, null);
setToolTipText(resources.getString("Completion_Button_Tooltip"));
}
parent.setCursor(null);
}
use of net.sourceforge.processdash.data.DateData in project processdash by dtuma.
the class TaskTimeLoggingErrorWatcher method checkForCompletedTask.
private void checkForCompletedTask() {
// is this completion checker disabled? If so, do nothing.
if (isCompletionCheckingDisabled())
return;
// if we don't have an active path, do nothing.
String taskPath = activeTaskModel.getPath();
if (taskPath == null)
return;
// Check to see if the current task or any of its ancestors
// have been marked complete.
StringBuffer effectivePath = new StringBuffer(taskPath);
Object completionDate = data.getInheritableValue(effectivePath, "Completed");
if (completionDate instanceof DateData) {
DateData dd = (DateData) completionDate;
// if the user hasn't already given us the OK to log time
// to this path, display a message.
String completedPath = effectivePath.toString();
if (pathsToIgnore.contains(completedPath) == false)
showCompletedTaskTimeLoggingAlert(completedPath, dd.getValue());
}
}
use of net.sourceforge.processdash.data.DateData in project processdash by dtuma.
the class AbstractSyncWorker method markLeafComplete.
public void markLeafComplete(String path) {
if (completionPermissions == null || completionPermissions.contains(getOriginalPath(path))) {
String completionDataName = dataName(path, "Completed");
if (getSimpleValue(completionDataName) != null)
return;
SimpleData actualTime = getSimpleValue(dataName(path, "Time"));
if (actualTime instanceof NumberData) {
double time = ((NumberData) actualTime).getDouble();
DoubleData estimatedTime = new DoubleData(time, true);
doPutValue(dataName(path, "Estimated Time"), estimatedTime);
doPutValue(dataName(path, syncDataName("Estimated Time")), estimatedTime);
}
DateData now = new DateData();
doPutValue(completionDataName, now);
doPutValue(syncDataName(completionDataName), now);
nodesCompleted.add(path);
}
}
use of net.sourceforge.processdash.data.DateData in project processdash by dtuma.
the class DefaultDataExportFilter method processMaxDate.
private void processMaxDate(ExportedDataValue v) {
String name = v.getName();
if (name.endsWith("/Started") || name.endsWith("/Completed")) {
SimpleData value = v.getSimpleValue();
if (value instanceof DateData) {
Date thisDate = ((DateData) value).getValue();
maxDate = DateUtils.maxDate(maxDate, thisDate);
}
}
}
Aggregations