Constructs a new Pattern that represents a linear, two color
gradient. Drawing with the pattern will cause the resulting area to be
tiled with the gradient specified by the arguments.
<p>
This operation requires the operating system's advanced
graphics subsystem which may not be available on some
platforms.
</p>
@param device the device on which to allocate the pattern
@param x1 the x coordinate of the starting corner of the gradient
@param y1 the y coordinate of the starting corner of the gradient
@param x2 the x coordinate of the ending corner of the gradient
@param y2 the y coordinate of the ending corner of the gradient
@param color1 the starting color of the gradient
@param color2 the ending color of the gradient
@exception IllegalArgumentException <ul>
<li>ERROR_NULL_ARGUMENT - if the device is null and there is no current device,
or if either color1 or color2 is null</li>
<li>ERROR_INVALID_ARGUMENT - if either color1 or color2 has been disposed</li>
</ul>
@exception SWTException <ul>
<li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
</ul>
@exception SWTError <ul>
<li>ERROR_NO_HANDLES if a handle for the pattern could not be obtained</li>
</ul>
Constructs a new Pattern that represents a linear, two color gradient. Drawing with the pattern will cause the resulting area to be tiled with the gradient specified by the arguments. <p> This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms. </p>
@param device the device on which to allocate the pattern @param x1 the x coordinate of the starting corner of the gradient @param y1 the y coordinate of the starting corner of the gradient @param x2 the x coordinate of the ending corner of the gradient @param y2 the y coordinate of the ending corner of the gradient @param color1 the starting color of the gradient @param color2 the ending color of the gradient
@exception IllegalArgumentException <ul> <li>ERROR_NULL_ARGUMENT - if the device is null and there is no current device, or if either color1 or color2 is null</li> <li>ERROR_INVALID_ARGUMENT - if either color1 or color2 has been disposed</li> </ul> @exception SWTException <ul> <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li> </ul> @exception SWTError <ul> <li>ERROR_NO_HANDLES if a handle for the pattern could not be obtained</li> </ul>
@see #dispose()