/** * Creates a new instance. * * @param scale the scale (<code>null</code> not permitted). * @param axis the axis (<code>null</code> not permitted). */ public PaintScaleLegend(PaintScale scale, ValueAxis axis) { ParamChecks.nullNotPermitted(axis, "axis"); this.scale = scale; this.axis = axis; this.axis.addChangeListener(this); this.axisLocation = AxisLocation.BOTTOM_OR_LEFT; this.axisOffset = 0.0; this.axis.setRange(scale.getLowerBound(), scale.getUpperBound()); this.stripWidth = 15.0; this.stripOutlineVisible = true; this.stripOutlinePaint = Color.gray; this.stripOutlineStroke = new BasicStroke(0.5f); this.backgroundPaint = Color.white; this.subdivisions = 100; }
/** * Creates an image that displays the values from the specified dataset. * * @param dataset the dataset (<code>null</code> not permitted). * @param paintScale the paint scale for the z-values (<code>null</code> * not permitted). * * @return A buffered image. */ public static BufferedImage createHeatMapImage(HeatMapDataset dataset, PaintScale paintScale) { ParamChecks.nullNotPermitted(dataset, "dataset"); ParamChecks.nullNotPermitted(paintScale, "paintScale"); int xCount = dataset.getXSampleCount(); int yCount = dataset.getYSampleCount(); BufferedImage image = new BufferedImage(xCount, yCount, BufferedImage.TYPE_INT_ARGB); Graphics2D g2 = image.createGraphics(); for (int xIndex = 0; xIndex < xCount; xIndex++) { for (int yIndex = 0; yIndex < yCount; yIndex++) { double z = dataset.getZValue(xIndex, yIndex); Paint p = paintScale.getPaint(z); g2.setPaint(p); g2.fillRect(xIndex, yCount - yIndex - 1, 1, 1); } } return image; }
/** * Creates a new instance. * * @param scale the scale ({@code null} not permitted). * @param axis the axis ({@code null} not permitted). */ public PaintScaleLegend(PaintScale scale, ValueAxis axis) { Args.nullNotPermitted(axis, "axis"); this.scale = scale; this.axis = axis; this.axis.addChangeListener(this); this.axisLocation = AxisLocation.BOTTOM_OR_LEFT; this.axisOffset = 0.0; this.axis.setRange(scale.getLowerBound(), scale.getUpperBound()); this.stripWidth = 15.0; this.stripOutlineVisible = true; this.stripOutlinePaint = Color.GRAY; this.stripOutlineStroke = new BasicStroke(0.5f); this.backgroundPaint = Color.WHITE; this.subdivisions = 100; }
/** * Creates an image that displays the values from the specified dataset. * * @param dataset the dataset ({@code null} not permitted). * @param paintScale the paint scale for the z-values ({@code null} * not permitted). * * @return A buffered image. */ public static BufferedImage createHeatMapImage(HeatMapDataset dataset, PaintScale paintScale) { Args.nullNotPermitted(dataset, "dataset"); Args.nullNotPermitted(paintScale, "paintScale"); int xCount = dataset.getXSampleCount(); int yCount = dataset.getYSampleCount(); BufferedImage image = new BufferedImage(xCount, yCount, BufferedImage.TYPE_INT_ARGB); Graphics2D g2 = image.createGraphics(); for (int xIndex = 0; xIndex < xCount; xIndex++) { for (int yIndex = 0; yIndex < yCount; yIndex++) { double z = dataset.getZValue(xIndex, yIndex); Paint p = paintScale.getPaint(z); g2.setPaint(p); g2.fillRect(xIndex, yCount - yIndex - 1, 1, 1); } } return image; }
/** * Creates a new instance. * * @param scale the scale (<code>null</code> not permitted). * @param axis the axis (<code>null</code> not permitted). */ public PaintScaleLegend(PaintScale scale, ValueAxis axis) { if (axis == null) { throw new IllegalArgumentException("Null 'axis' argument."); } this.scale = scale; this.axis = axis; this.axisLocation = AxisLocation.BOTTOM_OR_LEFT; this.axisOffset = 0.0; this.axis.setRange(scale.getLowerBound(), scale.getUpperBound()); this.stripWidth = 15.0; this.stripOutlineVisible = false; this.stripOutlinePaint = Color.gray; this.stripOutlineStroke = new BasicStroke(0.5f); this.backgroundPaint = Color.white; this.subdivisions = 100; }
/** * Creates a new instance. * * @param scale the scale (<code>null</code> not permitted). * @param axis the axis (<code>null</code> not permitted). */ public PaintScaleLegend(PaintScale scale, ValueAxis axis) { if (axis == null) { throw new IllegalArgumentException("Null 'axis' argument."); } this.scale = scale; this.axis = axis; this.axis.addChangeListener(this); this.axisLocation = AxisLocation.BOTTOM_OR_LEFT; this.axisOffset = 0.0; this.axis.setRange(scale.getLowerBound(), scale.getUpperBound()); this.stripWidth = 15.0; this.stripOutlineVisible = true; this.stripOutlinePaint = Color.gray; this.stripOutlineStroke = new BasicStroke(0.5f); this.backgroundPaint = Color.white; this.subdivisions = 100; }
/** * Creates an image that displays the values from the specified dataset. * * @param dataset the dataset (<code>null</code> not permitted). * @param paintScale the paint scale for the z-values (<code>null</code> * not permitted). * * @return A buffered image. */ public static BufferedImage createHeatMapImage(HeatMapDataset dataset, PaintScale paintScale) { if (dataset == null) { throw new IllegalArgumentException("Null 'dataset' argument."); } if (paintScale == null) { throw new IllegalArgumentException("Null 'paintScale' argument."); } int xCount = dataset.getXSampleCount(); int yCount = dataset.getYSampleCount(); BufferedImage image = new BufferedImage(xCount, yCount, BufferedImage.TYPE_INT_ARGB); Graphics2D g2 = image.createGraphics(); for (int xIndex = 0; xIndex < xCount; xIndex++) { for (int yIndex = 0; yIndex < yCount; yIndex++) { double z = dataset.getZValue(xIndex, yIndex); Paint p = paintScale.getPaint(z); g2.setPaint(p); g2.fillRect(xIndex, yCount - yIndex - 1, 1, 1); } } return image; }
/** * Creates and returns a JFreeChart {@link PaintScale} that converts data * values to {@link Color}s. */ public static PaintScale createPaintScale(final ColourScheme colourScheme) { return new PaintScale() { @Override public double getLowerBound() { return colourScheme.getScaleMin(); } @Override public double getUpperBound() { return colourScheme.getScaleMax(); } @Override public Color getPaint(double value) { return colourScheme.getColor(value); } }; }
/** * Creates a new instance. * * @param scale the scale (<code>null</code> not permitted). * @param axis the axis (<code>null</code> not permitted). */ public PaintScaleLegend(PaintScale scale, ValueAxis axis) { if (axis == null) { throw new IllegalArgumentException("Null 'axis' argument."); } this.scale = scale; this.axis = axis; this.axisLocation = AxisLocation.BOTTOM_OR_LEFT; this.axisOffset = 0.0; this.stripWidth = 15.0; this.stripOutlineVisible = false; this.stripOutlinePaint = Color.gray; this.stripOutlineStroke = new BasicStroke(0.5f); this.backgroundPaint = Color.white; }
public RTMZRenderer(AbstractXYZDataset dataset, PaintScale paintScale) { super(false, true); this.dataset = dataset; this.paintScale = paintScale; this.setSeriesShape(0, dataPointsShape); setDrawSeriesLineAsPath(true); }
void setPaintScale(PaintScale paintScale) { this.paintScale = paintScale; }
/** * Sets the scale and sends a {@link TitleChangeEvent} to all registered * listeners. * * @param scale the scale (<code>null</code> not permitted). * * @see #getScale() */ public void setScale(PaintScale scale) { if (scale == null) { throw new IllegalArgumentException("Null 'scale' argument."); } this.scale = scale; notifyListeners(new TitleChangeEvent(this)); }
/** * Sets the paint scale used by the renderer. * * @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; notifyListeners(new RendererChangeEvent(this)); }
/** * 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() */ public void setPaintScale(PaintScale scale) { if (scale == null) { throw new IllegalArgumentException("Null 'scale' argument."); } this.paintScale = scale; notifyListeners(new RendererChangeEvent(this)); }
/** * 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(); }