Class RoundCloseButton
java.lang.Object
ch.swingfx.twinkle.style.closebutton.RoundCloseButton
- All Implemented Interfaces:
ICloseButton
A simple round close button.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
private static final int
private static final int
private Color
private Color
private Ellipse2D.Double
private BufferedImage
private BasicStroke
private int
private int
private static final int
static final int
static final int
-
Constructor Summary
ConstructorsConstructorDescriptionRoundCloseButton
(Color buttonBackgroundColor, Color buttonBorderColor) Create a RoundCloseButton at default x and yRoundCloseButton
(Color buttonBackgroundColor, Color buttonBorderColor, int x, int y) Create a RoundCloseButton at x and y -
Method Summary
Modifier and TypeMethodDescriptionboolean
isMouseOverCloseButton
(Point mousePosition) Test if the mouse is over the close buttonvoid
Paint the close buttonwithPosition
(int x, int y) Set the position of the close button
-
Field Details
-
DEFAULT_Y
private static final int DEFAULT_Y- See Also:
-
DEFAULT_X
private static final int DEFAULT_X- See Also:
-
SIZE
private static final int SIZE- See Also:
-
STROKE_WIDTH
public static final int STROKE_WIDTH- See Also:
-
TOP_LEFT
public static final int TOP_LEFT- See Also:
-
BOTTOM_RIGHT
public static final int BOTTOM_RIGHT- See Also:
-
fButtonShape
-
fStroke
-
fButtonBackgroundColor
-
fButtonBorderColor
-
fDropShadow
-
fX
private int fX -
fY
private int fY
-
-
Constructor Details
-
RoundCloseButton
Create a RoundCloseButton at default x and y- Parameters:
buttonBackgroundColor
- the background color of the buttonbuttonBorderColor
- the border and X color of the button
-
RoundCloseButton
Create a RoundCloseButton at x and y- Parameters:
buttonBackgroundColor
- the background color of the buttonbuttonBorderColor
- the border and X color of the buttonx
- x positiony
- y position
-
-
Method Details
-
paintCloseButton
Description copied from interface:ICloseButton
Paint the close button- Specified by:
paintCloseButton
in interfaceICloseButton
- Parameters:
g
-Graphics
to paint on
-
isMouseOverCloseButton
Description copied from interface:ICloseButton
Test if the mouse is over the close button- Specified by:
isMouseOverCloseButton
in interfaceICloseButton
- Parameters:
mousePosition
- position of the mouse- Returns:
- true if mouse if over the button
-
withPosition
Description copied from interface:ICloseButton
Set the position of the close button- Specified by:
withPosition
in interfaceICloseButton
- Parameters:
x
- x positiony
- y position- Returns:
- this
ICloseButton
-