br.usp.ime.klava.segmentit.util
Enum ColorSpace

java.lang.Object
  extended by java.lang.Enum<ColorSpace>
      extended by br.usp.ime.klava.segmentit.util.ColorSpace
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ColorSpace>

public enum ColorSpace
extends java.lang.Enum<ColorSpace>

Represents an interval of colors from which is possible to select an unique color for each catchment basin (region of interest).

Author:
Bruno Klava

Enum Constant Summary
DEFAULT
          The default color space from the Color class.
HUES
          A color space that spans the hues interval.
 
Method Summary
 java.awt.Color getColor(int index, int max)
          Return a unique Color for each index in the interval [1, max].
static void selectColorSpace(ColorSpace initial)
          Displays a JDialog in which the user can select a ColorSpace.
static ColorSpace valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static ColorSpace[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

DEFAULT

public static final ColorSpace DEFAULT
The default color space from the Color class.


HUES

public static final ColorSpace HUES
A color space that spans the hues interval.

Method Detail

values

public static ColorSpace[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ColorSpace c : ColorSpace.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ColorSpace valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getColor

public java.awt.Color getColor(int index,
                               int max)
Return a unique Color for each index in the interval [1, max].

Parameters:
index - the index for which a Color is needed
max - the upper bound of the interval of indexes
Returns:
a Color for the given index

selectColorSpace

public static void selectColorSpace(ColorSpace initial)
Displays a JDialog in which the user can select a ColorSpace.

Parameters:
initial - the ColorSpace initially selected