Class RoundCloseButton

  • All Implemented Interfaces:
    ICloseButton

    public class RoundCloseButton
    extends java.lang.Object
    implements ICloseButton
    A simple round close button.
    • Constructor Summary

      Constructors 
      Constructor Description
      RoundCloseButton​(java.awt.Color buttonBackgroundColor, java.awt.Color buttonBorderColor)
      Create a RoundCloseButton at default x and y
      RoundCloseButton​(java.awt.Color buttonBackgroundColor, java.awt.Color buttonBorderColor, int x, int y)
      Create a RoundCloseButton at x and y
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isMouseOverCloseButton​(java.awt.Point mousePosition)
      Test if the mouse is over the close button
      void paintCloseButton​(java.awt.Graphics g)
      Paint the close button
      ICloseButton withPosition​(int x, int y)
      Set the position of the close button
      • Methods inherited from class java.lang.Object

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

      • fButtonShape

        private java.awt.geom.Ellipse2D.Double fButtonShape
      • fStroke

        private java.awt.BasicStroke fStroke
      • fButtonBackgroundColor

        private java.awt.Color fButtonBackgroundColor
      • fButtonBorderColor

        private java.awt.Color fButtonBorderColor
      • fDropShadow

        private java.awt.image.BufferedImage fDropShadow
      • fX

        private int fX
      • fY

        private int fY
    • Constructor Detail

      • RoundCloseButton

        public RoundCloseButton​(java.awt.Color buttonBackgroundColor,
                                java.awt.Color buttonBorderColor)
        Create a RoundCloseButton at default x and y
        Parameters:
        buttonBackgroundColor - the background color of the button
        buttonBorderColor - the border and X color of the button
      • RoundCloseButton

        public RoundCloseButton​(java.awt.Color buttonBackgroundColor,
                                java.awt.Color buttonBorderColor,
                                int x,
                                int y)
        Create a RoundCloseButton at x and y
        Parameters:
        buttonBackgroundColor - the background color of the button
        buttonBorderColor - the border and X color of the button
        x - x position
        y - y position
    • 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