Packages

 

com.aspose.imaging.fileformats.metafile

Class ColorMap



  • public final class ColorMap
    extends Object
    The ColorMap class contains collection of color replacements for metafiles.
    • Field Detail

      • KEY_METAFILES_COLOR_MAP

        public static final RenderingHints.Key KEY_METAFILES_COLOR_MAP
        RenderingHint Key to use with ColorMap
      • METAFILES_COLOR_MAP

        public static final RenderingHints.Key METAFILES_COLOR_MAP
        Deprecated. Use KEY_METAFILES_COLOR_MAP instead.
        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(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(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(Color key,
                        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 Color mapColor(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.