|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.graphics.device.awt.AWTPaintContext
com.tensegrity.graphics.device.awt.AWTGradientPaintContext
The AWTGradientPaintContext is an implementation of the
PaintContext interface that is used by the
AWTDevice to render gradients.
| Field Summary | |
protected int |
alpha
instance variable for the alpha value when writing a pixel |
static java.awt.image.ColorModel |
argbmodel
constant that defines a ColorModel that do support
alpha values |
protected double |
transparency
instance variable for the transparency level in percent |
protected int |
txOrg
instance variable for the origin translation in x direction |
protected int |
tyOrg
instance variable for the origin translation in y direction |
static java.awt.image.ColorModel |
xrgbmodel
constant that defines a ColorModel that do not support
alpha values |
| Constructor Summary | |
AWTGradientPaintContext(Gradient gradient,
java.awt.Rectangle rcPaint,
int transparency)
Constructor that creates a AWTGradientPaintContext with the
Gradient given by gradient, the transparency
level given by transparency that renders within the
Rectangle given by rcPaint. |
|
| Method Summary | |
void |
dispose()
|
protected void |
fillCenterCircle(java.awt.image.DataBuffer pixels,
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 DataBuffer
given by pixels. |
protected void |
fillCenterSquared(java.awt.image.DataBuffer pixels,
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 DataBuffer
given by pixels. |
protected void |
fillDown(java.awt.image.DataBuffer pixels,
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 DataBuffer
given by pixels. |
protected void |
fillDownCenter(java.awt.image.DataBuffer pixels,
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 DataBuffer
given by pixels. |
protected void |
fillHorizontalCenter(java.awt.image.DataBuffer pixels,
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 DataBuffer
given by pixels. |
protected void |
fillLeftBottom(java.awt.image.DataBuffer pixels,
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 DataBuffer
given by pixels. |
protected void |
fillLeftTop(java.awt.image.DataBuffer pixels,
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 DataBuffer
given by pixels. |
protected void |
fillLeftTopCircle(java.awt.image.DataBuffer pixels,
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 DataBuffer
given by pixels. |
protected void |
fillRightBottom(java.awt.image.DataBuffer pixels,
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 DataBuffer
given by pixels. |
protected void |
fillRightLeft(java.awt.image.DataBuffer pixels,
int w,
int h)
Renders the gradient from right to left for the width and height given by w and h into the DataBuffer
given by pixels. |
protected void |
fillRightTop(java.awt.image.DataBuffer pixels,
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 DataBuffer
given by pixels. |
protected void |
fillRightTopCircle(java.awt.image.DataBuffer pixels,
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 DataBuffer
given by pixels. |
protected void |
fillTopBottom(java.awt.image.DataBuffer pixels,
int w,
int h)
Renders the gradient from top to bottom for the width and height given by w and h into the DataBuffer
given by pixels. |
protected void |
fillUp(java.awt.image.DataBuffer pixels,
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 DataBuffer
given by pixels. |
protected void |
fillUpCenter(java.awt.image.DataBuffer pixels,
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 DataBuffer
given by pixels. |
protected void |
fillVerticalCenter(java.awt.image.DataBuffer pixels,
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 DataBuffer
given by pixels. |
java.awt.image.ColorModel |
getColorModel()
|
java.awt.image.Raster |
getRaster(int x,
int y,
int w,
int h)
|
static int[] |
renderColorGradient(int alpha,
int rgbFrom,
int rgbTo,
boolean cyclic)
Computes the color values used to render a gradient and returns them in an integer array. |
void |
setColorModel(boolean hasAlpha)
Sets the ColorModel for the AWTPaintContext
with respect to the flag given by hasAlpha that indicates
whether the AWTPaintContext should support transparency or
not. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static java.awt.image.ColorModel xrgbmodel
ColorModel that do not support
alpha values
public static java.awt.image.ColorModel argbmodel
ColorModel that do support
alpha values
protected double transparency
protected int alpha
protected int txOrg
protected int tyOrg
| Constructor Detail |
public AWTGradientPaintContext(Gradient gradient,
java.awt.Rectangle rcPaint,
int transparency)
AWTGradientPaintContext with the
Gradient given by gradient, the transparency
level given by transparency that renders within the
Rectangle given by rcPaint.
gradient - the Gradient to usercPaint - the Rectangle to render withintransparency - the transparency level given in percent| Method Detail |
public java.awt.image.Raster getRaster(int x,
int y,
int w,
int h)
protected void fillRightLeft(java.awt.image.DataBuffer pixels,
int w,
int h)
w and h into the DataBuffer
given by pixels.
pixels - the DataBuffer to render the gradient intow - the width for the gradienth - the height for the gradient
protected void fillVerticalCenter(java.awt.image.DataBuffer pixels,
int w,
int h)
w and h into the DataBuffer
given by pixels.
pixels - the DataBuffer to render the gradient intow - the width for the gradienth - the height for the gradient
protected void fillTopBottom(java.awt.image.DataBuffer pixels,
int w,
int h)
w and h into the DataBuffer
given by pixels.
pixels - the DataBuffer to render the gradient intow - the width for the gradienth - the height for the gradient
protected void fillHorizontalCenter(java.awt.image.DataBuffer pixels,
int w,
int h)
w and h into the DataBuffer
given by pixels.
pixels - the DataBuffer to render the gradient intow - the width for the gradienth - the height for the gradient
protected void fillUp(java.awt.image.DataBuffer pixels,
int w,
int h)
w and h into the DataBuffer
given by pixels.
pixels - the DataBuffer to render the gradient intow - the width for the gradienth - the height for the gradient
protected void fillUpCenter(java.awt.image.DataBuffer pixels,
int w,
int h)
w and h into the DataBuffer
given by pixels.
pixels - the DataBuffer to render the gradient intow - the width for the gradienth - the height for the gradient
protected void fillDown(java.awt.image.DataBuffer pixels,
int w,
int h)
w and h into the DataBuffer
given by pixels.
pixels - the DataBuffer to render the gradient intow - the width for the gradienth - the height for the gradient
protected void fillDownCenter(java.awt.image.DataBuffer pixels,
int w,
int h)
w and h into the DataBuffer
given by pixels.
pixels - the DataBuffer to render the gradient intow - the width for the gradienth - the height for the gradient
protected void fillLeftBottom(java.awt.image.DataBuffer pixels,
int w,
int h)
w and h into the DataBuffer
given by pixels.
pixels - the DataBuffer to render the gradient intow - the width for the gradienth - the height for the gradient
protected void fillRightBottom(java.awt.image.DataBuffer pixels,
int w,
int h)
w and h into the DataBuffer
given by pixels.
pixels - the DataBuffer to render the gradient intow - the width for the gradienth - the height for the gradient
protected void fillLeftTop(java.awt.image.DataBuffer pixels,
int w,
int h)
w and h into the DataBuffer
given by pixels.
pixels - the DataBuffer to render the gradient intow - the width for the gradienth - the height for the gradient
protected void fillRightTop(java.awt.image.DataBuffer pixels,
int w,
int h)
w and h into the DataBuffer
given by pixels.
pixels - the DataBuffer to render the gradient intow - the width for the gradienth - the height for the gradient
protected void fillCenterSquared(java.awt.image.DataBuffer pixels,
int w,
int h)
w and h into the DataBuffer
given by pixels.
pixels - the DataBuffer to render the gradient intow - the width for the gradienth - the height for the gradient
protected void fillCenterCircle(java.awt.image.DataBuffer pixels,
int w,
int h)
w and h into the DataBuffer
given by pixels.
pixels - the DataBuffer to render the gradient intow - the width for the gradienth - the height for the gradient
protected void fillLeftTopCircle(java.awt.image.DataBuffer pixels,
int w,
int h)
w and h into the DataBuffer
given by pixels.
pixels - the DataBuffer to render the gradient intow - the width for the gradienth - the height for the gradient
protected void fillRightTopCircle(java.awt.image.DataBuffer pixels,
int w,
int h)
w and h into the DataBuffer
given by pixels.
pixels - the DataBuffer to render the gradient intow - the width for the gradienth - the height for the gradient
public static int[] renderColorGradient(int alpha,
int rgbFrom,
int rgbTo,
boolean cyclic)
rgbFrom and goes up to rgbTo. For a simple
gradient this makes up 256 color values; for a cyclic gradient this
makes up 512 color values. A cyclic gradient is indicated by the given
flag cyclic.
alpha is used for
each computet color value.
alpha - the alpha value for each computet colorrgbFrom - the rgb value where to startrgbTo - the rgb value where to stopcyclic - flag that indicates a cyclic gradient
public void setColorModel(boolean hasAlpha)
ColorModel for the AWTPaintContext
with respect to the flag given by hasAlpha that indicates
whether the AWTPaintContext should support transparency or
not.
hasAlpha - flag that indicates whether alpha values should be
supported or notpublic void dispose()
dispose in interface java.awt.PaintContextpublic java.awt.image.ColorModel getColorModel()
getColorModel in interface java.awt.PaintContext
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||