public class BevelRenderer
extends java.lang.Object
For example, if you provide an image of size 10,10 and a insets of size 2, 2, 4, 4, then the corners of the border are made up of top left: 2,2, top right: 2,4, bottom left: 2,4, bottom right: 4,4 rectangle of the image. The inner area of the image is used to fill the inner area.
Constructor and Description |
---|
BevelRenderer()
Creates a new BevelRenderer without an image and without zero insets.
|
BevelRenderer(java.awt.Image img,
java.awt.Insets insets)
Creates a new BevelRenderer without the given image and insets.
|
Modifier and Type | Method and Description |
---|---|
java.awt.Image |
getImage()
Gets the image to be used for border painting.
|
int |
getImageHeight() |
java.awt.Insets |
getImageInsets()
Gets the insets of the image.
|
int |
getImageWidth() |
void |
paintBevel(java.awt.Component c,
java.awt.Graphics gr,
int x,
int y,
int width,
int height)
Paints the bevel image for the specified component with the
specified position and size.
|
void |
setImage(java.awt.Image img)
Sets the image to be used for border painting.
|
void |
setImageInsets(java.awt.Insets insets)
Sets the insets of the image.
|
public BevelRenderer()
public BevelRenderer(java.awt.Image img, java.awt.Insets insets)
public void setImage(java.awt.Image img)
public java.awt.Image getImage()
public int getImageHeight()
public int getImageWidth()
public void setImageInsets(java.awt.Insets insets)
public java.awt.Insets getImageInsets()
public void paintBevel(java.awt.Component c, java.awt.Graphics gr, int x, int y, int width, int height)
c
- the component for which this border is being paintedgr
- the paint graphicsx
- the x position of the painted bordery
- the y position of the painted borderwidth
- the width of the painted borderheight
- the height of the painted border