]> SALOME platform Git repositories - tools/siman.git/commitdiff
Salome HOME
Title of the chart is set from input file.
authormka <mka@opencascade.com>
Thu, 14 Mar 2013 13:58:56 +0000 (13:58 +0000)
committermka <mka@opencascade.com>
Thu, 14 Mar 2013 13:58:56 +0000 (13:58 +0000)
Workspace/Siman-Common/src/org/splat/service/StudyServiceImpl.java

index a34f6d5952e4366f9c8d7b6efe1a2964ab82aae0..8db0d6c83ba5a6e2c197ab115f46869d9a19d468 100644 (file)
@@ -1187,6 +1187,7 @@ public class StudyServiceImpl implements StudyService {
                
                String axis1Name = "";
                String axis2Name = "";
+               String chartTitle = "";
                String resultPath = "";
                
                XYSeriesCollection dataset = new XYSeriesCollection();
@@ -1201,12 +1202,17 @@ public class StudyServiceImpl implements StudyService {
                        
                        resultPath = pathToFile.substring(0, pathToFile.indexOf("vault")) + "downloads" + File.separator + userName + File.separator + "ComparisonResult.pdf";
                        
-                       XYSeries series = new XYSeries("Study: " + docDTO.getStudyTitle() + " Scenario: " + docDTO.getScenarioTitle() + "Document: " + docDTO.getDocumentTitle());
+                       XYSeries series = new XYSeries("Study: " + docDTO.getStudyTitle() + " Scenario: " + docDTO.getScenarioTitle() + " Document: " + docDTO.getDocumentTitle());
                        
                        //read the file and get points information.
                        try {
                                Scanner input = new Scanner(compDocFile);
                                
+                               //get the title of the chart.
+                               if (input.hasNext()) {
+                                       chartTitle = input.nextLine();
+                               }
+                               
                                //get the name of the axis.
                                if (input.hasNext()) {
                                        String[] tokens = input.nextLine().split(",");
@@ -1254,7 +1260,7 @@ public class StudyServiceImpl implements StudyService {
                } //for
                
                JFreeChart chart = ChartFactory.createXYLineChart(
-                               "Comparision of Studies Results", // Title
+                               chartTitle, // Title
                                axis1Name, // x-axis Label
                                axis2Name, // y-axis Label
                                dataset, // Dataset