com.aspose.metafiles
Class ColorMap

java.lang.Object
  extended by com.aspose.metafiles.ColorMap

public final class ColorMap
extends java.lang.Object

The ColorMap class contains collection of color replacements for metafiles.


Field Summary
static MetafilesRenderingHintKey METAFILES_COLOR_MAP
          RenderingHint Key to use with ColorMap
 
Constructor Summary
ColorMap(int initialSize)
          Constructs an empty ColorMap with the specified initial capacity.
ColorMap(java.util.Map colorMap)
          Constructs a new ColorMap with the same mappings as the specified Map.
 
Method Summary
 boolean isEmpty()
          Returns true if this map contains no color mappings.
 java.awt.Color mapColor(java.awt.Color color)
          Returns the color to which the specified color is mapped, or null if the map contains no mapping for this color.
 void put(java.awt.Color key, java.awt.Color value)
          Associates the specified color with specified key-color in this map.
 void putAll(java.util.Map colorMap)
          Copies all of the mappings from the specified map to this map.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

METAFILES_COLOR_MAP

public static MetafilesRenderingHintKey METAFILES_COLOR_MAP
RenderingHint Key to use with ColorMap

Constructor Detail

ColorMap

public ColorMap(int initialSize)
Constructs an empty ColorMap with the specified initial capacity.

Parameters:
initialSize - the initial capacity.

ColorMap

public ColorMap(java.util.Map colorMap)
         throws MetafilesException
Constructs a new ColorMap with the same mappings as the specified Map.

Parameters:
colorMap - the map whose mappings are to be placed in this map.
Throws:
MetafilesException - if the specified map contains any keys or values except Color.
Method Detail

putAll

public void putAll(java.util.Map colorMap)
            throws MetafilesException
Copies all of the mappings from the specified map to this map. These mappings will replace any mappings that this map had for any of the keys currently in the specified map.

Parameters:
colorMap - mappings to be stored in this map.
Throws:
MetafilesException - if the specified map contains any keys or values except Color.

put

public void put(java.awt.Color key,
                java.awt.Color value)
         throws MetafilesException
Associates the specified color with specified key-color in this map. If the map previously contained a mapping for this key-color, the old color is replaced.

Parameters:
key - key-color with which the specified color is to be associated.
value - color to be associated with the specified key-color.
Throws:
MetafilesException - if any of both colors is null.

mapColor

public java.awt.Color mapColor(java.awt.Color color)
Returns the color to which the specified color is mapped, or null if the map contains no mapping for this color.

Parameters:
color - the color whose associated value is to be returned.
Returns:
the color to which this map maps the specified color, or null if the map contains no mapping for this color.

isEmpty

public boolean isEmpty()
Returns true if this map contains no color mappings.

Returns:
true if this map contains no color mappings.