Community
Participate
Working Groups
Build ID: I20090611-1540 Steps To Reproduce: Currently, SWT's Pattern class can only be created with two stops (points). This has been the case with JDK's GradientPaint up until JDK 1.6 which has added LinearGradientPaint. This class comes in very handy for creating modern multi-stop gradient fills. Looking at the Pattern implementation - specifically line 197: Gdip.LinearGradientBrush_SetInterpolationColors(handle, new int /*long*/ []{foreColor, midColor, backColor}, new float[]{0, 0.5f, 1}, 3); it does seem that the internal SWT classes do support multi-stop patterns. Here is a use case: https://pushingpixels.dev.java.net/images/granite/albumloading.png This shows a progress bar that uses four-stop painting of the stripes. I cannot use the two 2-stop patterns and paint it as separate lines, since the seam between the two lines will not be horizontal. As it stands now, i need to create two 2-stop patterns, and a polygon for each one of them. Ideally, i would create a 4-stop pattern, set line attributes to paint a thick line and just paint one line. More information:
Patches are welcome. :)