Package UI

Class GBevelBorder

  • All Implemented Interfaces:
    java.io.Serializable, javax.swing.border.Border

    public class GBevelBorder
    extends javax.swing.border.SoftBevelBorder
    GBevelBorder is a custom border class that extends SoftBevelBorder. It provides a beveled border with customizable colors and styles.
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class javax.swing.border.BevelBorder

        bevelType, highlightInner, highlightOuter, LOWERED, RAISED, shadowInner, shadowOuter
    • Constructor Summary

      Constructors 
      Constructor Description
      GBevelBorder​(int t)
      Constructs a GBevelBorder with a specified bevel type.
      GBevelBorder​(int t, int type)
      Constructs a GBevelBorder with a specified bevel type and custom type.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.awt.Insets getBorderInsets​(java.awt.Component c, java.awt.Insets insets)
      Returns the insets of the border.
      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.
      void paintBorder1​(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)
      Paints the primary border for the specified component.
      • Methods inherited from class javax.swing.border.SoftBevelBorder

        isBorderOpaque
      • Methods inherited from class javax.swing.border.BevelBorder

        getBevelType, getHighlightInnerColor, getHighlightInnerColor, getHighlightOuterColor, getHighlightOuterColor, getShadowInnerColor, getShadowInnerColor, getShadowOuterColor, getShadowOuterColor, paintLoweredBevel, paintRaisedBevel
      • Methods inherited from class javax.swing.border.AbstractBorder

        getBaseline, getBaselineResizeBehavior, getBorderInsets, getInteriorRectangle, getInteriorRectangle
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GBevelBorder

        public GBevelBorder​(int t)
        Constructs a GBevelBorder with a specified bevel type.
        Parameters:
        t - the bevel type (RAISED or LOWERED)
      • GBevelBorder

        public GBevelBorder​(int t,
                            int type)
        Constructs a GBevelBorder with a specified bevel type and custom type.
        Parameters:
        t - the bevel type (RAISED or LOWERED)
        type - the custom type for additional styling
    • Method Detail

      • 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. Draws the custom border and additional lines based on the component's dimensions.
        Specified by:
        paintBorder in interface javax.swing.border.Border
        Overrides:
        paintBorder in class javax.swing.border.SoftBevelBorder
        Parameters:
        c - the component for which this border is being painted
        g - the Graphics context in which to paint
        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
      • paintBorder1

        public void paintBorder1​(java.awt.Component c,
                                 java.awt.Graphics g,
                                 int x,
                                 int y,
                                 int width,
                                 int height)
        Paints the primary border for the specified component. Draws the beveled border based on the component's dimensions and bevel type.
        Parameters:
        c - the component for which this border is being painted
        g - the Graphics context in which to paint
        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
      • getBorderInsets

        public java.awt.Insets getBorderInsets​(java.awt.Component c,
                                               java.awt.Insets insets)
        Returns the insets of the border. Adjusts the insets based on the custom type.
        Overrides:
        getBorderInsets in class javax.swing.border.SoftBevelBorder
        Parameters:
        c - the component for which this border insets value applies
        insets - the object to be reinitialized
        Returns:
        the insets of the border