1 43 44 package org.jfree.chart.block; 45 46 import java.awt.Graphics2D ; 47 import java.awt.Paint ; 48 import java.awt.geom.Rectangle2D ; 49 50 53 public class ColorBlock extends AbstractBlock implements Block { 54 55 private Paint paint; 56 57 64 public ColorBlock(Paint paint, double width, double height) { 65 this.paint = paint; 66 setWidth(width); 67 setHeight(height); 68 } 69 70 76 public void draw(Graphics2D g2, Rectangle2D area) { 77 Rectangle2D bounds = getBounds(); 78 g2.setPaint(this.paint); 79 g2.fill(bounds); 80 } 81 82 91 public Object draw(Graphics2D g2, Rectangle2D area, Object params) { 92 draw(g2, area); 93 return null; 94 } 95 96 } 97 | Popular Tags |