com.neatech.climbplan.userinterface.components
Class CloseableTabbedPane.CloseTabIcon

java.lang.Object
  extended by com.neatech.climbplan.userinterface.components.CloseableTabbedPane.CloseTabIcon
All Implemented Interfaces:
Icon
Enclosing class:
CloseableTabbedPane

 class CloseableTabbedPane.CloseTabIcon
extends Object
implements Icon

The class which generates the 'X' icon for the tabs. The constructor accepts an icon which is extra to the 'X' icon, so you can have tabs like in JBuilder. This value is null if no extra icon is required.


Field Summary
private  Icon fileIcon
          the additional fileicon
private  int height
          the height the icon
private  boolean mouseover
          true whether the mouse is over this icon, false otherwise
private  boolean mousepressed
          true whether the mouse is pressed on this icon, false otherwise
private  int width
          the width the icon
private  int x_pos
          the x position of the icon
private  int y_pos
          the y position of the icon
 
Constructor Summary
CloseableTabbedPane.CloseTabIcon(Icon fileIcon)
          Creates a new instance of CloseTabIcon
 
Method Summary
 Rectangle getBounds()
          Gets the bounds of this icon in the form of a Rectangle object.
 int getIconHeight()
          Returns the icon's height.
 int getIconWidth()
          Returns the icon's width.
 void paintIcon(Component c, Graphics g, int x, int y)
          Draw the icon at the specified location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x_pos

private int x_pos
the x position of the icon


y_pos

private int y_pos
the y position of the icon


width

private int width
the width the icon


height

private int height
the height the icon


fileIcon

private Icon fileIcon
the additional fileicon


mouseover

private boolean mouseover
true whether the mouse is over this icon, false otherwise


mousepressed

private boolean mousepressed
true whether the mouse is pressed on this icon, false otherwise

Constructor Detail

CloseableTabbedPane.CloseTabIcon

public CloseableTabbedPane.CloseTabIcon(Icon fileIcon)
Creates a new instance of CloseTabIcon

Parameters:
fileIcon - the additional fileicon, if there is one set
Method Detail

paintIcon

public void paintIcon(Component c,
                      Graphics g,
                      int x,
                      int y)
Draw the icon at the specified location. Icon implementations may use the Component argument to get properties useful for painting, e.g. the foreground or background color.

Specified by:
paintIcon in interface Icon
Parameters:
c - the component which the icon belongs to
g - the graphic object to draw on
x - the upper left point of the icon in the x direction
y - the upper left point of the icon in the y direction

getIconWidth

public int getIconWidth()
Returns the icon's width.

Specified by:
getIconWidth in interface Icon
Returns:
an int specifying the fixed width of the icon.

getIconHeight

public int getIconHeight()
Returns the icon's height.

Specified by:
getIconHeight in interface Icon
Returns:
an int specifying the fixed height of the icon.

getBounds

public Rectangle getBounds()
Gets the bounds of this icon in the form of a Rectangle object. The bounds specify this icon's width, height, and location relative to its parent.

Returns:
a rectangle indicating this icon's bounds