JIDE 3.5.15

com.jidesoft.tooltip
Class TableHeaderExpandedTip

java.lang.Object
  extended by com.jidesoft.tooltip.ExpandedTip<JTableHeader>
      extended by com.jidesoft.tooltip.TableHeaderExpandedTip

public class TableHeaderExpandedTip
extends ExpandedTip<JTableHeader>

TableHeaderExpandedTip enables the ExpandedTip feature for JTableHeader.

Since:
3.3.0

Field Summary
 
Fields inherited from class com.jidesoft.tooltip.ExpandedTip
_component, CLIENT_PROPERTY_EXPANDED_TIP
 
Constructor Summary
TableHeaderExpandedTip(JTableHeader tableHeader)
           
 
Method Summary
protected  Point createToolTipImage(int index, boolean rightOrLeft)
           
 Component getComponent(int index)
          Gets the target component.
 Rectangle getRowBounds(int index)
          Gets the bounds of the image that will be put on the tip.
 Rectangle getVisibleRect(int index)
          Gets the visible rect of the component.
protected  void paintTipImage(Graphics2D g, Component component, Rectangle bounds, int index)
          Paints the tip image.
 int rowAtPoint(Point point)
          Gets the row index or the node index on the location.
protected  boolean shouldDrawBorder()
           
 void uninstall()
           
 
Methods inherited from class com.jidesoft.tooltip.ExpandedTip
createImage, fillBackground, getComponent, getExpandedTip, handleSelectionChange, handleSelectionChange, hideTip, setWindowShape, showTip, updateCurrentSelection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableHeaderExpandedTip

public TableHeaderExpandedTip(JTableHeader tableHeader)
Method Detail

uninstall

public void uninstall()
Overrides:
uninstall in class ExpandedTip<JTableHeader>

getComponent

public Component getComponent(int index)
Description copied from class: ExpandedTip
Gets the target component. This component contains the image that will be put on the tip. The area of the image is returned in the ExpandedTip.getRowBounds(int). What we will do is to take a capture of the image at the bounds on the component and copy it to the tip component.

Overrides:
getComponent in class ExpandedTip<JTableHeader>
Parameters:
index - the index of the row or node.
Returns:
the component.

getRowBounds

public Rectangle getRowBounds(int index)
Description copied from class: ExpandedTip
Gets the bounds of the image that will be put on the tip. The position is relative to the component returned from ExpandedTip.getComponent(int). The bounds should cover the row or the node. We will calculate it so that only the invisible area is shown on the tip component.

Specified by:
getRowBounds in class ExpandedTip<JTableHeader>
Parameters:
index - the index of the row or node.
Returns:
the bounds.

getVisibleRect

public Rectangle getVisibleRect(int index)
Description copied from class: ExpandedTip
Gets the visible rect of the component.

Overrides:
getVisibleRect in class ExpandedTip<JTableHeader>
Parameters:
index - the index of the row or node
Returns:
the visible rect of the component.

createToolTipImage

protected Point createToolTipImage(int index,
                                   boolean rightOrLeft)
Overrides:
createToolTipImage in class ExpandedTip<JTableHeader>

paintTipImage

protected void paintTipImage(Graphics2D g,
                             Component component,
                             Rectangle bounds,
                             int index)
Description copied from class: ExpandedTip
Paints the tip image. It will take a sub-image from the component at the specified bounds and paint it on the provided graphics.

Overrides:
paintTipImage in class ExpandedTip<JTableHeader>
Parameters:
g - the graphics
component - the component where the sub-image is taken from
bounds - the bounds where the sub-image is at
index - the index of the row or the node

rowAtPoint

public int rowAtPoint(Point point)
Description copied from class: ExpandedTip
Gets the row index or the node index on the location.

Specified by:
rowAtPoint in class ExpandedTip<JTableHeader>
Parameters:
point - the location.
Returns:
the index of the row or node.

shouldDrawBorder

protected boolean shouldDrawBorder()
Overrides:
shouldDrawBorder in class ExpandedTip<JTableHeader>

JIDE 3.5.15