Class XYInterpolatedBlockRenderer

  • All Implemented Interfaces:
    Serializable, Cloneable, EventListener, AnnotationChangeListener, LegendItemSource, XYItemRenderer, PublicCloneable

    public class XYInterpolatedBlockRenderer
    extends XYBlockRenderer
    Renderer for blocks that are filled with bidirectionally interpolated colors. It extends a XYBlockRenderer and requires a small extension of the underlying dataset (XYInterpolatedDataset). The interpolation is performed in the drawItem method. This class imposes two constraints on the functionality of the super class: i) no BlockAnchor may be set as this is tightly related to the interpolation, and ii) only paint scales of type ColorPaintScale can be used, as the interpolation obtains pixel colors from it.

    Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
    BSD-style license. See OpenTrafficSim License.

    Version:
    $Revision$, $LastChangedDate$, by $Author$, initial version 8 okt. 2018
    Author:
    Alexander Verbraeck, Peter Knoppers, Wouter Schakel
    See Also:
    Serialized Form
    • Constructor Detail

      • XYInterpolatedBlockRenderer

        public XYInterpolatedBlockRenderer​(org.opentrafficsim.draw.graphs.XYInterpolatedDataset xyInterpolatedDataset)
        Parameters:
        xyInterpolatedDataset - XYInterpolatedDataset; dataset that allows retrieving surrounding value for interpolation
    • Method Detail

      • setPaintScale

        public void setPaintScale​(PaintScale scale)
        throws UnsupportedOperationException if the paint scale is not of type ColorPaintScale
        Overrides:
        setPaintScale in class XYBlockRenderer
      • setInterpolate

        public final void setInterpolate​(boolean interpolate)
        Enables interpolation or not. Interpolation occurs between cell centers. Therefore the painted blocks are shifted right and up. The user of this class must provide an additional row and column of data to fill up the gaps. These values may be NaN.
        Parameters:
        interpolate - boolean; interpolate or not