Class RectangleCloseButton
java.lang.Object
ch.swingfx.twinkle.style.closebutton.RectangleCloseButton
- All Implemented Interfaces:
ICloseButton
A simple rectangle close button.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
private static final int
private static final int
private final Color
private final Color
private Rectangle
private final BasicStroke
private int
private int
private static final int
static final int
static final int
-
Constructor Summary
ConstructorsConstructorDescriptionRectangleCloseButton
(Color buttonBackgroundColor, Color buttonBorderColor) RectangleCloseButton
(Color buttonBackgroundColor, Color buttonBorderColor, int x, int 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:
-
TOP_LEFT
public static final int TOP_LEFT- See Also:
-
BOTTOM_RIGHT
public static final int BOTTOM_RIGHT- See Also:
-
STROKE_WIDTH
public static final int STROKE_WIDTH- See Also:
-
fButtonShape
-
fX
private int fX -
fY
private int fY -
fStroke
-
fButtonBorderColor
-
fButtonBackgroundColor
-
-
Constructor Details
-
RectangleCloseButton
-
RectangleCloseButton
-
-
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
-