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 intprivate static final intprivate static final intprivate final Colorprivate final Colorprivate Rectangleprivate final BasicStrokeprivate intprivate intprivate static final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionRectangleCloseButton(Color buttonBackgroundColor, Color buttonBorderColor) RectangleCloseButton(Color buttonBackgroundColor, Color buttonBorderColor, int x, int y) -
Method Summary
Modifier and TypeMethodDescriptionbooleanisMouseOverCloseButton(Point mousePosition) Test if the mouse is over the close buttonvoidPaint 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:ICloseButtonPaint the close button- Specified by:
paintCloseButtonin interfaceICloseButton- Parameters:
g-Graphicsto paint on
-
isMouseOverCloseButton
Description copied from interface:ICloseButtonTest if the mouse is over the close button- Specified by:
isMouseOverCloseButtonin interfaceICloseButton- Parameters:
mousePosition- position of the mouse- Returns:
- true if mouse if over the button
-
withPosition
Description copied from interface:ICloseButtonSet the position of the close button- Specified by:
withPositionin interfaceICloseButton- Parameters:
x- x positiony- y position- Returns:
- this
ICloseButton
-