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 intprivate static final intprivate static final intprivate Colorprivate Colorprivate Ellipse2D.Doubleprivate BufferedImageprivate BasicStrokeprivate intprivate intprivate static final intstatic final intstatic 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 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:
-
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: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
-