|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.graphics.device.swt.SWTGradientContext
Instances of SWTGradientContext allow the rendering of
gradients on an
object.
ImageData
The only public method
forwards its call
to the various fill(ImageData, int, int, int, int)fillXXX(ImageData , int, int) methods, each of
which is dedicated to a specific type of gradient. Please refer to these
methods' documentation for more information.
Notice:
Transparency is not managed by this class and it is the caller's
responsability to manage and adequately set it on the
ImageData passed to the
method.
fill(ImageData, int, int, int, int)
| Constructor Summary | |
SWTGradientContext(Gradient gradient,
org.eclipse.swt.graphics.Rectangle rcPaint)
Initializes and returns instances of SWTGradientContext
which will allow the creation of gradients going from the foreground
color of gradient to its background color (see
and
).
|
|
| Method Summary | |
void |
fill(org.eclipse.swt.graphics.ImageData imageData,
int x,
int y,
int w,
int h)
Method used to fill an with a specific
Gradient. |
protected void |
fillCenterCircle(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
Renders a concentric gradient from the center to all corners for the width and height given by w and h into the
ImageData given by imageData. |
protected void |
fillCenterSquared(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
Renders a squared gradient from the center to all corners for the width and height given by w and h into the
ImageData imageData. |
protected void |
fillDown(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
Renders the gradient from the left/top corner to the right/bottom corner for the width and height given by w and h
into the ImageData given by imageData. |
protected void |
fillDownCenter(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
Renders the gradient from the left/top corner to the center and vice versa from the center to the right/bottom corner for the width and height given by w and h into the ImageData
given by imageData. |
protected void |
fillHorizontalCenter(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
Renders the gradient from top to the center and vice versa from the center to bottom for the width and height given by w and
h into the ImageData given by imageData. |
protected void |
fillLeftBottom(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
Renders a squared gradient from the left/bottom corner to the left/top and right/bottom corner for the width and height given by w
and h into the ImageData given by imageData. |
protected void |
fillLeftTop(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
Renders a squared gradient from the left/top corner to the left/bottom and right/top corner for the width and height given by w
and h into the ImageData given by imageData. |
protected void |
fillLeftTopCircle(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
Renders a concentric gradient from the left/top corner to the left/bottom and right/top corner for the width and height given by w and h into the ImageData
given by imageData. |
protected void |
fillRightBottom(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
Renders a squared gradient from the right/bottom corner to the right/top and left/bottom corner for the width and height given by w
and h into the ImageData given by imageData. |
protected void |
fillRightLeft(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
Renders the gradient from right to left for the width and height given by w and h into the ImageData
given by imageData. |
protected void |
fillRightTop(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
Renders a squared gradient from the right/top corner to the left/top and right/bottom corner for the width and height given by w
and h into the ImageData given by imageData. |
protected void |
fillRightTopCircle(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
Renders a concentric gradient from the right/top corner to the right/bottom and left/top corner for the width and height given by w and h into the ImageData
given by imageData. |
protected void |
fillTopBottom(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
Renders the gradient from top to bottom for the width and height given by w and h into the ImageData
given by imageData. |
protected void |
fillUp(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
Renders the gradient from the left/bottom corner to the right/top corner for the width and height given by w and h
into the ImageData given by imageData. |
protected void |
fillUpCenter(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
Renders the gradient from the left/bottom corner to the center and vice versa from the center to the right/top corner for the width and height given by w and h into the ImageData
given by imageData. |
protected void |
fillVerticalCenter(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
Renders the gradient from right to the center and vice versa from the center to the left for the width and height given by w
and h into the ImageData given by imageData. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SWTGradientContext(Gradient gradient,
org.eclipse.swt.graphics.Rectangle rcPaint)
Initializes and returns instances of SWTGradientContext
which will allow the creation of gradients going from the foreground
color of gradient to its background color (see
and
Gradient.getForeground()).
Gradient.getBackground()
gradient - the Gradient used in this context.rcPaint - the area which will be painted on.| Method Detail |
protected void fillRightLeft(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
w and h into the ImageData
given by imageData.
imageData - the ImageData to render the gradient intow - the width for the gradienth - the height for the gradient
protected void fillVerticalCenter(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
w
and h into the ImageData given by imageData.
imageData - the ImageData to render the gradient intow - the width for the gradienth - the height for the gradient
protected void fillTopBottom(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
w and h into the ImageData
given by imageData.
imageData - the ImageData to render the gradient intow - the width for the gradienth - the height for the gradient
protected void fillHorizontalCenter(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
w and
h into the ImageData given by imageData.
imageData - the ImageData to render the gradient intow - the width for the gradienth - the height for the gradient
protected void fillUp(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
w and h
into the ImageData given by imageData.
imageData - the ImageData to render the gradient intow - the width for the gradienth - the height for the gradient
protected void fillUpCenter(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
w and h into the ImageData
given by imageData.
imageData - the ImageData to render the gradient intow - the width for the gradienth - the height for the gradient
protected void fillDown(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
w and h
into the ImageData given by imageData.
imageData - the ImageData to render the gradient intow - the width for the gradienth - the height for the gradient
protected void fillDownCenter(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
w and h into the ImageData
given by imageData.
imageData - the ImageData to render the gradient intow - the width for the gradienth - the height for the gradient
protected void fillLeftBottom(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
w
and h into the ImageData given by imageData.
imageData - the ImageData to render the gradient intow - the width for the gradienth - the height for the gradient
protected void fillRightBottom(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
w
and h into the ImageData given by imageData.
imageData - the ImageData to render the gradient intow - the width for the gradienth - the height for the gradient
protected void fillLeftTop(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
w
and h into the ImageData given by imageData.
imageData - the ImageData to render the gradient intow - the width for the gradienth - the height for the gradient
protected void fillRightTop(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
w
and h into the ImageData given by imageData.
imageData - the ImageData to render the gradient intow - the width for the gradienth - the height for the gradient
protected void fillCenterSquared(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
w and h into the
ImageData imageData.
imageData - the ImageData to render the gradient intow - the width for the gradienth - the height for the gradient
public void fill(org.eclipse.swt.graphics.ImageData imageData,
int x,
int y,
int w,
int h)
ImageData with a specific
Gradient. It delegates its code to one of the
fillXXX() methods, depending on the type of the internal
Gradient instance. It is the caller's
responsability to manage and adequately set the transparency on the
passed ImageData.
imageData - the ImageData to render the gradient intox - the x coordinate of the area in device space for which colors
are generated.y - the y coordinate of the area in device space for which colors
are generated.w - the width of the area in device spaceh - the height of the area in device space
protected void fillCenterCircle(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
w and h into the
ImageData given by imageData.
imageData - the ImageData to render the gradient intow - the width for the gradienth - the height for the gradient
protected void fillLeftTopCircle(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
w and h into the ImageData
given by imageData.
imageData - the ImageData to render the gradient intow - the width for the gradienth - the height for the gradient
protected void fillRightTopCircle(org.eclipse.swt.graphics.ImageData imageData,
int w,
int h)
w and h into the ImageData
given by imageData.
imageData - the ImageData to render the gradient intow - the width for the gradienth - the height for the gradient
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||