/** * Returns the paint for the specified section. This is equivalent to * {@code lookupSectionPaint(section, getAutoPopulateSectionPaint())}. * * @param key the section key. * * @return The paint for the specified section. * * @since 1.0.3 * * @see #lookupSectionPaint(Comparable, boolean) */ protected Paint lookupSectionPaint(Comparable key) { return lookupSectionPaint(key, getAutoPopulateSectionPaint()); }
/** * Returns the paint for the specified section. This is equivalent to * <code>lookupSectionPaint(section, getAutoPopulateSectionPaint())</code>. * * @param key the section key. * * @return The paint for the specified section. * * @since 1.0.3 * * @see #lookupSectionPaint(Comparable, boolean) */ protected Paint lookupSectionPaint(Comparable key) { return lookupSectionPaint(key, getAutoPopulateSectionPaint()); }
/** * Returns the paint for the specified section. This is equivalent to * {@code lookupSectionPaint(section)}. Checks to see if the user set the * {@code Paint} to be of type {@code RadialGradientPaint} and if so it * adjusts the center and radius to match the Pie. * * @param key the section key. * @param state PiePlotState. * * @return The paint for the specified section. * * @since 1.0.14 */ protected Paint lookupSectionPaint(Comparable key, PiePlotState state) { Paint paint = lookupSectionPaint(key, getAutoPopulateSectionPaint()); // for a RadialGradientPaint we adjust the center and radius to match // the current pie segment... if (paint instanceof RadialGradientPaint) { RadialGradientPaint rgp = (RadialGradientPaint) paint; Point2D center = getArcCenter(state, key); float radius = (float) Math.max(state.getPieHRadius(), state.getPieWRadius()); float[] fractions = rgp.getFractions(); Color[] colors = rgp.getColors(); paint = new RadialGradientPaint(center, radius, fractions, colors); } return paint; }
/** * Applies the attributes of this theme to a {@link PiePlot} instance. * This method also clears any set values for the section paint, outline * etc, so that the theme's {@link DrawingSupplier} will be used. * * @param plot the plot (<code>null</code> not permitted). */ protected void applyToPiePlot(PiePlot plot) { plot.setLabelLinkPaint(this.labelLinkPaint); plot.setLabelLinkStyle(this.labelLinkStyle); plot.setLabelFont(this.regularFont); // clear the section attributes so that the theme's DrawingSupplier // will be used if (plot.getAutoPopulateSectionPaint()) { plot.clearSectionPaints(false); } if (plot.getAutoPopulateSectionOutlinePaint()) { plot.clearSectionOutlinePaints(false); } if (plot.getAutoPopulateSectionOutlineStroke()) { plot.clearSectionOutlineStrokes(false); } }
/** * Applies the attributes of this theme to a {@link PiePlot} instance. * This method also clears any set values for the section paint, outline * etc, so that the theme's {@link DrawingSupplier} will be used. * * @param plot the plot ({@code null} not permitted). */ protected void applyToPiePlot(PiePlot plot) { plot.setLabelLinkPaint(this.labelLinkPaint); plot.setLabelLinkStyle(this.labelLinkStyle); plot.setLabelFont(this.regularFont); plot.setShadowGenerator(this.shadowGenerator); // clear the section attributes so that the theme's DrawingSupplier // will be used if (plot.getAutoPopulateSectionPaint()) { plot.clearSectionPaints(false); } if (plot.getAutoPopulateSectionOutlinePaint()) { plot.clearSectionOutlinePaints(false); } if (plot.getAutoPopulateSectionOutlineStroke()) { plot.clearSectionOutlineStrokes(false); } }