1 59 60 package org.jfree.chart.labels; 61 62 import java.io.Serializable ; 63 import java.text.DateFormat ; 64 import java.text.NumberFormat ; 65 66 import org.jfree.data.xy.XYDataset; 67 import org.jfree.util.PublicCloneable; 68 69 73 public class StandardXYItemLabelGenerator extends AbstractXYItemLabelGenerator 74 implements XYItemLabelGenerator, 75 Cloneable , 76 PublicCloneable, 77 Serializable { 78 79 80 private static final long serialVersionUID = 7807668053171837925L; 81 82 83 public static final String DEFAULT_ITEM_LABEL_FORMAT = "{2}"; 84 85 88 public StandardXYItemLabelGenerator() { 89 this( 90 DEFAULT_ITEM_LABEL_FORMAT, 91 NumberFormat.getNumberInstance(), NumberFormat.getNumberInstance() 92 ); 93 } 94 95 96 106 public StandardXYItemLabelGenerator(String formatString, 107 NumberFormat xFormat, 108 NumberFormat yFormat) { 109 110 super(formatString, xFormat, yFormat); 111 112 } 113 114 124 public StandardXYItemLabelGenerator(String formatString, 125 DateFormat xFormat, 126 NumberFormat yFormat) { 127 128 super(formatString, xFormat, yFormat); 129 130 } 131 132 142 public StandardXYItemLabelGenerator(String formatString, 143 DateFormat xFormat, 144 DateFormat yFormat) { 145 146 super(formatString, xFormat, yFormat); 147 148 } 149 150 159 public String generateLabel(XYDataset dataset, int series, int item) { 160 return generateLabelString(dataset, series, item); 161 } 162 163 170 public Object clone() throws CloneNotSupportedException { 171 return super.clone(); 172 } 173 174 181 public boolean equals(Object obj) { 182 if (obj == this) { 183 return true; 184 } 185 if (obj instanceof StandardXYItemLabelGenerator) { 186 return super.equals(obj); 187 } 188 return false; 189 } 190 191 } 192 | Popular Tags |