1 28 package net.sf.jasperreports.charts.util; 29 30 import java.io.Serializable ; 31 import java.text.AttributedString ; 32 import java.util.Map ; 33 34 import net.sf.jasperreports.engine.JRConstants; 35 36 import org.jfree.chart.labels.PieSectionLabelGenerator; 37 import org.jfree.data.general.PieDataset; 38 39 40 44 public class PieLabelGenerator implements PieSectionLabelGenerator, Serializable 45 { 46 private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; 47 48 private Map labels = null; 49 50 public PieLabelGenerator( Map labels ) 51 { 52 this.labels = labels; 53 } 54 55 public String generateSectionLabel(PieDataset arg0, Comparable arg1) 56 { 57 return (String )labels.get( arg1 ); 58 } 59 60 public AttributedString generateAttributedSectionLabel(PieDataset arg0, Comparable arg1) 61 { 62 return new AttributedString (generateSectionLabel(arg0, arg1)); } 64 } | Popular Tags |