gt:         XYToolTipGenerator toolTipGenerator = new XYToolTipGenerator() {
context: /*
   * To change this template, choose Tools | Templates
   * and open the template in the editor.
   */
  package it.unibas.iqmeter.view;
  
  import it.unibas.iqmeter.Constant;
  import it.unibas.iqmeter.Utils;
  import it.unibas.iqmeter.controller.ActionExportImageChart;
  import it.unibas.iqmeter.controller.ActionSwitchChart;
  import it.unibas.iqmeter.model.MappingExecution;
  import it.unibas.iqmeter.model.MappingTool;
  import it.unibas.iqmeter.model.Scenario;
  import it.unibas.ping.framework.PannelloPing;
  import java.awt.BorderLayout;
  import java.awt.Color;
  import java.awt.event.MouseAdapter;
  import java.awt.event.MouseEvent;
  import java.util.Collections;
  import java.util.List;
  import javafx.application.Platform;
  import javafx.embed.swing.JFXPanel;
  import javafx.scene.chart.XYChart;
  
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
  import javax.swing.JMenuItem;
  import javax.swing.JPopupMenu;
  import org.jfree.chart.labels.ItemLabelPosition;
  import org.jfree.chart.labels.XYItemLabelGenerator;
  import org.jfree.chart.labels.XYToolTipGenerator;
  import org.jfree.chart.renderer.xy.StandardXYItemRenderer;
  import org.jfree.chart.renderer.xy.XYItemRenderer;
  import org.jfree.data.xy.XYDataset;
  import org.jfree.data.xy.XYSeries;
  import org.jfree.data.xy.XYSeriesCollection;
  
  /**
   *
   * @author Antonio Genovese
   */
  @SuppressWarnings("unchecked")
  public class PanelChart extends PannelloPing{
  
      private JFXPanel fxPanel = new JFXPanel();
      private Log logger = LogFactory.getLog(this.getClass());
      private XYChart chart;
      private FxEffortQualityChart fxChart;
      private Runnable threadFx;
  
      /**
       * Creates new form PanelChart
       */
      public PanelChart() {
      }
  
      public JFXPanel getFxPanel() {
          return fxPanel;
      }
  
      /**
       * This method is called from within the constructor to initialize the form.
       * WARNING: Do NOT modify this code. The content of this method is always
       * regenerated by the Form Editor.
       */
      // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
      private void initComponents() {
  
          setFont(getFont());
          setLayout(new java.awt.BorderLayout());
      }// </editor-fold>//GEN-END:initComponents
      // Variables declaration - do not modify//GEN-BEGIN:variables
      // End of variables declaration//GEN-END:variables
  
      @Override
      public void inizializza() {
          initComponents();
          this.setName(this.getClass().getName());
          fxChart = new FxEffortQualityChart(fxPanel);
          this.threadFx = new Runnable() {
  
              @Override
              public void run() {
                  fxChart.initFX();
              }
          };
          Platform.setImplicitExit(false);
      }
  
      public FxEffortQualityChart getFxChart() {
          return fxChart;
      }
  
  //JavaFx chart
      public void buildChart() {
          try {
              Platform.runLater(threadFx);
              logger.debug("Thread chart active: " + Thread.activeCount());
              this.add(fxPanel, BorderLayout.CENTER);
              this.createPopupMenu();
          } catch (UnsatisfiedLinkError ex) {
              logger.error("Error platform fx: " + ex.getLocalizedMessage());
          } catch (NullPointerException ne) {
              logger.error("Error platform fx: " + ne.getLocalizedMessage());
          }
      }
  
      public void refreshChart() {
          try {
              Platform.runLater(new Runnable() {
  
                  public void run() {
                      fxChart.refreshSeries();
                  }
              });
          } catch (UnsatisfiedLinkError ex) {
              logger.error("Error platform fx: " + ex.getLocalizedMessage());
          } catch (NullPointerException ne) {
              logger.error("Error platform fx: " + ne.getLocalizedMessage());
          }
      }
  
      //Jfreechart
  //    public void buildChart() {
  //        this.removeAll();
  //        this.setLayout(new BorderLayout());
  //
  //        // Add the series to your data set
  //        XYSeriesCollection dataset = this.createSeries();
  //
  //        // Generate the graph
  //        JFreeChart chart = ChartFactory.createXYStepAreaChart(
  //                null, null, null,
  //                //"Quality Graph", // Title
  //                // "Solution Quality (%)", // x-axis Label
  //                // "User Effort (bit)", // y-axis Label
  //                dataset, // Dataset
  //                PlotOrientation.VERTICAL, // Plot Orientation
  //                true, // Show Legend
  //                true, // Use tooltips
  //                false // Configure chart to generate URLs?
  //                );
  //
  //        //chart.setBackgroundPaint(Color.white);
  //        //Renderer Line
  //        XYPlot plot = chart.getXYPlot();
  //        chart.setBackgroundPaint(null);
  //        plot.setBackgroundPaint(null);
  //        plot.setDomainGridlinePaint(Color.BLACK);
  //        plot.setRangeGridlinePaint(Color.BLACK);
  //
  //        LegendTitle legend = chart.getLegend();
  //        legend.setPosition(RectangleEdge.TOP);
  //        //Remove Border
  //        plot.setOutlineVisible(false);
  //        plot.setRenderer(this.confRenderer());
  //        plot.setForegroundAlpha(0.8f);
  //
  //
  //        // change the auto tick unit selection to integer units only...
  //        final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
  //        if (dataset.getSeries().size() > 1) {
  //            rangeAxis.setLowerBound(-1);
  //        }
  //        rangeAxis.setAutoRangeIncludesZero(true);
  //        //rangeAxis.setLowerMargin(5);
  //        //rangeAxis.setLabel("bit");
  //        rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
  //
  //        // The domain axis is your x axis.
  //        NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();
  //        domainAxis.setLowerBound(-0.01);
  //        domainAxis.setUpperBound(1.03);
  //        domainAxis.setDefaultAutoRange(new Range(0, 1.0));
  //        domainAxis.setNumberFormatOverride(NumberFormat.getPercentInstance());
  //        ChartPanel cp = new ChartPanel(chart);
  //        //cp.setPreferredSize(new Dimension(300, 300));
  //        //this.setSize(1000, 400);
  //        this.add(cp, BorderLayout.CENTER);
  //        this.validate();
  //        this.setVisible(true);
  //
  //
  //    }
      //for JfreeChart
      private XYSeriesCollection createSeries() {
          XYSeries series;
          XYSeriesCollection dataset = new XYSeriesCollection();
          Scenario scenario = (Scenario) this.modello.getBean(Scenario.class.getName());
          if (scenario != null) {
              for (int i = 0; i < scenario.getToolsList().size(); i++) {
                  MappingTool tool = scenario.getTool(i);
                  series = new XYSeries(tool.getName());
                  List<MappingExecution> listExecution = tool.getExecutionsList();
                  if (listExecution.size() > 0) {
                      series.add(0, 0);
                  }
                  Collections.sort(listExecution);
                  for (MappingExecution mappingTask : listExecution) {
                      double bitEffort = 0;
                      if (mappingTask.getEffortGraph() != null) {
                          bitEffort = mappingTask.getEffortGraph().getBitEffort();
                      }
                      series.add((mappingTask.getQuality().getFmeasure()), bitEffort);
                  }
                  dataset.addSeries(series);
              }
          }
  
          return dataset;
  
      }
  
      //for jfreechart
      private XYItemRenderer confRenderer() {
          // label for the points
          ItemLabelPosition itmPosition = new ItemLabelPosition();
          XYItemLabelGenerator generator = new XYItemLabelGenerator() {
  
              public String generateLabel(XYDataset xyd, int i, int i1) {
                  if (i1 == 0) {
                      return "";
                  }
                  return "#" + (i1);
              }
          };
  
          //Generate Tooltip
  