<commit_before>package gov.nih.nci.caintegrator.ui.graphing.legend;

import java.awt.Color;

import org.jfree.chart.LegendItemCollection;

public class LegendCreator {

	/**
	 * creates and HTML legend and returns a string of HTML
	 * @param lic - a jFreechart LegendItemCollection
	 * @return
	 */
	public static String buildLegend(LegendItemCollection lic, String legendTitle)	{
		String html = new String();
		Color p = null;
		html = "<fieldset style='display:table;width:600; border:1px solid gray; text-align:left; padding:5px;'>";
		html += "<legend>Legend: "+ legendTitle+"</legend>";
		
		for(int i=0; i<lic.getItemCount(); i++)	{
			p = (Color) lic.get(i).getFillPaint();
			//html += "<div style='margin:10px; padding:10px;border:1px solid red;'><label style='width:30px; height:10px; background-color: "+ c2hex(p)+"; border:1px solid black;'>&nbsp;&nbsp;&nbsp;</label><b style='color: "+ c2hex(p)+"'>"+lic.get(i).getLabel()+"</b></div>\n";	
			html += "<table style=\"display:inline;\"><tr><td style=\"width:10px; height:10px; background-color: "+ c2hex(p)+"; border:1px solid black;\">&nbsp;&nbsp;&nbsp;</td><td><a style=\"text-decoration:none\" href=\"javascript:alert(\'some annotation for:"+lic.get(i).getLabel()+"\');\"><b style=\"color: "+ c2hex(p)+"\">"+lic.get(i).getLabel()+"</b></a></td></tr></table>";
		}
		html += "</fieldset>";
		
		String js="";
		//js = "<script language=\"javascript\">document.getElementById('legend').innerHTML = \""+ html +" \"; </script>";
		return html;
	}
	
	/**<commit_msg>*** empty log message ***<commit_after>package gov.nih.nci.caintegrator.ui.graphing.legend;

import java.awt.Color;

import org.jfree.chart.LegendItemCollection;

public class LegendCreator {

	/**
	 * creates and HTML legend and returns a string of HTML
	 * @param lic - a jFreechart LegendItemCollection
	 * @return
	 */
	public static String buildLegend(LegendItemCollection lic, String legendTitle)	{
		
		//TODO: take annotation link as a string param
		
		String html = new String();
		Color p = null;
		html = "<fieldset style='display:table;width:600; border:1px solid gray; text-align:left; padding:5px;'>";
		html += "<legend>Legend: "+ legendTitle+"</legend>";
		
		for(int i=0; i<lic.getItemCount(); i++)	{
			p = (Color) lic.get(i).getFillPaint();
			//html += "<div style='margin:10px; padding:10px;border:1px solid red;'><label style='width:30px; height:10px; background-color: "+ c2hex(p)+"; border:1px solid black;'>&nbsp;&nbsp;&nbsp;</label><b style='color: "+ c2hex(p)+"'>"+lic.get(i).getLabel()+"</b></div>\n";	
			html += "<table style=\"display:inline;\"><tr><td style=\"width:10px; height:10px; background-color: "+ c2hex(p)+"; border:1px solid black;\">&nbsp;&nbsp;&nbsp;</td><td><a style=\"text-decoration:none\" href=\"javascript:alert(\'some annotation for:"+lic.get(i).getLabel()+"\');\"><b style=\"color: "+ c2hex(p)+"\">"+lic.get(i).getLabel()+"</b></a></td></tr></table>";
		}
		html += "</fieldset>";
		
		String js="";
		//js = "<script language=\"javascript\">document.getElementById('legend').innerHTML = \""+ html +" \"; </script>";
		return html;
	}
	
	/**
{'fraction_non_alphanumeric': 0.22282782943251042, 'fraction_numerical': 0.016030779095864058, 'mean_word_length': 5.081871345029239, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1373054', 'n_tokens_mistral': 1140, 'n_tokens_neox': 1045, 'n_words': 210}