Class TripleRangeColorMap

java.lang.Object
microsim.gui.colormap.FixedColorMap
microsim.gui.colormap.TripleRangeColorMap
All Implemented Interfaces:
ColorMap

public class TripleRangeColorMap extends FixedColorMap
It builds automatically a color map oscillating from a bottom color to a middle one and from the middle to a top one, on a variable range.

Title: JAS

Description: Java Agent-based Simulation library

Copyright (C) 2002 Michele Sonnessa

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
Author:
Michele Sonnessa
  • Constructor Details

    • TripleRangeColorMap

      public TripleRangeColorMap(int gradients, Color bottomColor, Color middleColor, Color topColor, double minValue, double midValue, double maxValue)
  • Method Details

    • getColorIndex

      public int getColorIndex(double value)
      Description copied from class: FixedColorMap
      Return the color index.
      Specified by:
      getColorIndex in interface ColorMap
      Overrides:
      getColorIndex in class FixedColorMap
      Parameters:
      value - The value to be mapped.
      Returns:
      The index of the color list mapping the value.