/** * Sets the height of the blocks used to represent each data item and * sends a {@link RendererChangeEvent} to all registered listeners. * * @param height the new height, in data/axis units (must be > 0.0). * * @see #getBlockHeight() */ public void setBlockHeight(double height) { if (height <= 0.0) { throw new IllegalArgumentException( "The 'height' argument must be > 0.0"); } this.blockHeight = height; updateOffsets(); fireChangeEvent(); }
chart.getXYPlot().getRangeAxis().setUpperMargin(0); XYBlockRenderer renderer = new XYBlockRenderer(); if (xyBlockPlot.getBlockWidth() != null) { renderer.setBlockWidth(xyBlockPlot.getBlockWidth()); renderer.setBlockHeight(xyBlockPlot.getBlockHeight()); renderer.setBlockAnchor(ConstantTransform.rectangleAnchor(xyBlockPlot.getBlockAnchor())); paintScale.add(scale.getValue(), scale.getPaint()); renderer.setPaintScale(paintScale);
if (getDrawOutlines()) { if (getUseOutlinePaint()) { g2.setPaint(getItemOutlinePaint(series, item)); g2.setStroke(lookupSeriesOutlineStroke(series)); g2.draw(block); if (isItemLabelVisible(series, item)) { drawItemLabel(g2, orientation, dataset, series, item, block.getCenterX(), block.getCenterY(), y < 0.0); double transY = rangeAxis.valueToJava2D(y, dataArea, plot.getRangeAxisEdge()); updateCrosshairValues(crosshairState, x, y, datasetIndex, transX, transY, orientation); addEntity(entities, block, dataset, series, item, block.getCenterX(), block.getCenterY());
XYBlockRenderer renderer = new XYBlockRenderer(); renderer.setPaintScale(paintScale);
/** * Sets the flag that controls whether the outline paint is used to draw * block outlines, and sends a {@link RendererChangeEvent} to all * registered listeners. * * @param flag the flag. * * @see #getUseOutlinePaint() */ public void setUseOutlinePaint(boolean flag) { this.useOutlinePaint = flag; fireChangeEvent(); }
/** * Creates a new {@code XYBlockRenderer} instance with default * attributes. */ public XYBlockRenderer() { updateOffsets(); this.paintScale = new LookupPaintScale(); this.drawOutlines = true; this.useOutlinePaint = false; // use item paint by default }
addEntity(entities, block, dataset, series, item, 0.0, 0.0);
yAxis.setLowerMargin(0); yAxis.setUpperMargin(0); XYBlockRenderer renderer = new XYBlockRenderer(); PaintScale scale; if (dataSet.getMinValue() >= dataSet.getMaxValue()) { scale = new InverseGrayScale(dataSet.getMinValue(), dataSet.getMaxValue()); renderer.setPaintScale(scale); renderer.setBlockWidth(1); renderer.setBlockHeight(1); XYPlot plot = new XYPlot(dataSet, xAxis, yAxis, renderer); plot.setBackgroundPaint(Color.white);
/** * Sets the flag that controls whether outlines are drawn for * blocks, and sends a {@link RendererChangeEvent} to all registered * listeners. * * @param flag the flag. * * @see #getDrawOutlines() */ public void setDrawOutlines(boolean flag) { this.drawOutlines = flag; fireChangeEvent(); }
/** * Creates a new <code>XYBlockRenderer</code> instance with default * attributes. */ public XYBlockRenderer() { updateOffsets(); this.paintScale = new LookupPaintScale(); }
yAxis.setRange(mins[1], maxs[1]); XYBlockRenderer renderer = new XYBlockRenderer(); renderer.setBlockWidth((maxs[0]-mins[0])/(nPoints-1)); renderer.setBlockHeight((maxs[1] - mins[1]) / (nPoints - 1)); PaintScale scale = new GrayPaintScale(0, 1.0); renderer.setPaintScale(scale); XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer); plot.setBackgroundPaint(Color.lightGray);
/** * Sets the height of the blocks used to represent each data item and * sends a {@link RendererChangeEvent} to all registered listeners. * * @param height the new height, in data/axis units (must be > 0.0). * * @see #getBlockHeight() */ public void setBlockHeight(double height) { if (height <= 0.0) { throw new IllegalArgumentException( "The 'height' argument must be > 0.0"); } this.blockHeight = height; updateOffsets(); fireChangeEvent(); }
/** * Sets the paint scale used by the renderer and sends a * {@link RendererChangeEvent} to all registered listeners. * * @param scale the scale (<code>null</code> not permitted). * * @see #getPaintScale() * @since 1.0.4 */ public void setPaintScale(PaintScale scale) { if (scale == null) { throw new IllegalArgumentException("Null 'scale' argument."); } this.paintScale = scale; fireChangeEvent(); }
/** * Sets the width of the blocks used to represent each data item and * sends a {@link RendererChangeEvent} to all registered listeners. * * @param width the new width, in data/axis units (must be > 0.0). * * @see #getBlockWidth() */ public void setBlockWidth(double width) { if (width <= 0.0) { throw new IllegalArgumentException( "The 'width' argument must be > 0.0"); } this.blockWidth = width; updateOffsets(); fireChangeEvent(); }
/** * Sets the paint scale used by the renderer and sends a * {@link RendererChangeEvent} to all registered listeners. * * @param scale the scale ({@code null} not permitted). * * @see #getPaintScale() * @since 1.0.4 */ public void setPaintScale(PaintScale scale) { Args.nullNotPermitted(scale, "scale"); this.paintScale = scale; fireChangeEvent(); }
/** * Sets the width of the blocks used to represent each data item and * sends a {@link RendererChangeEvent} to all registered listeners. * * @param width the new width, in data/axis units (must be > 0.0). * * @see #getBlockWidth() */ public void setBlockWidth(double width) { if (width <= 0.0) { throw new IllegalArgumentException( "The 'width' argument must be > 0.0"); } this.blockWidth = width; updateOffsets(); fireChangeEvent(); }
/** * Sets the anchor point used to align a block at its (x, y) location and * sends a {@link RendererChangeEvent} to all registered listeners. * * @param anchor the anchor. * * @see #getBlockAnchor() */ public void setBlockAnchor(RectangleAnchor anchor) { if (anchor == null) { throw new IllegalArgumentException("Null 'anchor' argument."); } if (this.blockAnchor.equals(anchor)) { return; // no change } this.blockAnchor = anchor; updateOffsets(); fireChangeEvent(); }
/** * Sets the anchor point used to align a block at its (x, y) location and * sends a {@link RendererChangeEvent} to all registered listeners. * * @param anchor the anchor. * * @see #getBlockAnchor() */ public void setBlockAnchor(RectangleAnchor anchor) { Args.nullNotPermitted(anchor, "anchor"); if (this.blockAnchor.equals(anchor)) { return; // no change } this.blockAnchor = anchor; updateOffsets(); fireChangeEvent(); }