ilog.views.maps.graphic.style
Class IlvEnumerationColorModel

java.lang.Object
  extended by java.awt.image.ColorModel
      extended by java.awt.image.IndexColorModel
          extended by ilog.views.maps.graphic.style.IlvEnumerationColorModel
All Implemented Interfaces:
IlvPersistentObject, IlvColorIntervalLimitFormat, IlvColorEncoder, Transparency

public class IlvEnumerationColorModel
extends IndexColorModel
implements IlvColorEncoder, IlvColorIntervalLimitFormat

IlvEnumerationColorModel implements a color model that attaches a color to each of the values passed in an array list.

Since:
JViews 8.1

Field Summary
 
Fields inherited from class java.awt.image.ColorModel
pixel_bits, transferType
 
Fields inherited from interface java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT
 
Constructor Summary
IlvEnumerationColorModel(IlvInputStream stream)
          Creates a new IlvEnumerationColorModel instance.
IlvEnumerationColorModel(int[] rgb, IlvEnumerationColorModel origin)
          Creates a new IlvEnumerationColorModel instance.
 
Method Summary
 boolean allowLimitChange()
          Should the color model editor be able to change the value of the limits Returns false.
 String format(int value)
          Returns the string attached to the value.
 int getValueRGB(Object value)
          Encodes a graphical object meta data into a color.
static IlvEnumerationColorModel makeModel(ArrayList valuesList)
          Creates an enumeration model with one random color for each of the values.
 int parse(String limit)
          Finds the value attached to the limit.
 void write(IlvOutputStream out)
          Writes the attributes of a persistent object.
 
Methods inherited from class java.awt.image.IndexColorModel
convertToIntDiscrete, createCompatibleSampleModel, createCompatibleWritableRaster, finalize, getAlpha, getAlphas, getBlue, getBlues, getComponents, getComponents, getComponentSize, getDataElement, getDataElements, getDataElements, getGreen, getGreens, getMapSize, getRed, getReds, getRGB, getRGBs, getTransparency, getTransparentPixel, getValidPixels, isCompatibleRaster, isCompatibleSampleModel, isValid, isValid, toString
 
Methods inherited from class java.awt.image.ColorModel
coerceData, equals, getAlpha, getAlphaRaster, getBlue, getColorSpace, getComponentSize, getDataElement, getDataElements, getGreen, getNormalizedComponents, getNormalizedComponents, getNumColorComponents, getNumComponents, getPixelSize, getRed, getRGB, getRGBdefault, getTransferType, getUnnormalizedComponents, hasAlpha, hashCode, isAlphaPremultiplied
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IlvEnumerationColorModel

public IlvEnumerationColorModel(int[] rgb,
                                IlvEnumerationColorModel origin)
Creates a new IlvEnumerationColorModel instance.

Parameters:
rgb - A new array of RGB colors.
origin - The initial color model.

IlvEnumerationColorModel

public IlvEnumerationColorModel(IlvInputStream stream)
                         throws IlvReadFileException
Creates a new IlvEnumerationColorModel instance.

Parameters:
stream - The stream to read data from.
Throws:
IlvReadFileException - if there is a problem reading from stream.
Method Detail

makeModel

public static IlvEnumerationColorModel makeModel(ArrayList valuesList)
Creates an enumeration model with one random color for each of the values.

Parameters:
valuesList - A list of values that should be attached to colors.
Returns:
A new color model.

allowLimitChange

public boolean allowLimitChange()
Should the color model editor be able to change the value of the limits Returns false.

Specified by:
allowLimitChange in interface IlvColorIntervalLimitFormat
Returns:
true to give user access to insert/delete/change limits.
See Also:
IlvColorIntervalLimitFormat.allowLimitChange()

format

public String format(int value)
Returns the string attached to the value.

Specified by:
format in interface IlvColorIntervalLimitFormat
Parameters:
value - The value.
Returns:
The string attached to the value.
See Also:
IlvColorIntervalLimitFormat.format(int)

parse

public int parse(String limit)
Finds the value attached to the limit.

Specified by:
parse in interface IlvColorIntervalLimitFormat
Parameters:
limit - The limit.
Returns:
The value attached to the limit.
See Also:
IlvColorIntervalLimitFormat.parse(java.lang.String)

getValueRGB

public int getValueRGB(Object value)
Encodes a graphical object meta data into a color.

Specified by:
getValueRGB in interface IlvColorEncoder
Parameters:
value - The metadata to encode.
Returns:
The RGB value encoded to a ColorModel.getRGBdefault() color model.
See Also:
IlvColorEncoder.getValueRGB(java.lang.Object)

write

public void write(IlvOutputStream out)
           throws IOException
Writes the attributes of a persistent object.

Specified by:
write in interface IlvPersistentObject
Parameters:
out - the output stream
Throws:
IOException - thrown when an exception occurs during the write operation for this object.
See Also:
IlvPersistentObject.write(ilog.views.io.IlvOutputStream)


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.