Package com.jgoodies.looks.common
Class ShadowPopupBorder
- java.lang.Object
-
- javax.swing.border.AbstractBorder
-
- com.jgoodies.looks.common.ShadowPopupBorder
-
- All Implemented Interfaces:
java.io.Serializable
,javax.swing.border.Border
final class ShadowPopupBorder extends javax.swing.border.AbstractBorder
A border with a drop shadow intended to be used as the outer border of popups. Can paint the screen background if used with heavy-weight popup windows.- Version:
- $Revision: 1.9 $
- See Also:
ShadowPopup
,ShadowPopupFactory
-
-
Field Summary
Fields Modifier and Type Field Description private static ShadowPopupBorder
instance
The singleton instance used to draw all borders.private static java.awt.Image
shadow
The drop shadow is created from a PNG image with 8 bit alpha channel.private static int
SHADOW_SIZE
The drop shadow needs 5 pixels at the bottom and the right hand side.
-
Constructor Summary
Constructors Constructor Description ShadowPopupBorder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.Insets
getBorderInsets(java.awt.Component c)
Returns the insets of the border.java.awt.Insets
getBorderInsets(java.awt.Component c, java.awt.Insets insets)
Reinitializes the insets parameter with this Border's current Insets.static ShadowPopupBorder
getInstance()
Returns the singleton instance used to draw all borders.void
paintBorder(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)
Paints the border for the specified component with the specified position and size.
-
-
-
Field Detail
-
SHADOW_SIZE
private static final int SHADOW_SIZE
The drop shadow needs 5 pixels at the bottom and the right hand side.- See Also:
- Constant Field Values
-
instance
private static ShadowPopupBorder instance
The singleton instance used to draw all borders.
-
shadow
private static java.awt.Image shadow
The drop shadow is created from a PNG image with 8 bit alpha channel.
-
-
Method Detail
-
getInstance
public static ShadowPopupBorder getInstance()
Returns the singleton instance used to draw all borders.
-
paintBorder
public void paintBorder(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)
Paints the border for the specified component with the specified position and size.- Specified by:
paintBorder
in interfacejavax.swing.border.Border
- Overrides:
paintBorder
in classjavax.swing.border.AbstractBorder
-
getBorderInsets
public java.awt.Insets getBorderInsets(java.awt.Component c)
Returns the insets of the border.- Specified by:
getBorderInsets
in interfacejavax.swing.border.Border
- Overrides:
getBorderInsets
in classjavax.swing.border.AbstractBorder
-
getBorderInsets
public java.awt.Insets getBorderInsets(java.awt.Component c, java.awt.Insets insets)
Reinitializes the insets parameter with this Border's current Insets.- Overrides:
getBorderInsets
in classjavax.swing.border.AbstractBorder
- Parameters:
c
- the component for which this border insets value appliesinsets
- the object to be reinitialized- Returns:
- the
insets
object
-
-