public class

LoweredBorder

extends AbstractRegionPainter
implements Border
java.lang.Object
   ↳ com.sun.java.swing.plaf.nimbus.AbstractRegionPainter
     ↳ com.sun.java.swing.plaf.nimbus.LoweredBorder

Class Overview

LoweredBorder - A recessed rounded inner shadowed border. Used as the standard Nimbus TitledBorder. This class is both a painter and a swing border.

Summary

Public Constructors
LoweredBorder()
Public Methods
Insets getBorderInsets(Component c)
Returns the insets of the border.
boolean isBorderOpaque()
Returns whether or not the border is opaque.
void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
Paints the border for the specified component with the specified position and size.
Protected Methods
void doPaint(Graphics2D g, JComponent c, int width, int height, Object[] extendedCacheKeys)
Actually performs the painting operation.
Object[] getExtendedCacheKeys(JComponent c)
Get any extra attributes which the painter implementation would like to include in the image cache lookups.
AbstractRegionPainter.PaintContext getPaintContext()

Gets the PaintContext for this painting operation.

[Expand]
Inherited Methods
From class com.sun.java.swing.plaf.nimbus.AbstractRegionPainter
From class java.lang.Object
From interface com.sun.java.swing.Painter
From interface javax.swing.border.Border

Public Constructors

public LoweredBorder ()

Public Methods

public Insets getBorderInsets (Component c)

Returns the insets of the border.

Parameters
c the component for which this border insets value applies

public boolean isBorderOpaque ()

Returns whether or not the border is opaque. If the border is opaque, it is responsible for filling in it's own background when painting.

public void paintBorder (Component c, Graphics g, int x, int y, int width, int height)

Paints the border for the specified component with the specified position and size.

Parameters
c the component for which this border is being painted
g the paint graphics
x the x position of the painted border
y the y position of the painted border
width the width of the painted border
height the height of the painted border

Protected Methods

protected void doPaint (Graphics2D g, JComponent c, int width, int height, Object[] extendedCacheKeys)

Actually performs the painting operation. Subclasses must implement this method. The graphics object passed may represent the actual surface being rendererd to, or it may be an intermediate buffer. It has also been pre-translated. Simply render the component as if it were located at 0, 0 and had a width of width and a height of height. For performance reasons, you may want to read the clip from the Graphics2D object and only render within that space.

Parameters
g The Graphics2D surface to paint to
c The JComponent related to the drawing event. For example, if the region being rendered is Button, then c will be a JButton. If the region being drawn is ScrollBarSlider, then the component will be JScrollBar. This value may be null.
width The width of the region to paint. Note that in the case of painting the foreground, this value may differ from c.getWidth().
height The height of the region to paint. Note that in the case of painting the foreground, this value may differ from c.getHeight().
extendedCacheKeys The result of the call to getExtendedCacheKeys()

protected Object[] getExtendedCacheKeys (JComponent c)

Get any extra attributes which the painter implementation would like to include in the image cache lookups. This is checked for every call of the paint(g, c, w, h) method.

Parameters
c The component on the current paint call
Returns
  • Array of extra objects to be included in the cache key

protected AbstractRegionPainter.PaintContext getPaintContext ()

Gets the PaintContext for this painting operation. This method is called on every paint, and so should be fast and produce no garbage. The PaintContext contains information such as cache hints. It also contains data necessary for decoding points at runtime, such as the stretching insets, the canvas size at which the encoded points were defined, and whether the stretching insets are inverted.

This method allows for subclasses to package the painting of different states with possibly different canvas sizes, etc, into one AbstractRegionPainter implementation.

Returns
  • a PaintContext associated with this paint operation.