Package UI

Class ButtonBorder

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

    public class ButtonBorder
    extends javax.swing.border.AbstractBorder
    ButtonBorder.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      ButtonBorder()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.awt.Insets getBorderInsets​(java.awt.Component c)
      Returns the insets of the border.
      java.awt.Insets getBorderInsets​(java.awt.Component c, java.awt.Insets insets)
      Reinitializes the insets parameter with this border's current insets.
      void paintBorder​(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)
      Paints the border of the specified component.
      protected void paintDisabled​(javax.swing.AbstractButton b, java.awt.Graphics g, int x, int y, int width, int height)
      Paints the border for a disabled button state.
      protected void paintNormal​(javax.swing.AbstractButton b, java.awt.Graphics g, int x, int y, int width, int height)
      Paints the border for a normal (default) button state.
      protected void paintPressed​(javax.swing.AbstractButton b, java.awt.Graphics g, int x, int y, int width, int height)
      Paints the border for a pressed button state.
      protected void paintRollover​(javax.swing.AbstractButton b, java.awt.Graphics g, int x, int y, int width, int height)
      Paints the border for a rollover button state.
      • Methods inherited from class javax.swing.border.AbstractBorder

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

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

      • ButtonBorder

        public ButtonBorder()
    • 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 of the specified component. Determines the state of the button (pressed, rollover, enabled) and calls the appropriate paint method.
        Specified by:
        paintBorder in interface javax.swing.border.Border
        Overrides:
        paintBorder in class javax.swing.border.AbstractBorder
        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
      • paintNormal

        protected void paintNormal​(javax.swing.AbstractButton b,
                                   java.awt.Graphics g,
                                   int x,
                                   int y,
                                   int width,
                                   int height)
        Paints the border for a normal (default) button state.
        Parameters:
        b - the button 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
      • paintDisabled

        protected void paintDisabled​(javax.swing.AbstractButton b,
                                     java.awt.Graphics g,
                                     int x,
                                     int y,
                                     int width,
                                     int height)
        Paints the border for a disabled button state.
        Parameters:
        b - the button 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
      • paintRollover

        protected void paintRollover​(javax.swing.AbstractButton b,
                                     java.awt.Graphics g,
                                     int x,
                                     int y,
                                     int width,
                                     int height)
        Paints the border for a rollover button state.
        Parameters:
        b - the button 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
      • paintPressed

        protected void paintPressed​(javax.swing.AbstractButton b,
                                    java.awt.Graphics g,
                                    int x,
                                    int y,
                                    int width,
                                    int height)
        Paints the border for a pressed button state.
        Parameters:
        b - the button 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)
        Returns the insets of the border.
        Specified by:
        getBorderInsets in interface javax.swing.border.Border
        Overrides:
        getBorderInsets in class javax.swing.border.AbstractBorder
        Parameters:
        c - the component for which this border insets value applies
        Returns:
        the insets of the border
      • getBorderInsets

        public java.awt.Insets getBorderInsets​(java.awt.Component c,
                                               java.awt.Insets insets)
        Reinitializes the insets parameter with this border's current insets.
        Overrides:
        getBorderInsets in class javax.swing.border.AbstractBorder
        Parameters:
        c - the component for which this border insets value applies
        insets - the object to be reinitialized
        Returns:
        the insets of the border