Package microsim.gui.colormap
Interface ColorMap
-
- All Known Implementing Classes:
DoubleRangeColorMap
,FixedColorMap
,RangeColorMap
,TripleRangeColorMap
public interface ColorMap
A generic interface for color mappers. This interface is required by LayerDrawer objects to paint values on the screen. 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
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int[]
getColorComponents(int index)
Return the components of the color stored at given index.int
getColorIndex(double value)
Return the index of the color mapped to the given value.int
getColorIndex(int value)
Return the index of the color mapped to the given value.
-
-
-
Method Detail
-
getColorComponents
int[] getColorComponents(int index)
Return the components of the color stored at given index.- Parameters:
index
- The index of the color. It is a 0-based index of the color corresponding to the adding order.- Returns:
- An array of 3 integers representing the RGB components of the color.
-
getColorIndex
int getColorIndex(int value)
Return the index of the color mapped to the given value.- Parameters:
value
- The value mapped to the color.- Returns:
- The array index of the requested color.
-
getColorIndex
int getColorIndex(double value)
Return the index of the color mapped to the given value.- Parameters:
value
- The value mapped to the color.- Returns:
- The array index of the requested color.
-
-