Package UI

Class EntityButtonUI


  • public class EntityButtonUI
    extends javax.swing.plaf.basic.BasicButtonUI
    EntityButtonUI is a custom button UI that provides a specific look and feel for buttons. It extends the BasicButtonUI class and overrides the paint method to customize the button's appearance. The button can have different styles based on its state (hovered, selected, etc.).
    • Field Summary

      • Fields inherited from class javax.swing.plaf.basic.BasicButtonUI

        defaultTextIconGap, defaultTextShiftOffset
    • Constructor Summary

      Constructors 
      Constructor Description
      EntityButtonUI()
      Constructs an EntityButtonUI with default settings.
      EntityButtonUI​(int t)
      Constructs an EntityButtonUI with a specified type.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void installUI​(javax.swing.JComponent c)
      Installs the UI for a specified component.
      void paint​(java.awt.Graphics g, javax.swing.JComponent c)
      Paints the specified component.
      void setType​(int t)
      Sets the type of the button UI.
      • Methods inherited from class javax.swing.plaf.basic.BasicButtonUI

        clearTextShiftOffset, createButtonListener, createUI, getBaseline, getBaselineResizeBehavior, getDefaultTextIconGap, getMaximumSize, getMinimumSize, getPreferredSize, getPropertyPrefix, getTextShiftOffset, installDefaults, installKeyboardActions, installListeners, paintButtonPressed, paintFocus, paintIcon, paintText, paintText, setTextShiftOffset, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUI
      • Methods inherited from class javax.swing.plaf.ComponentUI

        contains, getAccessibleChild, getAccessibleChildrenCount, update
      • Methods inherited from class java.lang.Object

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

      • EntityButtonUI

        public EntityButtonUI()
        Constructs an EntityButtonUI with default settings. Calls the superclass constructor.
      • EntityButtonUI

        public EntityButtonUI​(int t)
        Constructs an EntityButtonUI with a specified type. Calls the superclass constructor and sets the type.
        Parameters:
        t - the type of the button UI
    • Method Detail

      • setType

        public void setType​(int t)
        Sets the type of the button UI.
        Parameters:
        t - the type to set
      • installUI

        public void installUI​(javax.swing.JComponent c)
        Installs the UI for a specified component. Sets the rollover enabled and applies an empty border.
        Overrides:
        installUI in class javax.swing.plaf.basic.BasicButtonUI
        Parameters:
        c - the component where this UI will be installed
      • paint

        public void paint​(java.awt.Graphics g,
                          javax.swing.JComponent c)
        Paints the specified component. Changes the background and border colors based on the button's state.
        Overrides:
        paint in class javax.swing.plaf.basic.BasicButtonUI
        Parameters:
        g - the Graphics context in which to paint
        c - the component being painted