java.lang.Object
org.monte.media.swing.border.ImageBevelBorder
- All Implemented Interfaces:
Border
- Direct Known Subclasses:
ImageBevelBorder.UIResource
Draws a filled bevel border using an image and insets.
The image must consist of a bevel and a fill area.
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.
- Author:
- Werner Randelshofer
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionImageBevelBorder(Image img, Insets borderInsets) Creates a new instance with the given image and insets.ImageBevelBorder(Image img, Insets imageInsets, Insets borderInsets) Creates a new instance with the given image and insets.ImageBevelBorder(Image img, Insets imageInsets, Insets borderInsets, boolean fillContentArea) Creates a new instance with the given image and insets. -
Method Summary
Modifier and TypeMethodDescriptionReturns the insets of the border.booleanReturns true if the border is opaque.voidpaintBorder(Component c, Graphics gr, int x, int y, int width, int height) Paints the bevel image for the specified component with the specified position and size.
-
Constructor Details
-
ImageBevelBorder
Creates a new instance with the given image and insets. The image has the same insets as the border. -
ImageBevelBorder
Creates a new instance with the given image and insets. The image has different insets than the border. -
ImageBevelBorder
public ImageBevelBorder(Image img, Insets imageInsets, Insets borderInsets, boolean fillContentArea) Creates a new instance with the given image and insets. The image has different insets than the border.
-
-
Method Details
-
isBorderOpaque
public boolean isBorderOpaque()Returns true if the border is opaque. This implementation always returns false.- Specified by:
isBorderOpaquein interfaceBorder
-
getBorderInsets
Returns the insets of the border.- Specified by:
getBorderInsetsin interfaceBorder- Parameters:
c- the component for which this border insets value applies
-
paintBorder
Paints the bevel image for the specified component with the specified position and size.- Specified by:
paintBorderin interfaceBorder- Parameters:
c- 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 border
-