Class ClosingIcon
- java.lang.Object
-
- net.sf.gridarta.gui.dialog.plugin.ClosingIcon
-
- All Implemented Interfaces:
javax.swing.Icon
public class ClosingIcon extends java.lang.Object implements javax.swing.Iconthe idea for this class stems from limewire's CancelSearchIconProxy class, thanks for going open source guys.
-
-
Constructor Summary
Constructors Constructor Description ClosingIcon(@NotNull javax.swing.Icon icon)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(int xEvent, int yEvent)Returns whetherxEventandyEventare within the icon's borders.intgetIconHeight()intgetIconWidth()voidpaintIcon(@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.
-
-
-
Method Detail
-
getIconHeight
public int getIconHeight()
- Specified by:
getIconHeightin interfacejavax.swing.Icon
-
getIconWidth
public int getIconWidth()
- Specified by:
getIconWidthin interfacejavax.swing.Icon
-
paintIcon
public void paintIcon(@NotNull @NotNull java.awt.Component c, @NotNull @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.- Specified by:
paintIconin interfacejavax.swing.Icon
-
contains
public boolean contains(int xEvent, int yEvent)Returns whetherxEventandyEventare within the icon's borders.- Parameters:
xEvent- the x coordinate from an eventyEvent- the y coordinate from an event- Returns:
- whether
xEventandyEventare within the icon's borders - Return Value:
trueifxEventandyEventare within the icon's border.,falseotherwise (xEventoryEventor both are outside the icon's border).
-
-