Ejemplo n.º 1
0
 private void setColors() {
   Scenario scenario =
       (Scenario) Applicazione.getInstance().getModello().getBean(Scenario.class.getName());
   for (int i = 0; i < chart.getData().size(); i++) {
     for (Node node : chart.lookupAll(".series" + i)) {
       node.getStyleClass().remove("default-color" + i);
       node.getStyleClass()
           .add("default-color" + mapColor.get(scenario.getToolsList().get(i).getName()));
     }
     int item = 0;
     for (Node node : chart.lookupAll(".chart-legend-item")) {
       if (node instanceof Label && ((Label) node).getGraphic() != null) {
         String color = mapColor.get(scenario.getToolsList().get(item).getName());
         if (color != null && !color.isEmpty()) {
           ((Label) node).getGraphic().getStyleClass().remove("default-color" + item);
           ((Label) node).getGraphic().getStyleClass().add("default-color" + color);
         }
       }
       item++;
     }
   }
 }
Ejemplo n.º 2
0
 private void createSeries(final XYChart chart) {
   // populating the series with data
   XYChart.Series series;
   Scenario scenario =
       (Scenario) Applicazione.getInstance().getModello().getBean(Scenario.class.getName());
   for (MappingTool tool : scenario.getToolsList()) {
     if (logger.isTraceEnabled()) logger.trace("Tool Scan : " + tool.getName());
     if (tool.getNumberExecutions() > 0) {
       series = new XYChart.Series();
       series.setName(tool.getName());
       if (!mapColor.containsKey(tool.getName())) {
         mapColor.put(tool.getName(), PropertiesLoader.loadColorName(tool.getName()));
         if (logger.isTraceEnabled())
           logger.trace(
               "map color put" + tool.getName() + " value " + mapColor.get(tool.getName()));
       }
       series.getData().add(new XYChart.Data(0, 0));
       List<MappingExecution> listExecution = new ArrayList<MappingExecution>();
       listExecution.addAll(tool.getExecutionsList());
       Collections.sort(listExecution);
       if (logger.isTraceEnabled()) logger.trace("Mapping executions: " + listExecution.size());
       for (MappingExecution mappingTask : listExecution) {
         int effort = 0;
         if (logger.isTraceEnabled()) logger.trace("Mapping: " + mappingTask);
         if (mappingTask.getEffortRecording() != null) {
           if (logger.isTraceEnabled())
             logger.trace("Updating effort:" + mappingTask.getEffortRecording());
           effort = mappingTask.getEffortRecording().getTotalInteraction();
         }
         series
             .getData()
             .add(new XYChart.Data(mappingTask.getQuality().getFmeasure() * 100, effort));
       }
       chart.getData().add(series);
     }
   }
   setColors();
   //        printNodes(chart, 0);
 }