use of org.eclipse.titanium.error.ConsoleErrorHandler in project titan.EclipsePlug-ins by eclipse.
the class SaveModuleNet method exportInformationForProject.
@Override
protected void exportInformationForProject(final String[] args, final IProject project, final IProgressMonitor monitor) {
final ErrorHandler errorHandler = new ConsoleErrorHandler();
final ModuleGraphGenerator generator = new ModuleGraphGenerator(project, errorHandler);
try {
generator.generateGraph();
String clusterName = "";
for (int i = 1; i < args.length; ++i) {
if (args[i].startsWith("-c")) {
clusterName = args[i].substring(2);
}
}
if (clusterName.isEmpty()) {
graph = generator.getGraph();
} else {
final BaseCluster clusterer = new ClustererBuilder().setAlgorithm(clusterName).setGraph(generator.getGraph()).setProject(project).build();
clusterer.run(monitor, false);
graph = clusterer.getGraph();
}
final String fileName = args[0] + project.getName() + ".net";
GraphHandler.saveGraphToPajek(graph, fileName);
errorHandler.reportInformation("The graphs have been successfully saved. See results at " + new File(fileName).getAbsolutePath());
} catch (Exception e) {
errorHandler.reportException("Error while exporting", e);
}
}
use of org.eclipse.titanium.error.ConsoleErrorHandler in project titan.EclipsePlug-ins by eclipse.
the class SonarDataExporter method exportComponentDot.
private void exportComponentDot(final URI exportDir) {
final URI filePath = URIUtil.append(exportDir, "component_graph.dot");
final ErrorHandler errorHandler = new ConsoleErrorHandler();
final GraphGenerator generator = new ComponentGraphGenerator(project, errorHandler);
try {
generator.generateGraph();
GraphHandler.saveGraphToDot(generator.getGraph(), filePath.getPath(), project.getName());
} catch (Exception e) {
errorHandler.reportException("Error while exporting the component graph", e);
}
}
use of org.eclipse.titanium.error.ConsoleErrorHandler in project titan.EclipsePlug-ins by eclipse.
the class SonarDataExporter method exportModuleDot.
private void exportModuleDot(final URI exportDir) {
final URI filePath = URIUtil.append(exportDir, "module_graph.dot");
final ErrorHandler errorHandler = new ConsoleErrorHandler();
final GraphGenerator generator = new ModuleGraphGenerator(project, errorHandler);
try {
generator.generateGraph();
GraphHandler.saveGraphToDot(generator.getGraph(), filePath.getPath(), project.getName());
} catch (Exception e) {
errorHandler.reportException("Error while exporting the module graph", e);
}
}
Aggregations