Package org.opentrafficsim.draw
Class BoundsPaintScale
java.lang.Object
org.opentrafficsim.draw.BoundsPaintScale
- All Implemented Interfaces:
org.jfree.chart.renderer.PaintScale,ColorPaintScale
Paint scale interpolating between colors at values.
Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Constructor Summary
ConstructorsConstructorDescriptionBoundsPaintScale(double[] bounds, Color[] boundColors) Constructor.BoundsPaintScale(double[] bounds, Color[] boundColors, Color notApplicable) Constructor. -
Method Summary
-
Constructor Details
-
BoundsPaintScale
Constructor.- Parameters:
bounds- value boundsboundColors- colors at bounds- Throws:
IllegalArgumentException- if less than 2 bounds, unequal number of bounds and colors, or duplicate bounds
-
BoundsPaintScale
public BoundsPaintScale(double[] bounds, Color[] boundColors, Color notApplicable) throws IllegalArgumentException Constructor.- Parameters:
bounds- value boundsboundColors- colors at boundsnotApplicable- color for NaN values- Throws:
IllegalArgumentException- if less than 2 bounds, unequal number of bounds and colors, or duplicate bounds
-
-
Method Details
-
getPaint
- Specified by:
getPaintin interfaceColorPaintScale- Specified by:
getPaintin interfaceorg.jfree.chart.renderer.PaintScale
-
getLowerBound
public final double getLowerBound()- Specified by:
getLowerBoundin interfaceorg.jfree.chart.renderer.PaintScale
-
getUpperBound
public final double getUpperBound()- Specified by:
getUpperBoundin interfaceorg.jfree.chart.renderer.PaintScale
-
getBounds
public double[] getBounds()Returns the bound values.- Returns:
- bound values
-
getBoundColors
Returns the bound colors.- Returns:
- bound colors
-
toString
-