edu.wpi.cs.dsrg.xmldb.xat.component.gui.utils
Class CAPETab

java.lang.Object
  |
  +--java.awt.event.MouseAdapter
        |
        +--edu.wpi.cs.dsrg.xmldb.xat.component.gui.utils.CAPETab
All Implemented Interfaces:
java.util.EventListener, javax.swing.Icon, java.awt.event.MouseListener

public class CAPETab
extends java.awt.event.MouseAdapter
implements javax.swing.Icon

Creates a tab for the tabbed pane with an 'X' (close icon) to close the tab. Each tab can be associated with a query object and pane type:

Author:
Maylene Waltz

Constructor Summary
CAPETab()
          Constructor to make a new tab.
CAPETab(java.lang.Object queryObject)
          Constructor to make a new tab associated with the given queryObject.
CAPETab(java.lang.Object queryObject, java.lang.String paneType)
          Constructor to make a new tab associated with the given queryObject and paneType.
CAPETab(java.lang.String paneType)
          Constructor to make a new tab associated with the given paneType.
 
Method Summary
 java.awt.Rectangle getBounds()
          Returns the bounds of the 'X' on the tab.
 int getIconHeight()
          Returns the icon's height.
 int getIconWidth()
          Returns the icon's width.
 java.lang.String getPaneType()
          Returns the pane type.
 XATQueryObject getXATQueryObject()
          Returns the XATQueryObject associated with this tab.
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
          Paints the 'X' icon on the tab.
 
Methods inherited from class java.awt.event.MouseAdapter
mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CAPETab

public CAPETab()
Constructor to make a new tab.


CAPETab

public CAPETab(java.lang.Object queryObject)
Constructor to make a new tab associated with the given queryObject.

Parameters:
queryObject - the query object associated with this tab

CAPETab

public CAPETab(java.lang.String paneType)
Constructor to make a new tab associated with the given paneType.

Parameters:
paneType - the type of tabbed pane this tab belongs to

CAPETab

public CAPETab(java.lang.Object queryObject,
               java.lang.String paneType)
Constructor to make a new tab associated with the given queryObject and paneType.

Parameters:
queryObject - the query object to associate with this tab
paneType - the type of tabbed pane this tab belongs to
Method Detail

paintIcon

public void paintIcon(java.awt.Component c,
                      java.awt.Graphics g,
                      int x,
                      int y)
Paints the 'X' icon on the tab.

Specified by:
paintIcon in interface javax.swing.Icon

getBounds

public java.awt.Rectangle getBounds()
Returns the bounds of the 'X' on the tab.

Returns:
the rectangular bounds of the tab's icon(s)

getIconWidth

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

Specified by:
getIconWidth in interface javax.swing.Icon
Returns:
the icon's width in pixels

getIconHeight

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

Specified by:
getIconHeight in interface javax.swing.Icon
Returns:
the icon's height in pixels

getPaneType

public java.lang.String getPaneType()
Returns the pane type.

Returns:
the type of tabbed pane this tab belongs to

getXATQueryObject

public XATQueryObject getXATQueryObject()
Returns the XATQueryObject associated with this tab.

Returns:
the query object associated with this tab