use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class TimeLoggingSimulation method getPathFor.
private int[] getPathFor(String path) {
DashHierarchy hier = harness.getDashboard().getHierarchy();
for (int a = 0; a < 3; a++) {
PropertyKey aKey = hier.getChildKey(PropertyKey.ROOT, a);
for (int b = 0; b < 3; b++) {
PropertyKey bKey = hier.getChildKey(aKey, b);
for (int c = 0; c < 3; c++) {
PropertyKey cKey = hier.getChildKey(bKey, c);
if (path.equals(cKey.path()))
return new int[] { a, b, c };
}
}
}
new Exception("no node found for path " + path).printStackTrace();
System.exit(0);
// unreachable
return null;
}
use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class TimeLoggingSimulation method checkValues.
private boolean checkValues() {
boolean foundErr = false;
boolean loggingModelIsTiming = !getTimeLoggingModel().isPaused();
if (loggingModelIsTiming != isTiming) {
printErr("We disagree with the logging model on whether or not the timer is running.");
foundErr = true;
}
DashHierarchy hier = harness.getDashboard().getHierarchy();
for (int a = 0; a < 3; a++) {
PropertyKey aKey = hier.getChildKey(PropertyKey.ROOT, a);
for (int b = 0; b < 3; b++) {
PropertyKey bKey = hier.getChildKey(aKey, b);
for (int c = 0; c < 3; c++) {
PropertyKey cKey = hier.getChildKey(bKey, c);
if (!checkTimeData(cKey.path(), expectedTimes[a][b][c]))
foundErr = true;
}
}
}
if (foundErr)
printErr("data check complete");
return !foundErr;
}
use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class EVTask method addChildrenFromHierarchy.
/** Attempt to find children in the hierarchy, and add them to our
* list of children.
* @return true if any children were found and added.
*/
protected boolean addChildrenFromHierarchy(String fullName, PropertyKey key, DataRepository data, DashHierarchy hierarchy, Listener listener) {
boolean addedChild = false;
if (key == null)
// make an attempt to lookup the name in the hierarchy.
key = hierarchy.findExistingKey(fullName);
if (key != null) {
int numKids = hierarchy.getNumChildren(key);
for (int i = 0; i < numKids; i++) {
PropertyKey child = hierarchy.getChildKey(key, i);
children.add(new EVTask(this, taskListName, child.name(), child.path(), child, data, hierarchy, listener));
addedChild = true;
}
}
return addedChild;
}
use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class TaskCommenterButton method setCommentTooltipAndConflict.
// Navigate through the task hierarchy from the currentNode to the top. If any
// conflicting comments are found, "taskInConflict" and "conflictingCommentAuthor"
// will be set accordingly.
private void setCommentTooltipAndConflict(PropertyKey currentNode) {
Map<String, HierarchyNote> notes = HierarchyNoteManager.getNotesForPath(context.getDataRepository(), currentNode.path());
if (notes != null) {
if (deepestComment == null) {
HierarchyNote note = notes.get(HierarchyNoteManager.NOTE_KEY);
if (note != null)
deepestComment = note.getAsHTML() + getBylineHTML(note);
}
if (notes.get(HierarchyNoteManager.NOTE_CONFLICT_KEY) != null) {
commentConflictPresent = true;
taskInConflict = currentNode;
conflictingCommentAuthor = notes.get(HierarchyNoteManager.NOTE_CONFLICT_KEY).getAuthor();
}
}
PropertyKey parent = currentNode.getParent();
if (parent != null)
setCommentTooltipAndConflict(parent);
}
use of net.sourceforge.processdash.hier.PropertyKey in project processdash by dtuma.
the class TaskCommenterButton method actionPerformed.
public void actionPerformed(ActionEvent e) {
PropertyKey phaseToShow = (commentConflictPresent) ? taskInConflict : context.getCurrentPhase();
HierarchyNoteEditorDialog.showGlobalNoteEditor(context, phaseToShow);
}
Aggregations