net.sf.mpxj.mpp
Enum ColorType

java.lang.Object
  extended by java.lang.Enum<ColorType>
      extended by net.sf.mpxj.mpp.ColorType
All Implemented Interfaces:
Serializable, Comparable<ColorType>, MpxjEnum

public enum ColorType
extends Enum<ColorType>
implements MpxjEnum

This enum represents the colors used by Microsoft Project.


Enum Constant Summary
AQUA
           
AUTOMATIC
           
BLACK
           
BLUE
           
FUSCHIA
           
GRAY
           
GREEN
           
LIME
           
MAROON
           
NAVY
           
OLIVE
           
PURPLE
           
RED
           
SILVER
           
TEAL
           
WHITE
           
YELLOW
           
 
Method Summary
 Color getColor()
          Retrieve a Java Color instance matching the color used in MS Project.
static ColorType getInstance(int type)
          Retrieve an instance of the enum based on its int value.
static ColorType getInstance(Number type)
          Retrieve an instance of the enum based on its int value.
 String getName()
          Retrieve the color name.
 int getValue()
          Accessor method used to retrieve the numeric representation of the enum.
static ColorType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ColorType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

BLACK

public static final ColorType BLACK

RED

public static final ColorType RED

YELLOW

public static final ColorType YELLOW

LIME

public static final ColorType LIME

AQUA

public static final ColorType AQUA

BLUE

public static final ColorType BLUE

FUSCHIA

public static final ColorType FUSCHIA

WHITE

public static final ColorType WHITE

MAROON

public static final ColorType MAROON

GREEN

public static final ColorType GREEN

OLIVE

public static final ColorType OLIVE

NAVY

public static final ColorType NAVY

PURPLE

public static final ColorType PURPLE

TEAL

public static final ColorType TEAL

GRAY

public static final ColorType GRAY

SILVER

public static final ColorType SILVER

AUTOMATIC

public static final ColorType AUTOMATIC
Method Detail

values

public static ColorType[] 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 (ColorType c : ColorType.values())
    System.out.println(c);

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

valueOf

public static ColorType valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getInstance

public static ColorType getInstance(int type)
Retrieve an instance of the enum based on its int value.

Parameters:
type - int type
Returns:
enum instance

getInstance

public static ColorType getInstance(Number type)
Retrieve an instance of the enum based on its int value.

Parameters:
type - int type
Returns:
enum instance

getName

public String getName()
Retrieve the color name. Currently this is not localised.

Returns:
color name

getColor

public Color getColor()
Retrieve a Java Color instance matching the color used in MS Project. Note that this will return null if the color type is automatic.

Returns:
Color instance

getValue

public int getValue()
Accessor method used to retrieve the numeric representation of the enum.

Specified by:
getValue in interface MpxjEnum
Returns:
int representation of the enum


Copyright © 2012. All Rights Reserved.