/** * Creates a new instance of <code>DialBackground</code>. The * * @param paint the paint (<code>null</code> not permitted). * * @throws IllegalArgumentException if <code>paint</code> is * <code>null</code>. */ public DialBackground(Paint paint) { if (paint == null) { throw new IllegalArgumentException("Null 'paint' argument."); } this.paint = paint; this.gradientPaintTransformer = new StandardGradientPaintTransformer(); }
/** * Creates a new legend graphic. * * @param shape the shape (<code>null</code> not permitted). * @param fillPaint the fill paint (<code>null</code> not permitted). */ public LegendGraphic(Shape shape, Paint fillPaint) { if (shape == null) { throw new IllegalArgumentException("Null 'shape' argument."); } if (fillPaint == null) { throw new IllegalArgumentException("Null 'fillPaint' argument."); } this.shapeVisible = true; this.shape = shape; this.shapeAnchor = RectangleAnchor.CENTER; this.shapeLocation = RectangleAnchor.CENTER; this.shapeFilled = true; this.fillPaint = fillPaint; this.fillPaintTransformer = new StandardGradientPaintTransformer(); setPadding(2.0, 2.0, 2.0, 2.0); }
this.shapeFilled = shapeFilled; this.fillPaint = fillPaint; this.fillPaintTransformer = new StandardGradientPaintTransformer(); this.shapeOutlineVisible = shapeOutlineVisible; this.outlinePaint = outlinePaint;
/** * Constructs a new renderer. * * @param margin the percentage amount to trim from the width of each bar. */ public XYBarRenderer(double margin) { super(); this.margin = margin; this.base = 0.0; this.useYInterval = false; this.gradientPaintTransformer = new StandardGradientPaintTransformer(); this.drawBarOutline = false; this.legendBar = new Rectangle2D.Double(-3.0, -5.0, 6.0, 10.0); this.barPainter = getDefaultBarPainter(); this.shadowsVisible = getDefaultShadowsVisible(); this.shadowXOffset = 4.0; this.shadowYOffset = 4.0; this.barAlignmentFactor = -1.0; }
this.legendArea = area; this.useFillPaint = false; this.gradientTransformer = new StandardGradientPaintTransformer();
this.positiveBarPaint = positiveBarPaint; this.negativeBarPaint = negativeBarPaint; setGradientPaintTransformer(new StandardGradientPaintTransformer( GradientPaintTransformType.CENTER_VERTICAL)); setMinimumBarLength(1.0);
this.shapeFilled = shapeFilled; this.fillPaint = fillPaint; this.fillPaintTransformer = new StandardGradientPaintTransformer(); this.shapeOutlineVisible = shapeOutlineVisible; this.outlinePaint = outlinePaint;
/** * Creates a new bar renderer with default settings. */ public BarRenderer() { super(); this.base = 0.0; this.includeBaseInRange = true; this.itemMargin = DEFAULT_ITEM_MARGIN; this.drawBarOutline = false; this.maximumBarWidth = 1.0; // 100 percent, so it will not apply unless changed this.positiveItemLabelPositionFallback = null; this.negativeItemLabelPositionFallback = null; this.gradientPaintTransformer = new StandardGradientPaintTransformer(); this.minimumBarLength = 0.0; setBaseLegendShape(new Rectangle2D.Double(-4.0, -4.0, 8.0, 8.0)); this.barPainter = getDefaultBarPainter(); this.shadowsVisible = getDefaultShadowsVisible(); this.shadowPaint = Color.gray; this.shadowXOffset = 4.0; this.shadowYOffset = 4.0; }
/** * Creates a dial chart. * * @return A dial chart. */ private static JFreeChart createDialChart(){ DialPlot plot = new DialPlot(); plot.setDialFrame(new StandardDialFrame()); GradientPaint gp = new GradientPaint(new Point(), new Color(255, 255, 255), new Point(), new Color(170, 170, 220)); DialBackground db = new DialBackground(gp); db.setGradientPaintTransformer(new StandardGradientPaintTransformer( GradientPaintTransformType.VERTICAL)); plot.setBackground(db); plot.addPointer(new DialPointer.Pin()); DialCap cap = new DialCap(); plot.setCap(cap); return new JFreeChart(plot); }
type = GradientPaintTransformType.VERTICAL; db.setGradientPaintTransformer(new StandardGradientPaintTransformer(type)); plot.setBackground(db);
if (fillPaint instanceof GradientPaint) { GradientPaint gp = (GradientPaint) fillPaint; GradientPaintTransformer t = new StandardGradientPaintTransformer(); fillPaint = t.transform(gp, areaState.area.getBounds());