Module jEdit

Class DropShadowBorder

java.lang.Object
javax.swing.border.AbstractBorder
org.gjt.sp.jedit.gui.DropShadowBorder
All Implemented Interfaces:
Serializable, Border

public class DropShadowBorder extends AbstractBorder
A drop shadow border. Draws a 1 pixel line completely around the component, and a drop shadow effect on the right and bottom sides. Use this like any other border in javax.swing.borders.
Version:
$Revision: 1.3 $
Author:
Dale Anson, 25 Feb 2004
See Also:
  • Constructor Details

    • DropShadowBorder

      public DropShadowBorder()
      Drop shadow with default width of 3 pixels and black color.
    • DropShadowBorder

      public DropShadowBorder(int width)
      Drop shadow, default shadow color is black.
      Parameters:
      width - the width of the shadow.
    • DropShadowBorder

      public DropShadowBorder(int width, Color color)
      Drop shadow, width and color are adjustable.
      Parameters:
      width - the width of the shadow.
      color - the color of the shadow.
  • Method Details

    • getBorderInsets

      public Insets getBorderInsets(Component c)
      This implementation returns a new Insets instance where the top and left are 1, the bottom and right fields are the border width + 1.
      Specified by:
      getBorderInsets in interface Border
      Overrides:
      getBorderInsets in class AbstractBorder
      Parameters:
      c - the component for which this border insets value applies
      Returns:
      a new Insets object initialized as stated above.
    • getBorderInsets

      public Insets getBorderInsets(Component c, Insets insets)
      Reinitializes the insets parameter with this DropShadowBorder's current Insets.
      Overrides:
      getBorderInsets in class AbstractBorder
      Parameters:
      c - the component for which this border insets value applies
      insets - the object to be reinitialized
      Returns:
      the given insets object
    • isBorderOpaque

      public boolean isBorderOpaque()
      This implementation always returns true.
      Specified by:
      isBorderOpaque in interface Border
      Overrides:
      isBorderOpaque in class AbstractBorder
      Returns:
      true
    • paintBorder

      public void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
      Paints the drop shadow border around the given component.
      Specified by:
      paintBorder in interface Border
      Overrides:
      paintBorder in class AbstractBorder
      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