Search in sources :

Example 11 with DateData

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());
}
Also used : DateData(net.sourceforge.processdash.data.DateData) SimpleData(net.sourceforge.processdash.data.SimpleData)

Example 12 with DateData

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);
}
Also used : DateData(net.sourceforge.processdash.data.DateData)

Example 13 with DateData

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());
    }
}
Also used : DateData(net.sourceforge.processdash.data.DateData)

Example 14 with DateData

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);
    }
}
Also used : DateData(net.sourceforge.processdash.data.DateData) NumberData(net.sourceforge.processdash.data.NumberData) SimpleData(net.sourceforge.processdash.data.SimpleData) DoubleData(net.sourceforge.processdash.data.DoubleData)

Example 15 with DateData

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);
        }
    }
}
Also used : DateData(net.sourceforge.processdash.data.DateData) SimpleData(net.sourceforge.processdash.data.SimpleData) Date(java.util.Date)

Aggregations

DateData (net.sourceforge.processdash.data.DateData)31 SimpleData (net.sourceforge.processdash.data.SimpleData)10 Date (java.util.Date)6 Iterator (java.util.Iterator)3 SaveableData (net.sourceforge.processdash.data.SaveableData)3 DataContext (net.sourceforge.processdash.data.DataContext)2 DoubleData (net.sourceforge.processdash.data.DoubleData)2 ListData (net.sourceforge.processdash.data.ListData)2 EscapeString (net.sourceforge.processdash.util.EscapeString)2 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 ParseException (java.text.ParseException)1 ArrayList (java.util.ArrayList)1 ConcurrentModificationException (java.util.ConcurrentModificationException)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 UUID (java.util.UUID)1 PatternSyntaxException (java.util.regex.PatternSyntaxException)1 MalformedData (net.sourceforge.processdash.data.MalformedData)1 MalformedValueException (net.sourceforge.processdash.data.MalformedValueException)1