Class ShapedBevelBorder

java.lang.Object
javax.swing.border.AbstractBorder
com.github.tadukoo.view.border.ShapedBevelBorder
All Implemented Interfaces:
Serializable, Border

public class ShapedBevelBorder extends AbstractBorder
Shaped Etched Border mimics the functionality of a BevelBorder, but uses the ShapeInfo (if present) on the component to draw the border, rather than making a rectangular border, or it can have its own ShapeInfo if desired.
Since:
Alpha v.0.2
Version:
Alpha v.0.2.1
Author:
Logan Ferree (Tadukoo)
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • builder

      Returns:
      A builder to create a ShapedBevelBorder
    • getBorderInsets

      public Insets getBorderInsets(Component c)
      Specified by:
      getBorderInsets in interface Border
      Overrides:
      getBorderInsets in class AbstractBorder
    • getBorderInsets

      public Insets getBorderInsets(Component c, Insets insets)
      Overrides:
      getBorderInsets in class AbstractBorder
    • paintBorder

      public void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
      Specified by:
      paintBorder in interface Border
      Overrides:
      paintBorder in class AbstractBorder
    • paintRaisedBevel

      private void paintRaisedBevel(Component c, Graphics g, int x, int y, int w, int h, ShapeInfo shapeInfo)
      Paints a raised bevel for the specified component with the specified position and size.
      Parameters:
      c - the component for which the bevel is being painted
      g - the paint graphics
      x - the x position of the bevel
      y - the y position of the bevel
      w - the width of the bevel
      h - the height of the bevel
      shapeInfo - The ShapeInfo to use for the bevel
    • paintLoweredBevel

      private void paintLoweredBevel(Component c, Graphics g, int x, int y, int w, int h, ShapeInfo shapeInfo)
      Paints a lowered bevel for the specified component with the specified position and size.
      Parameters:
      c - the component for which the lowered bevel is being painted
      g - the paint graphics
      x - the x position of the lowered bevel
      y - the y position of the lowered bevel
      w - the width of the lowered bevel
      h - the height of the lowered bevel
      shapeInfo - The ShapeInfo to use for the bevel
    • getHighlightInnerPaint

      private Paint getHighlightInnerPaint(Component c, Dimension size)
      Returns a Paint to use for the inner highlight on the given component with the given size.
      Parameters:
      c - The Component we're putting a border on
      size - The size of the space being painted
      Returns:
      The Paint to use
    • getHighlightOuterPaint

      private Paint getHighlightOuterPaint(Component c, Dimension size)
      Returns a Paint to use for the outer highlight on the given component with the given size.
      Parameters:
      c - The Component we're putting a border on
      size - The size of the space being painted
      Returns:
      The Paint to use
    • getShadowInnerPaint

      private Paint getShadowInnerPaint(Component c, Dimension size)
      Returns a Paint to use for the inner shadow on the given component with the given size.
      Parameters:
      c - The Component we're putting a border on
      size - The size of the space being painted
      Returns:
      The Paint to use
    • getShadowOuterPaint

      private Paint getShadowOuterPaint(Component c, Dimension size)
      Returns a Paint to use for the outer shadow on the given component with the given size.
      Parameters:
      c - The Component we're putting a border on
      size - The size of the space being painted
      Returns:
      The Paint to use