geotools/geotools — pull request #32 by sgraca (2012-09-22 13:21:57+00:00)
Title: Support to quickly switch layer labels on/off or set layer/label transparency without changing layer style

Achieving the same effect as setting transparency at layer level by using SLD only seems impossible. For example if two objects overlaps each other and are both filled with solid blue. The effect of applying 50% transparency to image when both objects are already drawn and filling them separately with 50% transparent blue color are different (in second case the overlapping region will be darker).

An opacity property was added to class org.geotools.map.Layer and labelOpacity and hideLabels properties were added to class org.geotools.map.FeatureLayer. The renderer classes were modified to take these properties into account.
The interface org.geotools.renderer.lite.LabelCache had to be modified. A new parameter was added to startLayer method.