com.dlsc.flexgantt.swing.util

## Class DropShadowBorder

- java.lang.Object
- - com.dlsc.flexgantt.swing.util.DropShadowBorder

- All Implemented Interfaces:
    Serializable, Border

      public class DropShadowBorder
      extends Object
      implements Border, Serializable

  Implements a DropShadow for components. In general, the DropShadowBorder will work with any rectangular components that do not have a default border installed as part of the look and feel, or otherwise. For example, DropShadowBorder works wonderfully with JPanel, but horribly with JComboBox.

  Note: `DropShadowBorder` should usually be added to non-opaque components, otherwise the background is likely to bleed through.

  Author:
    rbair
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DropShadowBorder()` Constructs a new border.
    `DropShadowBorder(boolean showLeftShadow)` Constructs a new border (color = black, size = 5, opacity = .5, corner size = 12).
    `DropShadowBorder(Color shadowColor, int shadowSize)` Constructs a new border.
    `DropShadowBorder(Color shadowColor, int shadowSize, float shadowOpacity, int cornerSize, boolean showTopShadow, boolean showLeftShadow, boolean showBottomShadow, boolean showRightShadow)` Constructs a new border.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Insets` | `getBorderInsets(Component c)`
    `int` | `getCornerSize()` Returns the corner size of the shadow.
    `Color` | `getShadowColor()` Returns the color of the shadow.
    `float` | `getShadowOpacity()` Returns the opacity of the shadow.
    `int` | `getShadowSize()` Returns the size of the shadow.
    `boolean` | `isBorderOpaque()`
    `boolean` | `isShowBottomShadow()` Determines if border draws shadow on bottom of the component.
    `boolean` | `isShowLeftShadow()` Determines if border draws shadow on left side of the component.
    `boolean` | `isShowRightShadow()` Determines if border draws shadow on right side of the component.
    `boolean` | `isShowTopShadow()` Determines if border draws shadow on top of the component.
    `void` | `paintBorder(Component c, Graphics graphics, int x, int y, int width, int height)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DropShadowBorder

          public DropShadowBorder()

      Constructs a new border.
      Since:
        2.0

    - #### DropShadowBorder

          public DropShadowBorder(Color shadowColor,
                                  int shadowSize)

      Constructs a new border.
      Parameters:
        `shadowColor` - the color of the shadow
        `shadowSize` - the size of the shadow
      Since:
        2.0

    - #### DropShadowBorder

          public DropShadowBorder(boolean showLeftShadow)

      Constructs a new border (color = black, size = 5, opacity = .5, corner size = 12).
      Parameters:
        `showLeftShadow` - also show shadow to the left
      Since:
        2.0

    - #### DropShadowBorder

          public DropShadowBorder(Color shadowColor,
                                  int shadowSize,
                                  float shadowOpacity,
                                  int cornerSize,
                                  boolean showTopShadow,
                                  boolean showLeftShadow,
                                  boolean showBottomShadow,
                                  boolean showRightShadow)

      Constructs a new border.
      Parameters:
        `shadowColor` - the color of the shadow
        `shadowSize` - the size of the shadow
        `shadowOpacity` - the opacity of the shadow
        `cornerSize` - the size of the shadow corners
        `showTopShadow` - draw border at top
        `showLeftShadow` - draw border on left side
        `showBottomShadow` - draw border at bottom
        `showRightShadow` - draw border on right side
      Since:
        2.0

  - ### Method Detail

    - #### paintBorder

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

      Specified by:
        `paintBorder` in interface `Border`

    - #### getBorderInsets

          public Insets getBorderInsets(Component c)

      Specified by:
        `getBorderInsets` in interface `Border`

    - #### isBorderOpaque

          public boolean isBorderOpaque()

      Specified by:
        `isBorderOpaque` in interface `Border`

    - #### isShowTopShadow

          public boolean isShowTopShadow()

      Determines if border draws shadow on top of the component.
      Returns:
        TRUE if shadow gets drawn on top of component
      Since:
        2.0

    - #### isShowLeftShadow

          public boolean isShowLeftShadow()

      Determines if border draws shadow on left side of the component.
      Returns:
        TRUE if shadow gets drawn on left side of component
      Since:
        2.0

    - #### isShowRightShadow

          public boolean isShowRightShadow()

      Determines if border draws shadow on right side of the component.
      Returns:
        TRUE if shadow gets drawn on right side of component
      Since:
        2.0

    - #### isShowBottomShadow

          public boolean isShowBottomShadow()

      Determines if border draws shadow on bottom of the component.
      Returns:
        TRUE if shadow gets drawn on bottom of component
      Since:
        2.0

    - #### getShadowSize

          public int getShadowSize()

      Returns the size of the shadow.
      Returns:
        the shadow size
      Since:
        2.0

    - #### getShadowColor

          public Color getShadowColor()

      Returns the color of the shadow.
      Returns:
        the shadow color
      Since:
        2.0

    - #### getShadowOpacity

          public float getShadowOpacity()

      Returns the opacity of the shadow.
      Returns:
        the shadow opacity
      Since:
        2.0

    - #### getCornerSize

          public int getCornerSize()

      Returns the corner size of the shadow.
      Returns:
        the shadow corner size
      Since:
        2.0

Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.