|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjavax.swing.border.AbstractBorder
com.blogofbug.swing.borders.ImageBorder
public class ImageBorder extends AbstractBorder
ImageBorder takes an image and breaks out the corners and the top, left, right, and bottom borders stretching them to fill the space around which the border is drawn
| Field Summary | |
|---|---|
protected AbstractImageBorder |
borderRenderer
|
boolean |
paintBorder
|
| Constructor Summary | |
ImageBorder(BufferedImage borderImage, Insets imageInsets)
Creates a new ImageBorder using the supplied image and the insets |
|
ImageBorder(URL imageURL, Insets imageInsets)
Creates a new ImageBofder loading the image from the supplied URL |
|
| Method Summary | |
|---|---|
Insets
|
getBorderInsets(Component c)
Gets the insets of the image back (subtracting from the component size would give you the renderable area |
Insets
|
getBorderInsets(Component c, Insets i)
Gets the insets of the image and returns in the in the supplied Insets instance |
void
|
paintBorder(Component c, Graphics g, int x, int y, int width, int height)
Paints the border around the specified component |
void
|
paintCenter(Graphics2D g2, Component c)
|
void
|
setPaintBorder(boolean paintBorder)
Controls wether or not the border is actually painted or not. |
| Methods inherited from class AbstractBorder | |
|---|---|
| getBaseline, getBaselineResizeBehavior, paintBorder, getBorderInsets, getBorderInsets, isBorderOpaque, getInteriorRectangle, getInteriorRectangle, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
| Methods inherited from class Object | |
|---|---|
| wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
| Field Detail |
|---|
protected AbstractImageBorder borderRenderer
boolean paintBorder
| Constructor Detail |
|---|
public ImageBorder(BufferedImage borderImage, 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 border
public ImageBorder(URL imageURL, 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 border
| Method Detail |
|---|
public Insets getBorderInsets(Component c)
c - The component to which the border will be applied
public Insets getBorderInsets(Component c, Insets i)
c - The component to which the border will be appliedi - A pre-created insets object
public void paintBorder(Component c, 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 height
public void paintCenter(Graphics2D g2, Component c)
public void setPaintBorder(boolean paintBorder)
paintBorder - If false then will not draw the border. Useful if the border is being used to show a selected item
Groovy Documentation