|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.border.AbstractBorder
contrib.com.blogofbug.swing.borders.ImageBorder
public class ImageBorder
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
|
Constructor Summary | |
---|---|
ImageBorder(java.awt.image.BufferedImage borderImage,
java.awt.Insets imageInsets)
Creates a new ImageBorder using the supplied image and the insets |
|
ImageBorder(java.net.URL imageURL,
java.awt.Insets imageInsets)
Creates a new ImageBofder loading the image from the supplied URL |
Method Summary | |
---|---|
java.awt.Insets |
getBorderInsets(java.awt.Component c)
Gets the insets of the image back (subtracting from the component size would give you the renderable area |
java.awt.Insets |
getBorderInsets(java.awt.Component c,
java.awt.Insets i)
Gets the insets of the image and returns in the in the supplied Insets instance |
void |
paintBorder(java.awt.Component c,
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,
java.awt.Component c)
|
void |
setPaintBorder(boolean paintBorder)
Controls wether or not the border is actually painted or not. |
Methods inherited from class javax.swing.border.AbstractBorder |
---|
getBaseline, getBaselineResizeBehavior, getInteriorRectangle, getInteriorRectangle, isBorderOpaque |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected AbstractImageBorder borderRenderer
Constructor Detail |
---|
public ImageBorder(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 borderpublic ImageBorder(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 borderMethod Detail |
---|
public void paintBorder(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)
paintBorder
in interface javax.swing.border.Border
paintBorder
in class javax.swing.border.AbstractBorder
c
- 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 java.awt.Insets getBorderInsets(java.awt.Component c)
getBorderInsets
in interface javax.swing.border.Border
getBorderInsets
in class javax.swing.border.AbstractBorder
c
- The component to which the border will be applied
public java.awt.Insets getBorderInsets(java.awt.Component c, java.awt.Insets i)
getBorderInsets
in class javax.swing.border.AbstractBorder
c
- The component to which the border will be appliedi
- A pre-created insets object
public void paintCenter(java.awt.Graphics2D g2, java.awt.Component c)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |