public LegendEntry(PlotData2D data, int dataIndex) {
      javax.swing.ToolTipManager.sharedInstance().setDismissDelay(5000);
      m_plotData = data;
      m_dataIndex = dataIndex;
      //      this.setBackground(Color.black);
      /*      this.setPreferredSize(new Dimension(0, 20));
	      this.setMinimumSize(new Dimension(0, 20)); */

      if (m_plotData.m_useCustomColour) {
	this.addMouseListener(new MouseAdapter() {
	    public void mouseClicked(MouseEvent e) {
	      
	      if ((e.getModifiers() & e.BUTTON1_MASK) == e.BUTTON1_MASK) {
		Color tmp = JColorChooser.showDialog
		  (LegendPanel.this, "Select new Color", 
		   m_plotData.m_customColour);
		
		if (tmp != null) {
		  m_plotData.m_customColour = tmp;
		  m_legendText.setForeground(tmp);

		  if (m_Repainters.size() > 0) {
		    for (int i=0;i<m_Repainters.size();i++) {
		      ((Component)(m_Repainters.elementAt(i))).repaint();
		    }
		  }
		  LegendPanel.this.repaint();
		}
	      }
	    }
	  });
      }

      m_legendText = new JLabel(m_plotData.m_plotName);
      m_legendText.setToolTipText(m_plotData.getPlotNameHTML());
      if (m_plotData.m_useCustomColour) {
	m_legendText.setForeground(m_plotData.m_customColour);
      }
      this.setLayout(new BorderLayout());
      this.add(m_legendText, BorderLayout.CENTER);
      /*      GridBagLayout gb = new GridBagLayout();
      GridBagConstraints constraints = new GridBagConstraints();
      constraints.fill = GridBagConstraints.HORIZONTAL;
      constraints.gridx=0;constraints.gridy=0;constraints.weightx=5; */
      m_pointShape = new JPanel() {
	private static final long serialVersionUID = -7048435221580488238L;
	
	public void paintComponent(Graphics gx) {
	  super.paintComponent(gx);
	  if (!m_plotData.m_useCustomColour) {
	    gx.setColor(Color.black);
	  } else {
	    gx.setColor(m_plotData.m_customColour);
	  }
	  Plot2D.drawDataPoint(10,10,3,m_dataIndex,gx);
	}
      };
      //      m_pointShape.setBackground(Color.black);
      m_pointShape.setPreferredSize(new Dimension(20, 20));
      m_pointShape.setMinimumSize(new Dimension(20, 20));
      this.add(m_pointShape, BorderLayout.WEST);
    }