org.biojava.spice.gui
Class CloseableTabbedPane.ClosingIcon

java.lang.Object
  extended byorg.biojava.spice.gui.CloseableTabbedPane.ClosingIcon
All Implemented Interfaces:
Icon
Enclosing class:
CloseableTabbedPane

protected class CloseableTabbedPane.ClosingIcon
extends Object
implements Icon

the idea for this class stems from limewire's CancelSearchIconProxy class, thanks for going open source guys.


Constructor Summary
CloseableTabbedPane.ClosingIcon(ImageIcon icon)
           
 
Method Summary
 boolean contains(int xEvent, int yEvent)
          Verifies if x and y are within the icon's borders.
 int getIconHeight()
           
 int getIconWidth()
           
 void paintIcon(Component c, 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CloseableTabbedPane.ClosingIcon

public CloseableTabbedPane.ClosingIcon(ImageIcon icon)
Method Detail

getIconHeight

public int getIconHeight()
Specified by:
getIconHeight in interface Icon

getIconWidth

public int getIconWidth()
Specified by:
getIconWidth in interface Icon

paintIcon

public void paintIcon(Component c,
                      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:
paintIcon in interface Icon

contains

public boolean contains(int xEvent,
                        int yEvent)
Verifies if x and y are within the icon's borders.

Parameters:
xEvent -
yEvent -
Returns:
boolean if within the borders