|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcontrib.com.blogofbug.swing.borders.AbstractImageBorder
public class AbstractImageBorder
Field Summary | |
---|---|
protected java.awt.image.BufferedImage |
borderImage
|
protected java.awt.Insets |
imageInsets
|
Constructor Summary | |
---|---|
AbstractImageBorder(java.awt.image.BufferedImage borderImage,
java.awt.Insets imageInsets)
Creates a new ImageBorder using the supplied image and the insets |
|
AbstractImageBorder(java.net.URL imageURL,
java.awt.Insets imageInsets)
Creates a new ImageBofder loading the image from the supplied URL |
Method Summary | |
---|---|
java.awt.Insets |
getImageInsets()
|
void |
paintBorder(int compWidth,
int compHeight,
java.awt.Graphics g,
int x,
int y,
int width,
int height)
Paints the border around the specified component |
void |
paintCenter(java.awt.Graphics2D g2,
int compWidth,
int compHeight)
Paints a stretched version of the center of the image (as the border is drawn first, then the component paints itself) so that the component can use it in its own paint if the border lends itself to having a centre area over-painted |
void |
setInsets(java.awt.Insets insets)
Sets the insets around the edge of the image to be used to cookie cut the image into a border |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.awt.image.BufferedImage borderImage
protected java.awt.Insets imageInsets
Constructor Detail |
---|
public AbstractImageBorder(java.net.URL imageURL, java.awt.Insets imageInsets)
imageURL
- The location of the image to useimageInsets
- The insets around the edge of the image that allow the cookie-cut-and-stretch of the image
around the edge of the borderpublic AbstractImageBorder(java.awt.image.BufferedImage borderImage, java.awt.Insets imageInsets)
borderImage
- The image to be used as the borderimageInsets
- The insets around the edge of the image that allow the cookie-cut-and-stretch of the image
around the edge of the borderMethod Detail |
---|
public void paintBorder(int compWidth, int compHeight, java.awt.Graphics g, int x, int y, int width, int height)
c
- The component to paint the border ong
- The graphics contextx
- The x offsety
- The y offsetwidth
- The widthheight
- The heightpublic void setInsets(java.awt.Insets insets)
insets
- The edges of the imagepublic java.awt.Insets getImageInsets()
public void paintCenter(java.awt.Graphics2D g2, int compWidth, int compHeight)
g2
- The graphics contextc
- The component
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |