|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.swt.graphics.Resource
org.eclipse.swt.graphics.Pattern
public class Pattern
Instances of this class represent patterns to use while drawing. Patterns can be specified either as bitmaps or gradients.
Application code must explicitly invoke the Pattern.dispose()
method to release the operating system resources managed by each instance
when those instances are no longer required.
This class requires the operating system's advanced graphics subsystem which may not be available on some platforms.
Field Summary | |
---|---|
long |
handle
the OS resource for the Pattern (Warning: This field is platform dependent) |
Constructor Summary | |
---|---|
Pattern(Device device,
float x1,
float y1,
float x2,
float y2,
Color color1,
Color color2)
Constructs a new Pattern that represents a linear, two color gradient. |
|
Pattern(Device device,
float x1,
float y1,
float x2,
float y2,
Color color1,
int alpha1,
Color color2,
int alpha2)
Constructs a new Pattern that represents a linear, two color gradient. |
|
Pattern(Device device,
Image image)
Constructs a new Pattern given an image. |
Method Summary | |
---|---|
boolean |
isDisposed()
Returns true if the Pattern has been disposed,
and false otherwise. |
java.lang.String |
toString()
Returns a string containing a concise, human-readable description of the receiver. |
Methods inherited from class org.eclipse.swt.graphics.Resource |
---|
dispose, getDevice |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public long handle
IMPORTANT: This field is not part of the SWT public API. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms and should never be accessed from application code.
Constructor Detail |
---|
public Pattern(Device device, Image image)
This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms.
device
- the device on which to allocate the patternimage
- the image that the pattern will draw
java.lang.IllegalArgumentException
- SWTException
- SWTError
- Resource.dispose()
public Pattern(Device device, float x1, float y1, float x2, float y2, Color color1, Color color2)
This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms.
device
- the device on which to allocate the patternx1
- the x coordinate of the starting corner of the gradienty1
- the y coordinate of the starting corner of the gradientx2
- the x coordinate of the ending corner of the gradienty2
- the y coordinate of the ending corner of the gradientcolor1
- the starting color of the gradientcolor2
- the ending color of the gradient
java.lang.IllegalArgumentException
- SWTException
- SWTError
- Resource.dispose()
public Pattern(Device device, float x1, float y1, float x2, float y2, Color color1, int alpha1, Color color2, int alpha2)
This operation requires the operating system's advanced graphics subsystem which may not be available on some platforms.
device
- the device on which to allocate the patternx1
- the x coordinate of the starting corner of the gradienty1
- the y coordinate of the starting corner of the gradientx2
- the x coordinate of the ending corner of the gradienty2
- the y coordinate of the ending corner of the gradientcolor1
- the starting color of the gradientalpha1
- the starting alpha value of the gradientcolor2
- the ending color of the gradientalpha2
- the ending alpha value of the gradient
java.lang.IllegalArgumentException
- SWTException
- SWTError
- Resource.dispose()
Method Detail |
---|
public boolean isDisposed()
true
if the Pattern has been disposed,
and false
otherwise.
This method gets the dispose state for the Pattern. When a Pattern has been disposed, it is an error to invoke any other method using the Pattern.
isDisposed
in class Resource
true
when the Pattern is disposed, and false
otherwisepublic java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |