|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.enough.polish.ui.Background
de.enough.polish.ui.backgrounds.ImageBackground
public class ImageBackground
Paints an image as a background.
Following CSS parameters are supported:
Copyright Enough Software 2004 - 2009
history
14-Mar-2004 - rob creation
| Field Summary |
|---|
| Fields inherited from class de.enough.polish.ui.Background |
|---|
borderWidth |
| Constructor Summary | |
|---|---|
ImageBackground(int color,
Image image,
int anchor)
Creates a new image background. |
|
ImageBackground(int color,
Image image,
int anchor,
Dimension xOffset,
Dimension yOffset)
Creates a new image background. |
|
ImageBackground(int color,
Image image,
int anchor,
int xOffset,
int yOffset)
Creates a new image background. |
|
ImageBackground(int color,
String imageUrl,
int anchor)
Creates a new image background. |
|
ImageBackground(int color,
String imageUrl,
int anchor,
Dimension xOffset,
Dimension yOffset)
Creates a new image background. |
|
ImageBackground(int color,
String imageUrl,
int anchor,
int xOffset,
int yOffset)
Creates a new image background. |
|
| Method Summary | |
|---|---|
Image |
getImage()
Retrieves the image from this background. |
void |
paint(int x,
int y,
int width,
int height,
Graphics g)
Paints this background. |
void |
releaseResources()
Releases all (memory intensive) resources such as images or RGB arrays of this background. |
void |
setImage(Image image)
Sets the image for this background. |
void |
setImage(String url,
Image image)
sets the image which has been loaded in the background. |
void |
setStyle(Style style)
Allows backgrounds to be animated using CSS attribute animations. |
| Methods inherited from class de.enough.polish.ui.Background |
|---|
addRelativeToBackgroundRegion, animate, animate, hideNotify, showNotify |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ImageBackground(int color,
String imageUrl,
int anchor)
color - the background color or Item.TRANSPARENTimageUrl - the url of the image, e.g. "/bg.png", must not be null!anchor - the anchor of the image, either "left", "right",
"center" (="horizontal-center"), "vertical-center", "top" or "bottom"
or any combinationof these values. Defaults to "horizontal-center | vertical-center"
public ImageBackground(int color,
String imageUrl,
int anchor,
int xOffset,
int yOffset)
color - the background color or Item.TRANSPARENTimageUrl - the url of the image, e.g. "/bg.png", must not be null!anchor - the anchor of the image, either "left", "right",
"center" (="horizontal-center"), "vertical-center", "top" or "bottom"
or any combination of these values. Defaults to "horizontal-center | vertical-center"xOffset - The number of pixels to move the image horizontally, negative values move it to the left.yOffset - The number of pixels to move the image vertically, negative values move it to the top.
public ImageBackground(int color,
String imageUrl,
int anchor,
Dimension xOffset,
Dimension yOffset)
color - the background color or Item.TRANSPARENTimageUrl - the url of the image, e.g. "/bg.png", must not be null!anchor - the anchor of the image, either "left", "right",
"center" (="horizontal-center"), "vertical-center", "top" or "bottom"
or any combination of these values. Defaults to "horizontal-center | vertical-center"xOffset - The number of pixels to move the image horizontally, negative values move it to the left.yOffset - The number of pixels to move the image vertically, negative values move it to the top.
public ImageBackground(int color,
Image image,
int anchor)
color - the background color or Item.TRANSPARENTimage - the image, must not be null!anchor - the anchor of the image, either "left", "right",
"center" (="horizontal-center"), "vertical-center", "top" or "bottom"
or any combination of these values. Defaults to "horizontal-center | vertical-center"
public ImageBackground(int color,
Image image,
int anchor,
int xOffset,
int yOffset)
color - the background color or Item.TRANSPARENTimage - the image, must not be null!anchor - the anchor of the image, either "left", "right",
"center" (="horizontal-center"), "vertical-center", "top" or "bottom"
or any combinationof these values. Defaults to "horizontal-center | vertical-center"xOffset - The number of pixels to move the image horizontally, negative values move it to the left.yOffset - The number of pixels to move the image vertically, negative values move it to the top.
public ImageBackground(int color,
Image image,
int anchor,
Dimension xOffset,
Dimension yOffset)
color - the background color or Item.TRANSPARENTimage - the image, must not be null!anchor - the anchor of the image, either "left", "right",
"center" (="horizontal-center"), "vertical-center", "top" or "bottom"
or any combinationof these values. Defaults to "horizontal-center | vertical-center"xOffset - The number of pixels to move the image horizontally, negative values move it to the left.yOffset - The number of pixels to move the image vertically, negative values move it to the top.| Method Detail |
|---|
public void setImage(String url,
Image image)
ImageConsumer
setImage in interface ImageConsumerurl - the name of the image.
This allows the image-consumer to differentiate between several images.image - the image which was loaded in the background thread.
public void paint(int x,
int y,
int width,
int height,
Graphics g)
Background
paint in class Backgroundx - the horizontal start pointy - the vertical start pointwidth - the width of the backgroundheight - the height of the backgroundg - the Graphics on which the background should be painted.public void setImage(Image image)
image - the imagepublic Image getImage()
public void releaseResources()
releaseResources in class Backgroundpublic void setStyle(Style style)
Background
setStyle in class Backgroundstyle - the style containing typically only one element
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||