com.dlsc.flexgantt.swing.util

## Class GradientBorder

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

- All Implemented Interfaces:
    Border

      public class GradientBorder
      extends Object
      implements Border

  A border implementation that draws a gradient in the background. The gradient is based on two background colors. Additionally a line will be drawn as a border. The gradient background will only be visible if the component that uses it is not opaque.
  Since:
    1.0
  Version:
    $Revision: 1.8 $
  Author:
    Dirk Lemmermann
  See Also:
    `JComponent.setOpaque(boolean)`, `JComponent.setBorder(Border)`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `GradientBorder()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Color` | `getBackgroundColor1()` Returns the background color with which the gradient starts painting itself.
    `Color` | `getBackgroundColor2()` Returns the background color with which the gradient stops painting itself.
    `Insets` | `getBorderInsets(Component c)`
    `Color` | `getLineColor()` Returns the color used for drawing the border line.
    `boolean` | `isBorderOpaque()`
    `void` | `paintBorder(Component c, Graphics g, int x, int y, int width, int height)`
    `void` | `setBackgroundColor1(Color color)` Sets the background color with which the gradient starts painting itself.
    `void` | `setBackgroundColor2(Color color)` Returns the background color with which the gradient stops painting itself.
    `void` | `setLineColor(Color color)` Sets the color used for drawing the border line.

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

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

- - ### Constructor Detail

    - #### GradientBorder

          public GradientBorder()

  - ### Method Detail

    - #### isBorderOpaque

          public boolean isBorderOpaque()

      Specified by:
        `isBorderOpaque` in interface `Border`

    - #### paintBorder

          public void paintBorder(Component c,
                                  Graphics g,
                                  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`

    - #### getBackgroundColor1

          public Color getBackgroundColor1()

      Returns the background color with which the gradient starts painting itself.
      Returns:
        the background color with which the gradient starts painting itself
      Since:
        1.0

    - #### setBackgroundColor1

          public void setBackgroundColor1(Color color)

      Sets the background color with which the gradient starts painting itself.
      Parameters:
        `color` - the background color with which the gradient starts painting itself
      Since:
        1.0

    - #### getBackgroundColor2

          public Color getBackgroundColor2()

      Returns the background color with which the gradient stops painting itself.
      Returns:
        the background color with which the gradient stops painting itself
      Since:
        1.0

    - #### setBackgroundColor2

          public void setBackgroundColor2(Color color)

      Returns the background color with which the gradient stops painting itself.
      Parameters:
        `color` - the background color with which the gradient stops painting itself
      Since:
        1.0

    - #### getLineColor

          public Color getLineColor()

      Returns the color used for drawing the border line.
      Returns:
        the color used for drawing the border line
      Since:
        1.0

    - #### setLineColor

          public void setLineColor(Color color)

      Sets the color used for drawing the border line.
      Parameters:
        `color` - the color used for drawing the border line
      Since:
        1.0

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