public class CachedImageBevelBorder extends CachedPainter implements javax.swing.border.Border
The insets and the size of the image are used do determine which parts of the image shall be used to draw the corners and edges of the bevel as well the fill area.
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 |
|---|
CachedImageBevelBorder(java.awt.Image img,
java.awt.Insets borderInsets)
Creates a new instance with the given image and insets.
|
CachedImageBevelBorder(java.awt.Image img,
java.awt.Insets imageInsets,
java.awt.Insets borderInsets)
Creates a new instance with the given image and insets.
|
CachedImageBevelBorder(java.awt.Image img,
java.awt.Insets imageInsets,
java.awt.Insets borderInsets,
boolean fillContentArea)
Creates a new instance with the given image and insets.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.awt.Image |
createImage(java.awt.Component c,
int w,
int h,
java.awt.GraphicsConfiguration config)
Creates the image to cache.
|
java.awt.Insets |
getBorderInsets(java.awt.Component c)
Returns the insets of the border.
|
boolean |
isBorderOpaque()
Returns true if the border is opaque.
|
void |
paintBorder(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.
|
protected void |
paintToImage(java.awt.Component c,
java.awt.Graphics gr,
int width,
int height,
java.lang.Object[] args)
Paints the representation to cache to the supplied Graphics.
|
paint, paintImagepublic CachedImageBevelBorder(java.awt.Image img,
java.awt.Insets borderInsets)
public CachedImageBevelBorder(java.awt.Image img,
java.awt.Insets imageInsets,
java.awt.Insets borderInsets)
public CachedImageBevelBorder(java.awt.Image img,
java.awt.Insets imageInsets,
java.awt.Insets borderInsets,
boolean fillContentArea)
public boolean isBorderOpaque()
isBorderOpaque in interface javax.swing.border.Borderpublic java.awt.Insets getBorderInsets(java.awt.Component c)
getBorderInsets in interface javax.swing.border.Borderc - the component for which this border insets value appliespublic void paintBorder(java.awt.Component c,
java.awt.Graphics gr,
int x,
int y,
int width,
int height)
paintBorder in interface javax.swing.border.Borderc - 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 borderprotected java.awt.Image createImage(java.awt.Component c,
int w,
int h,
java.awt.GraphicsConfiguration config)
createImage in class CachedPainterc - Component painting tow - Width of image to createh - Height to image to createconfig - GraphicsConfiguration that will be
rendered to, this may be null.protected void paintToImage(java.awt.Component c,
java.awt.Graphics gr,
int width,
int height,
java.lang.Object[] args)
CachedPainterpaintToImage in class CachedPainterc - Component painting togr - Graphics to paint towidth - Width to paint toheight - Height to paint toargs - Arguments supplied to paint