1 39 40 package org.jfree.chart; 41 42 import java.awt.Shape ; 43 import java.awt.geom.Ellipse2D ; 44 import java.awt.geom.Rectangle2D ; 45 46 53 public class DefaultShapeFactory implements ShapeFactory { 54 55 66 public Shape getShape(int series, int item, double x, double y, double scale) { 67 68 if (series == 0) { 69 return new Rectangle2D.Double (x - 0.5 * scale, y - 0.5 * scale, scale, scale); 70 } 71 else { 72 return new Ellipse2D.Double (x - 0.5 * scale, y - 0.5 * scale, scale, scale); 73 } 74 75 } 76 77 88 public Shape getShape(int series, Object category, double x, double y, double scale) { 89 90 return new Ellipse2D.Double (x - 0.5 * scale, y - 0.5 * scale, scale, scale); 91 92 } 93 } 94 | Popular Tags |