public class ClosingIcon
extends java.lang.Object
implements javax.swing.Icon
Constructor and Description |
---|
ClosingIcon(@NotNull javax.swing.Icon icon) |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(int xEvent,
int yEvent)
Returns whether
xEvent and yEvent are within the icon's
borders. |
int |
getIconHeight() |
int |
getIconWidth() |
void |
paintIcon(@NotNull java.awt.Component c,
@NotNull java.awt.Graphics g,
int x,
int y)
Overwrites paintIcon to get hold of the coordinates of the icon, this is
a rather rude approach just to find out if the closingIcon was pressed.
|
public int getIconHeight()
getIconHeight
in interface javax.swing.Icon
public int getIconWidth()
getIconWidth
in interface javax.swing.Icon
public void paintIcon(@NotNull @NotNull java.awt.Component c, @NotNull @NotNull java.awt.Graphics g, int x, int y)
paintIcon
in interface javax.swing.Icon
public boolean contains(int xEvent, int yEvent)
xEvent
and yEvent
are within the icon's
borders.xEvent
- the x coordinate from an eventyEvent
- the y coordinate from an eventxEvent
and yEvent
are within the icon's
borderstrue
if xEvent
and yEvent
are within the
icon's border., false
otherwise (xEvent
or yEvent
or both
are outside the icon's border).