本文整理匯總了Java中org.jfree.chart.renderer.xy.XYBarRenderer.setGradientPaintTransformer方法的典型用法代碼示例。如果您正苦於以下問題:Java XYBarRenderer.setGradientPaintTransformer方法的具體用法?Java XYBarRenderer.setGradientPaintTransformer怎麽用?Java XYBarRenderer.setGradientPaintTransformer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jfree.chart.renderer.xy.XYBarRenderer
的用法示例。
在下文中一共展示了XYBarRenderer.setGradientPaintTransformer方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createXYBarChart
import org.jfree.chart.renderer.xy.XYBarRenderer; //導入方法依賴的package包/類
@Override
protected JFreeChart createXYBarChart() throws JRException
{
JFreeChart jfreeChart = super.createXYBarChart();
XYPlot xyPlot = (XYPlot)jfreeChart.getPlot();
XYBarRenderer renderer = (XYBarRenderer)xyPlot.getRenderer();
renderer.setMargin(0.1);
renderer.setGradientPaintTransformer(
new StandardGradientPaintTransformer(GradientPaintTransformType.HORIZONTAL)
);
XYDataset xyDataset = xyPlot.getDataset();
if (xyDataset != null)
{
for (int i = 0; i < xyDataset.getSeriesCount(); i++)
{
renderer.setSeriesPaint(i, ChartThemesConstants.EYE_CANDY_SIXTIES_GRADIENT_PAINTS.get(i));
}
}
return jfreeChart;
}
示例2: configureXYBarRenderer
import org.jfree.chart.renderer.xy.XYBarRenderer; //導入方法依賴的package包/類
private static void configureXYBarRenderer(XYBarRenderer renderer, ValueSource valueSource, PlotInstance plotInstance) {
StandardXYBarPainter barPainter = new StandardXYBarPainter();
renderer.setBarPainter(barPainter);
renderer.setGradientPaintTransformer(null);
SeriesFormat seriesFormat = valueSource.getSeriesFormat();
DimensionConfig domainConfig = valueSource.getDomainConfig();
ValueSourceData valueSourceData = plotInstance.getPlotData().getValueSourceData(valueSource);
int seriesCount;
if (valueSourceData != null) {
seriesCount = valueSourceData.getSeriesCount();
} else {
seriesCount = 0;
}
DimensionConfig colorDimensionConfig = plotInstance.getCurrentPlotConfigurationClone().getDimensionConfig(
PlotDimension.COLOR);
// don't need shapeDimensionConfig, since the shape can't be represented for bars.
// Loop all series and set series format.
// Format based on dimension configs will be set later on in initFormatDelegate().
for (int seriesIdx = 0; seriesIdx < seriesCount; ++seriesIdx) {
// configure series paint if necessary
if (!SeriesFormat.calculateIndividualFormatForEachItem(domainConfig, colorDimensionConfig)) {
renderer.setSeriesPaint(seriesIdx, seriesFormat.getAreaFillPaint());
}
// configure general style of the bars
renderer.setShadowVisible(false);
renderer.setSeriesOutlinePaint(seriesIdx, PlotConfiguration.DEFAULT_SERIES_OUTLINE_PAINT);
}
renderer.setDrawBarOutline(true);
}
示例3: configureXYBarRenderer
import org.jfree.chart.renderer.xy.XYBarRenderer; //導入方法依賴的package包/類
private static void configureXYBarRenderer(XYBarRenderer renderer, ValueSource valueSource, PlotInstance plotInstance) {
StandardXYBarPainter barPainter = new StandardXYBarPainter();
renderer.setBarPainter(barPainter);
renderer.setGradientPaintTransformer(null);
SeriesFormat seriesFormat = valueSource.getSeriesFormat();
DimensionConfig domainConfig = valueSource.getDomainConfig();
ValueSourceData valueSourceData = plotInstance.getPlotData().getValueSourceData(valueSource);
int seriesCount;
if (valueSourceData != null) {
seriesCount = valueSourceData.getSeriesCount();
} else {
seriesCount = 0;
}
DimensionConfig colorDimensionConfig = plotInstance.getCurrentPlotConfigurationClone().getDimensionConfig(PlotDimension.COLOR);
// don't need shapeDimensionConfig, since the shape can't be represented for bars.
// Loop all series and set series format.
// Format based on dimension configs will be set later on in initFormatDelegate().
for(int seriesIdx = 0; seriesIdx < seriesCount; ++seriesIdx) {
// configure series paint if necessary
if (!SeriesFormat.calculateIndividualFormatForEachItem(domainConfig, colorDimensionConfig)) {
renderer.setSeriesPaint(seriesIdx, seriesFormat.getAreaFillPaint());
}
// configure general style of the bars
renderer.setShadowVisible(false);
renderer.setSeriesOutlinePaint(seriesIdx, PlotConfiguration.DEFAULT_SERIES_OUTLINE_PAINT);
}
renderer.setDrawBarOutline(true);
}
示例4: testEquals
import org.jfree.chart.renderer.xy.XYBarRenderer; //導入方法依賴的package包/類
/**
* Test that the equals() method distinguishes all fields.
*/
public void testEquals() {
// default instances
XYBarRenderer r1 = new XYBarRenderer();
XYBarRenderer r2 = new XYBarRenderer();
assertTrue(r1.equals(r2));
assertTrue(r2.equals(r1));
// setBase()
r1.setBase(1.0);
assertFalse(r1.equals(r2));
r2.setBase(1.0);
assertTrue(r1.equals(r2));
// setUseYInterval
r1.setUseYInterval(!r1.getUseYInterval());
assertFalse(r1.equals(r2));
r2.setUseYInterval(!r2.getUseYInterval());
assertTrue(r1.equals(r2));
// setMargin()
r1.setMargin(0.10);
assertFalse(r1.equals(r2));
r2.setMargin(0.10);
assertTrue(r1.equals(r2));
// setDrawBarOutline()
r1.setDrawBarOutline(!r1.isDrawBarOutline());
assertFalse(r1.equals(r2));
r2.setDrawBarOutline(!r2.isDrawBarOutline());
assertTrue(r1.equals(r2));
// setGradientPaintTransformer()
r1.setGradientPaintTransformer(
new StandardGradientPaintTransformer(
GradientPaintTransformType.CENTER_HORIZONTAL
)
);
assertFalse(r1.equals(r2));
r2.setGradientPaintTransformer(
new StandardGradientPaintTransformer(
GradientPaintTransformType.CENTER_HORIZONTAL
)
);
assertTrue(r1.equals(r2));
}
示例5: testEquals
import org.jfree.chart.renderer.xy.XYBarRenderer; //導入方法依賴的package包/類
/**
* Test that the equals() method distinguishes all fields.
*/
public void testEquals() {
// default instances
XYBarRenderer r1 = new XYBarRenderer();
XYBarRenderer r2 = new XYBarRenderer();
assertTrue(r1.equals(r2));
assertTrue(r2.equals(r1));
// setBase()
r1.setBase(1.0);
assertFalse(r1.equals(r2));
r2.setBase(1.0);
assertTrue(r1.equals(r2));
// setUseYInterval
r1.setUseYInterval(!r1.getUseYInterval());
assertFalse(r1.equals(r2));
r2.setUseYInterval(!r2.getUseYInterval());
assertTrue(r1.equals(r2));
// setMargin()
r1.setMargin(0.10);
assertFalse(r1.equals(r2));
r2.setMargin(0.10);
assertTrue(r1.equals(r2));
// setDrawBarOutline()
r1.setDrawBarOutline(!r1.isDrawBarOutline());
assertFalse(r1.equals(r2));
r2.setDrawBarOutline(!r2.isDrawBarOutline());
assertTrue(r1.equals(r2));
// setGradientPaintTransformer()
r1.setGradientPaintTransformer(new StandardGradientPaintTransformer(
GradientPaintTransformType.CENTER_HORIZONTAL));
assertFalse(r1.equals(r2));
r2.setGradientPaintTransformer(new StandardGradientPaintTransformer(
GradientPaintTransformType.CENTER_HORIZONTAL));
assertTrue(r1.equals(r2));
// legendBar
r1.setLegendBar(new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0));
assertFalse(r1.equals(r2));
r2.setLegendBar(new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0));
assertTrue(r1.equals(r2));
// positiveItemLabelFallbackPosition
r1.setPositiveItemLabelPositionFallback(new ItemLabelPosition());
assertFalse(r1.equals(r2));
r2.setPositiveItemLabelPositionFallback(new ItemLabelPosition());
assertTrue(r1.equals(r2));
// negativeItemLabelFallbackPosition
r1.setNegativeItemLabelPositionFallback(new ItemLabelPosition());
assertFalse(r1.equals(r2));
r2.setNegativeItemLabelPositionFallback(new ItemLabelPosition());
assertTrue(r1.equals(r2));
}