com.mapinfo.midev.style

## Class ColorAdjustmentSet

- java.lang.Object
- - com.mapinfo.midev.style.ColorAdjustmentSet

All Implemented Interfaces:
  Serializable, Iterable

    public final class ColorAdjustmentSet
    extends Object
    implements Iterable, Serializable

A `ColorAdjustmentSet` contains a set of `ColorAdjustment`. It is used to apply color changes to bitmap symbols.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`ColorAdjustmentSet()` Constructs an empty set of color adjustments.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `add(Color sourceColor, ColorAdjustment adjustment)` Adds the specified `ColorAdjustment` to this set.
`void` `clear()` Removes all of the elements from this set.
`boolean` `containsSourceColor(Color sourceColor)` Returns `true` if this set contains a mapping for the specified source color with identical RGB value.
`boolean` `equals(Object o)`
`ColorAdjustment` `get(Color sourceColor)` Gets the `ColorAdjustment` replacing the given source color.
`ColorAdjustmentSet` `getCopy()` Returns a copy of this `ColorAdjustmentSet`.
`Color` `getNonWhite()` Returns the `Color` used to replace non-white `Color`s with.
`ColorAdjustment` `getNonWhiteAdjustment()` Returns the non-white replacement `Color`.
`Number` `getOpacity()` Returns the opacity of the non-white replacement `Color`.
`int` `hashCode()`
`boolean` `isEmpty()` Returns `true` if this `ColorAdjustmentSet` contains no key-value mappings.
`Iterator` `iterator()` Returns a read/only `Iterator` of `ColorAjustments`.
`Set` `keySet()` Returns a read/only `Set<Color>` view of the source colors contained in this `ColorAdjustmentSet`.
`void` `remove(Color sourceColor)` Removes the `ColorAdjustment` from this set if its source color equals the given color.
`void` `setNonWhite(Color color)` Sets the non-white color replacement.
`void` `setNonWhite(ColorAdjustment colorAdjustment)` Sets the non-white `ColorAdjustment`.
`void` `setOpacity(Number opacity)` Sets the opacity for non-white `Color`.
`int` `size()` Returns the number of `ColorAdjustment`s in this `ColorAdjustmentSet`.

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.lang.Iterable

`forEach, spliterator`

### Constructor Detail

#### ColorAdjustmentSet

    public ColorAdjustmentSet()

Constructs an empty set of color adjustments.

### Method Detail

#### add

    public void add(Color sourceColor,
                    ColorAdjustment adjustment)

Adds the specified `ColorAdjustment` to this set. The source color will be replaced by the given `ColorAdjustment`. Neither the source color nor the `ColorAdjustment` can be null.

Parameters:
  `sourceColor` - the source code to be replaced.
  `adjustment` - the destination color and the color opacity.

#### containsSourceColor

    public boolean containsSourceColor(Color sourceColor)

Returns `true` if this set contains a mapping for the specified source color with identical RGB value.

Parameters:
  `sourceColor` - the source color.

#### remove

    public void remove(Color sourceColor)

Removes the `ColorAdjustment` from this set if its source color equals the given color.

Parameters:
  `sourceColor` - the source color of the `ColorAdjustment` to be removed.

#### get

    public ColorAdjustment get(Color sourceColor)

Gets the `ColorAdjustment` replacing the given source color.

Parameters:
  `sourceColor` - the source color of the `ColorAdjustment`.
Returns:
  the `ColorAdjustment` by the given source color or null.

#### iterator

    public Iterator iterator()

Returns a read/only `Iterator` of `ColorAjustments`.

Specified by:
  `iterator` in interface `Iterable`

#### clear

    public void clear()

Removes all of the elements from this set.

#### isEmpty

    public boolean isEmpty()

Returns `true` if this `ColorAdjustmentSet` contains no key-value mappings.

Returns:
  `true` if this `ColorAdjustmentSet` contains no key-value mappings.

#### size

    public int size()

Returns the number of `ColorAdjustment`s in this `ColorAdjustmentSet`.

Returns:
  the number of `ColorAdjustment`s in this `ColorAdjustmentSet`.

#### keySet

    public Set keySet()

Returns a read/only `Set<Color>` view of the source colors contained in this `ColorAdjustmentSet`.

Returns:
  a read/only `Set<Color>` view of the source colors contained in this `ColorAdjustmentSet`.

#### setNonWhite

    public void setNonWhite(Color color)

Sets the non-white color replacement. Replace non-white colors to the given color with opacity as returned in `ColorAdjustmentSet.getOpacity()`. The default value is null. To disable the replacement of nonWhite colors call this method with a null parameter.

Parameters:
  `color` - the replacement color.

#### getNonWhite

    public Color getNonWhite()

Returns the `Color` used to replace non-white `Color`s with.

Returns:
  the `Color` used to replace non-white `Color`s with.

#### setNonWhite

    public void setNonWhite(ColorAdjustment colorAdjustment)

Sets the non-white `ColorAdjustment`. Replace non-white colors to the given color and opacity. The default value is null. To disable the replacement of nonWhite colors call this method with a null parameter.

Parameters:
  `colorAdjustment` - the replacement color.

#### setOpacity

    public void setOpacity(Number opacity)

Sets the opacity for non-white `Color`.

Parameters:
  `opacity` - a double value.

#### getOpacity

    public Number getOpacity()

Returns the opacity of the non-white replacement `Color`.

Returns:
  the opacity of the non-white replacement `Color`.

#### getNonWhiteAdjustment

    public ColorAdjustment getNonWhiteAdjustment()

Returns the non-white replacement `Color`.

Returns:
  the non-white replacement `Color`.

#### equals

    public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### getCopy

    public ColorAdjustmentSet getCopy()

Returns a copy of this `ColorAdjustmentSet`. Changes to the returned `ColorAdjustmentSet` will not be reflected in this `ColorAdjustmentSet`.

Returns:
  a copy of this `ColorAdjustmentSet`.