use of net.sourceforge.processdash.hier.Prop in project processdash by dtuma.
the class HierarchyEditor method moveUpIsLegal.
private boolean moveUpIsLegal(PropertyKey key) {
Prop prop = useProps.pget(key);
if (!isMoveable(prop.getStatus()))
return false;
PropertyKey parentKey = key.getParent();
Prop parentProp = useProps.pget(parentKey);
int pos = -1;
for (int i = parentProp.getNumChildren(); i-- > 0; ) if (key.equals(parentProp.getChild(pos = i)))
break;
if (pos < 1)
return false;
PropertyKey siblingKey = parentProp.getChild(pos - 1);
Prop siblingProp = useProps.pget(siblingKey);
return isMoveable(siblingProp.getStatus());
}
use of net.sourceforge.processdash.hier.Prop in project processdash by dtuma.
the class ExternalResourceArchiverXMLv1 method getTeamProcessIDsInUse.
/** Get the IDs of all team processes in use by this dashboard dataset */
private Set<String> getTeamProcessIDsInUse() {
Set<String> templateIDs = getTeamProcessIDs();
Set<String> result = new HashSet<String>();
DashHierarchy hier = dashboardContext.getHierarchy();
for (Iterator i = hier.values().iterator(); i.hasNext(); ) {
Prop prop = (Prop) i.next();
String oneID = prop.getID();
if (oneID != null && oneID.endsWith("Root")) {
int slashPos = oneID.indexOf('/');
if (slashPos != -1) {
String oneProcessID = oneID.substring(0, slashPos);
if (templateIDs.contains(oneProcessID))
result.add(oneProcessID);
}
}
}
return result;
}
use of net.sourceforge.processdash.hier.Prop in project processdash by dtuma.
the class DefectLogEditor method reload.
protected void reload() {
PropertyKey pKey;
Prop prop;
DefectLog dl;
String defLogName;
Defect[] defects;
defectLogs.clear();
Enumeration pKeys = useProps.keys();
while (pKeys.hasMoreElements()) {
pKey = (PropertyKey) pKeys.nextElement();
prop = useProps.pget(pKey);
defLogName = prop.getDefectLog();
if (defLogName != null && defLogName.length() != 0) {
dl = new DefectLog(dashboard.getDirectory() + defLogName, pKey.path(), data);
defects = dl.readDefects();
defectLogs.put(pKey, new DefectListID(pKey, dl, defects));
}
}
}
use of net.sourceforge.processdash.hier.Prop in project processdash by dtuma.
the class DefectLogEditor method hasDefLog.
private boolean hasDefLog(PropertyKey phase) {
if (phase == null)
return false;
Prop prop = useProps.pget(phase);
String defLogName = prop.getDefectLog();
return (defLogName != null && defLogName.length() > 0);
}
use of net.sourceforge.processdash.hier.Prop in project processdash by dtuma.
the class DefectAnalyzer method run.
/** Perform some analysis task on all the defects under a given node
* in the hierarchy.
*
* @param props The PSPProperties object to be walked.
* @param pKey The PropertyKey of the node in the hierarchy where the
* analysis should start.
* @param includeChildren if true, the node and all its children will be
* analyzed; if false, only the node itself will be visited.
* @param t An analysis task to perform. Every defect encountered will
* be passed to the task, in turn.
*/
public static void run(DashHierarchy props, PropertyKey pKey, boolean includeChildren, Task t) {
Prop prop = props.pget(pKey);
String path = pKey.path();
String defLogName = prop.getDefectLog();
// If this node has a defect log,
if (defLogName != null && defLogName.length() != 0) {
DefectLog dl = new DefectLog(dataDirectory + defLogName, path, null);
// read all the defects in that log, and
Defect[] defects = dl.readDefects();
for (int d = 0; d < defects.length; d++) if (// pass them to the analyzer task.
defects[d] != null)
t.analyze(path, defects[d]);
}
// recursively analyze all the children of this node.
if (includeChildren)
for (int i = 0; i < prop.getNumChildren(); i++) run(props, prop.getChild(i), includeChildren, t);
}
Aggregations