use of net.sourceforge.processdash.ProcessDashboard in project processdash by dtuma.
the class OpenDefectDialog method getDefectLog.
private DefectLogID getDefectLog(String path) {
DashHierarchy hier = getPSPProperties();
PropertyKey key = hier.findExistingKey(path);
if (key == null)
return null;
ProcessDashboard dash = getDash();
DefectLogID defectLog = hier.defectLog(key, dash.getDirectory());
if (defectLog == null)
return null;
if (Filter.matchesFilter(dash.getBrokenDataPaths(), defectLog.path.path()))
return null;
return defectLog;
}
use of net.sourceforge.processdash.ProcessDashboard in project processdash by dtuma.
the class DefectImportForm method importDefects.
private void importDefects(List defects) {
DashHierarchy hier = dashboardContext.getHierarchy();
PropertyKey defectLogKey = hier.findExistingKey(defectLogPath);
ProcessDashboard dashboard = (ProcessDashboard) dashboardContext;
String filename = hier.pget(defectLogKey).getDefectLog();
if (!StringUtils.hasValue(filename)) {
AbortImport.showError("Hierarchy_Changed", selectedPath);
return;
}
DefectLog defectLog = new DefectLog(dashboard.getDirectory() + filename, defectLogPath, dashboardContext.getData());
int addedCount = 0;
int updatedCount = 0;
int unchangedCount = 0;
for (Iterator i = defects.iterator(); i.hasNext(); ) {
Defect newDefect = (Defect) i.next();
Defect oldDefect = defectLog.getDefect(newDefect.number);
if (oldDefect == null) {
addedCount++;
defectLog.writeDefect(newDefect);
} else {
Defect originalDefect = (Defect) oldDefect.clone();
oldDefect.defect_type = merge(oldDefect.defect_type, newDefect.defect_type);
oldDefect.injected = merge(oldDefect.injected, newDefect.injected);
oldDefect.phase_injected = oldDefect.injected.legacyPhase;
oldDefect.removed = merge(oldDefect.removed, newDefect.removed);
oldDefect.phase_removed = oldDefect.removed.legacyPhase;
oldDefect.description = merge(oldDefect.description, newDefect.description);
oldDefect.fix_time = merge(oldDefect.fix_time, newDefect.fix_time);
oldDefect.fix_defect = merge(oldDefect.fix_defect, newDefect.fix_defect);
if (originalDefect.equals(oldDefect)) {
unchangedCount++;
} else {
updatedCount++;
defectLog.writeDefect(oldDefect);
}
}
}
if (addedCount == 0 && updatedCount == 0) {
JOptionPane.showMessageDialog(frame, resources.getStrings("Nothing_To_Do.Message"), resources.getString("Nothing_To_Do.Title"), JOptionPane.INFORMATION_MESSAGE);
} else if (addedCount < defects.size()) {
String title = resources.getString("Defects_Updated.Title");
Object[] message = new Object[4];
message[0] = resources.getStrings("Defects_Updated.Message");
message[1] = getUpdatedSegment("Added", addedCount);
message[2] = getUpdatedSegment("Unchanged", unchangedCount);
message[3] = getUpdatedSegment("Updated", updatedCount);
JOptionPane.showMessageDialog(frame, message, title, JOptionPane.INFORMATION_MESSAGE);
}
}
use of net.sourceforge.processdash.ProcessDashboard in project processdash by dtuma.
the class TimeLoggingSimulation method run.
private void run(long seed) throws Exception {
random = new Random(seed);
print("Seed is " + seed);
dataDir = createAndPopulateDataDir();
harness = new SimulationHarness(dataDir);
ProcessDashboard dashboard = harness.getDashboard();
dashboard.removeWindowListener(dashboard);
dashboard.addWindowListener(this);
robot = new Robot();
user = new RandomUserActivityGenerator();
user.start();
userMeta = new RandomUserMetaActivityGenerator();
userMeta.start();
}
use of net.sourceforge.processdash.ProcessDashboard in project processdash by dtuma.
the class EditExportMetricsFilePanel method buildMainPanelContents.
protected void buildMainPanelContents() {
String chooseFilePrompt = getString("Choose_File");
add(indentedComponent(2, new WrappingText(chooseFilePrompt)));
add(verticalSpace(1));
file = new FileChooser();
file.getDocument().addDocumentListener((DocumentListener) EventHandler.create(DocumentListener.class, this, "updateInstruction"));
add(indentedComponent(4, file));
add(verticalSpace(2));
String choosePathsPrompt = getString("Choose_Paths");
add(indentedComponent(2, new WrappingText(choosePathsPrompt)));
add(verticalSpace(1));
ProcessDashboard dashboard = ExportManager.getInstance().getProcessDashboard();
paths = new SelectableHierarchyTree(dashboard.getHierarchy(), instr.getPaths());
paths.addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
if (!e.getValueIsAdjusting())
updateInstruction();
}
});
JScrollPane scrollPane = new JScrollPane(paths);
scrollPane.setPreferredSize(new Dimension(999, 300));
add(indentedComponent(4, scrollPane));
if (fromManagePanel == false) {
add(verticalSpace(2));
String makeAutomaticPrompt = getString("Make_Automatic");
add(indentedComponent(2, new WrappingText(makeAutomaticPrompt)));
makeAutomatic = new ButtonGroup();
Box autoButtonBox = Box.createHorizontalBox();
autoButtonBox.add(createAutomaticButton("Yes"));
autoButtonBox.add(createAutomaticButton("No"));
add(indentedComponent(4, autoButtonBox));
}
add(verticalSpace(4));
error = new WrappingText("X");
error.setMinimumSize(error.getPreferredSize());
error.setText("");
error.setForeground(Color.red);
add(error);
}
Aggregations