Class RectangleCloseButton

  • All Implemented Interfaces:
    ICloseButton

    public class RectangleCloseButton
    extends java.lang.Object
    implements ICloseButton
    A simple rectangle close button.
    • Field Detail

      • fButtonShape

        private java.awt.Rectangle fButtonShape
      • fX

        private int fX
      • fY

        private int fY
      • fStroke

        private final java.awt.BasicStroke fStroke
      • fButtonBorderColor

        private final java.awt.Color fButtonBorderColor
      • fButtonBackgroundColor

        private final java.awt.Color fButtonBackgroundColor
    • Constructor Detail

      • RectangleCloseButton

        public RectangleCloseButton​(java.awt.Color buttonBackgroundColor,
                                    java.awt.Color buttonBorderColor)
      • RectangleCloseButton

        public RectangleCloseButton​(java.awt.Color buttonBackgroundColor,
                                    java.awt.Color buttonBorderColor,
                                    int x,
                                    int y)
    • Method Detail

      • paintCloseButton

        public void paintCloseButton​(java.awt.Graphics g)
        Description copied from interface: ICloseButton
        Paint the close button
        Specified by:
        paintCloseButton in interface ICloseButton
        Parameters:
        g - Graphics to paint on
      • isMouseOverCloseButton

        public boolean isMouseOverCloseButton​(java.awt.Point mousePosition)
        Description copied from interface: ICloseButton
        Test if the mouse is over the close button
        Specified by:
        isMouseOverCloseButton in interface ICloseButton
        Parameters:
        mousePosition - position of the mouse
        Returns:
        true if mouse if over the button