Serializable, Borderpublic class ImageBorder extends AbstractBorder
| Modifier and Type | Field | Description |
|---|---|---|
protected AbstractImageBorder |
borderRenderer |
| Constructor | Description |
|---|---|
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
|
| Modifier and Type | Method | Description |
|---|---|---|
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.
|
getBaseline, getBaselineResizeBehavior, getInteriorRectangle, getInteriorRectangle, isBorderOpaqueprotected AbstractImageBorder borderRenderer
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 borderpublic 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 borderpublic void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
paintBorder in interface BorderpaintBorder in class AbstractBorderc - The component to paint the border ong - The graphics contextx - The x offsety - The y offsetwidth - The widthheight - The heightpublic void setPaintBorder(boolean paintBorder)
paintBorder - If false then will not draw the border. Useful if the border is being used to show a selected itempublic Insets getBorderInsets(Component c)
getBorderInsets in interface BordergetBorderInsets in class AbstractBorderc - The component to which the border will be appliedpublic Insets getBorderInsets(Component c, Insets i)
getBorderInsets in class AbstractBorderc - The component to which the border will be appliedi - A pre-created insets objectpublic void paintCenter(Graphics2D g2, Component c)