Community
Participate
Working Groups
The Graphics#getColor() and Graphics#getFont() methods are obsoleted by the fly-weights approach. They should be deprecated as they provide no value-add compared to the constructors. Graphics#getImage() methods are not so clear. These methods still have an advantage over constructors - the receive an additional parameter that is used as caching key internally. On the other hand, caching can be done by using JFace registries, or in case of an RWT standalone environment, by caching ImageData. The latter is a bit less effective than Graphics#getImage() because new Image( Device, ImageData ) needs to read the data array to get the caching key. Opinions?
Maybe factory created fonts can be used as an internal undisposable font copy in some cases - see these bug 323183 and bug 321135.
I've deprecated the entire class in commit 1966db9a1f021fa86ed93c4ef4c14e26073293db. Factory-created resources are obsolete, resources should always be created using a constructor. The remaining methods were related to text size measurement, which should also be possible using SWT API (GC) with one exception: GC#textExtent() does not support a wrap-width parameter. If there is interest, we could offer a public utility class for text size measurement. I've opened bug 394169 to suggest that.