Hi Alberto,

How have you implemented cell specific tooltip on ULCTableTree?

Have you implemented tooltip on cells of ULCTableTree using an extension
such as
http://lists.canoo.com/mailman/private/ulc-developer/2006/004060.html?

Basically you need to do the following:

1. From BasicTableTree, you can getBasicTree() which is a TableTreeTree (a
JTree).

2. Determine the row and column (say from MouseEvent in getToolTipText or
getToolTipLocation on the getBasicTable() of BasicTableTree).

3. On TableTreeTree (JTree), there is a method "Rectangle getRowBounds(int
row)"  which gets the tree cell bounds.

4. From the TableTreeTree you can get DefaultTreeCellRenderer :
tableTreeTree.getCellRenderer();

5. From the renderer you can get Icons if getShowIcons() is true on the
TableTreeTree.

        java.awt.Rectangle treeNodeRectangle = tableTreeTree.getRowBounds(row);
        int tableCellOffset = treeNodeRectangle.x;
      if (tableTreeTree.getShowsIcons()) {
           tableCellOffset += treeCellRenderer.getIconTextGap();
           if
(tableTreeTree.getModel().isLeaf(getPathForRow(row).getLastPathComponent()))
{
                tableCellOffset +=
treeCellRenderer.getLeafIcon().getIconWidth();
            } else if (isExpanded(row)) {
                tableCellOffset +=
treeCellRenderer.getOpenIcon().getIconWidth();
            } else {
                tableCellOffset +=
treeCellRenderer.getClosedIcon().getIconWidth();
            }


6. In getToolTipLocation of TableTreeTable, for column 0 (tree node cell)
you can return:
   new Point(tableCellOffset, treeNodeRectangle.y);

I hope this helps.

Thanks and regards,

Janak




>-----Original Message-----
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED] Behalf Of Alberto Nipoti
>Sent: Thursday, January 04, 2007 8:59 PM
>To: [EMAIL PROTECTED]
>Cc: Danilo Colavitti
>Subject: [ULC-developer] Position of the text in the "tree" part of
>ULCTableTree
>
>
>Hi,
>we have created a custom tooltip, and we have a problem related to
>ULCTreeTable.
>The problem is that we are not able to retrieve the position of the text
>inside the tree cells of treetable components (i.e.: the position of the
>beginning of the text in the cells of the column that contain the tree -
>of course, the position of the text in the cells of the columns that are
>normal table columns and don't contain any tree is fixed at the
>beginning of the cell). This information is needed for two reasons:
>- in order to calculate if the text is truncated of if it is fully
>visible in the cell
>- in order to place our tooltip in the correct position (which should be
>exactly above the text of the cell)
>
>Do you have any suggestion?
>Any help appreciated,
>Alberto & Danilo
>P.S.: we use ULC 6.1.2
>
>_______________________________________________
>ULC-developer mailing list
>[email protected]
>http://lists.canoo.com/mailman/listinfo/ulc-developer

_______________________________________________
ULC-developer mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/ulc-developer

Reply via email to