本文整理汇总了Java中org.jfree.chart.renderer.xy.XYBlockRenderer.setPaintScale方法的典型用法代码示例。如果您正苦于以下问题:Java XYBlockRenderer.setPaintScale方法的具体用法?Java XYBlockRenderer.setPaintScale怎么用?Java XYBlockRenderer.setPaintScale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.renderer.xy.XYBlockRenderer
的用法示例。
在下文中一共展示了XYBlockRenderer.setPaintScale方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getItemRenderer
import org.jfree.chart.renderer.xy.XYBlockRenderer; //导入方法依赖的package包/类
@Override
public AbstractXYItemRenderer getItemRenderer(boolean nominal, int size, double minColor, double maxColor) {
XYBlockRenderer renderer = new XYBlockRenderer();
renderer.setPaintScale(new BlockPaintScale(minColor, maxColor));
renderer.setBlockAnchor(RectangleAnchor.CENTER);
// if Block dimension is increased (e.g 1.2x1.2), the grid effect gets bigger
// so it could be that blocks are overlapping a little
// but if Block dimension is decreased (e.g. 0.9x0.9), each rectangle seems to have
// a less-transparent border (you have to zoom-in to notice), and that could be the cause of
// the grid effect.
// renderer.setBlockHeight(1.0);
// renderer.setBlockWidth(1.0);
return renderer;
}
示例2: testEquals
import org.jfree.chart.renderer.xy.XYBlockRenderer; //导入方法依赖的package包/类
/**
* Test that the equals() method distinguishes all fields.
*/
public void testEquals() {
// default instances
XYBlockRenderer r1 = new XYBlockRenderer();
XYBlockRenderer r2 = new XYBlockRenderer();
assertTrue(r1.equals(r2));
assertTrue(r2.equals(r1));
// blockHeight
r1.setBlockHeight(2.0);
assertFalse(r1.equals(r2));
r2.setBlockHeight(2.0);
assertTrue(r1.equals(r2));
// blockWidth
r1.setBlockWidth(2.0);
assertFalse(r1.equals(r2));
r2.setBlockWidth(2.0);
assertTrue(r1.equals(r2));
// paintScale
r1.setPaintScale(new GrayPaintScale(0.0, 1.0));
assertFalse(r1.equals(r2));
r2.setPaintScale(new GrayPaintScale(0.0, 1.0));
assertTrue(r1.equals(r2));
}
示例3: testEquals
import org.jfree.chart.renderer.xy.XYBlockRenderer; //导入方法依赖的package包/类
/**
* Test that the equals() method distinguishes all fields.
*/
public void testEquals() {
// default instances
XYBlockRenderer r1 = new XYBlockRenderer();
XYBlockRenderer r2 = new XYBlockRenderer();
assertTrue(r1.equals(r2));
assertTrue(r2.equals(r1));
// blockHeight
r1.setBlockHeight(2.0);
assertFalse(r1.equals(r2));
r2.setBlockHeight(2.0);
assertTrue(r1.equals(r2));
// blockWidth
r1.setBlockWidth(2.0);
assertFalse(r1.equals(r2));
r2.setBlockWidth(2.0);
assertTrue(r1.equals(r2));
// paintScale
r1.setPaintScale(new GrayPaintScale(0.0, 1.0));
assertFalse(r1.equals(r2));
r2.setPaintScale(new GrayPaintScale(0.0, 1.0));
assertTrue(r1.equals(r2));
}
示例4: getItemRenderer
import org.jfree.chart.renderer.xy.XYBlockRenderer; //导入方法依赖的package包/类
@Override
public AbstractXYItemRenderer getItemRenderer(boolean nominal, int size, double minColor, double maxColor) {
XYBlockRenderer renderer = new XYBlockRenderer();
renderer.setPaintScale(new BlockPaintScale(minColor, maxColor));
renderer.setBlockAnchor(RectangleAnchor.CENTER);
// if Block dimension is increased (e.g 1.2x1.2), the grid effect gets bigger
// so it could be that blocks are overlapping a little
// but if Block dimension is decreased (e.g. 0.9x0.9), each rectangle seems to have
// a less-transparent border (you have to zoom-in to notice), and that could be the cause of the grid effect.
//renderer.setBlockHeight(1.0);
//renderer.setBlockWidth(1.0);
return renderer;
}
示例5: resetRenderer
import org.jfree.chart.renderer.xy.XYBlockRenderer; //导入方法依赖的package包/类
protected void resetRenderer(final IScope scope, final String serieid) {
final XYBlockRenderer newr = (XYBlockRenderer) this.getOrCreateRenderer(scope, serieid);
// newr.setSeriesStroke(0, new BasicStroke(0));
final ChartDataSeries myserie = this.getChartdataset().getDataSeries(scope, serieid);
if (myserie.getMycolor() != null) {
newr.setSeriesPaint(0, myserie.getMycolor());
}
if (myserie.getSValues(scope).size() > 0) {
final double maxval = Collections.max(myserie.getSValues(scope));
final double minval = Collections.min(myserie.getSValues(scope));
Color cdeb = new Color(0, 0, 0, 0);
if (myserie.getMyMincolor() != null)
cdeb = myserie.getMyMincolor();
Color cend = new Color(0.9f, 0.9f, 0.9f, 1.0f);
if (myserie.getMycolor() != null)
cend = myserie.getMycolor();
LookupPaintScale paintscale = createLUT(100, (float) minval, (float) maxval, cdeb, cend);
if (myserie.getMyMedcolor() != null)
paintscale = createLUT(100, (float) minval, (float) maxval, cdeb, myserie.getMyMedcolor(), cend);
newr.setPaintScale(paintscale);
final NumberAxis scaleAxis = new NumberAxis(myserie.getName());
scaleAxis.setAxisLinePaint(this.axesColor);
scaleAxis.setTickMarkPaint(this.axesColor);
scaleAxis.setTickLabelFont(this.getTickFont());
scaleAxis.setRange(minval, maxval);
scaleAxis.setAxisLinePaint(axesColor);
scaleAxis.setLabelFont(getLabelFont());
if (textColor != null) {
scaleAxis.setLabelPaint(textColor);
scaleAxis.setTickLabelPaint(textColor);
}
if (!this.getXTickValueVisible(scope))
{
scaleAxis.setTickMarksVisible(false);
scaleAxis.setTickLabelsVisible(false);
}
final PaintScaleLegend legend = new PaintScaleLegend(paintscale, scaleAxis);
legend.setAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
legend.setAxisOffset(5.0);
// legend.setMargin(new RectangleInsets(5, 5, 5, 5));
// legend.setFrame(new BlockBorder(Color.red));
// legend.setPadding(new RectangleInsets(10, 10, 10, 10));
// legend.setStripWidth(10);
legend.setPosition(RectangleEdge.RIGHT);
legend.setBackgroundPaint(this.backgroundColor);
// ArrayList<PaintScaleLegend> caxe=new
// ArrayList<PaintScaleLegend>();
// caxe.add(legend);
// chart.setSubtitles(caxe);
if (!this.series_label_position.equals("none"))
chart.addSubtitle(legend);
}
}