org.jdesktop.swingx
Class JXTreeTable.TreeTableHackerExt2

java.lang.Object
  extended by org.jdesktop.swingx.JXTreeTable.TreeTableHacker
      extended by org.jdesktop.swingx.JXTreeTable.TreeTableHackerExt
          extended by org.jdesktop.swingx.JXTreeTable.TreeTableHackerExt2
Direct Known Subclasses:
JXTreeTable.TreeTableHackerExt3
Enclosing class:
JXTreeTable

public class JXTreeTable.TreeTableHackerExt2
extends JXTreeTable.TreeTableHackerExt

Patch for #471-swingx: no selection on click in hierarchical column if outside of node-text. Mar 2007.

Note: with 1.6 the expansion control was broken even with the "normal extended" TreeTableHackerExt. When fixing that (renderer must have correct width for BasicTreeUI since 1.6) took a look into why this didn't work and made it work. So, now this is bidi-compliant.

Author:
tiberiu@dev.java.net

Field Summary
 
Fields inherited from class org.jdesktop.swingx.JXTreeTable.TreeTableHacker
expansionChangedFlag
 
Constructor Summary
JXTreeTable.TreeTableHackerExt2()
           
 
Method Summary
protected  boolean expandOrCollapseNode(int column, java.util.EventObject e)
          Tricksery to make the tree expand/collapse.
protected  java.awt.Point getTreeMousePoint(int column, java.awt.event.MouseEvent me)
          This is a patch provided for Issue #980-swingx which should improve the bidi-compliance.
 
Methods inherited from class org.jdesktop.swingx.JXTreeTable.TreeTableHackerExt
isHitDetectionFromProcessMouse
 
Methods inherited from class org.jdesktop.swingx.JXTreeTable.TreeTableHacker
completeEditing, expansionChanged, hitHandleDetectionFromEditCell, hitHandleDetectionFromProcessMouse, mightBeExpansionTrigger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JXTreeTable.TreeTableHackerExt2

public JXTreeTable.TreeTableHackerExt2()
Method Detail

expandOrCollapseNode

protected boolean expandOrCollapseNode(int column,
                                       java.util.EventObject e)
Description copied from class: JXTreeTable.TreeTableHacker
Tricksery to make the tree expand/collapse.

This might be - indirectly - called from one of two places:

  1. editCellAt: original, stable but buggy (#332, #222) the table's own selection had been changed due to the click before even entering into editCellAt so all tree selection state is lost.
  2. processMouseEvent: the idea is to catch the mouseEvent, check if it triggered an expanded/collapsed, consume and return if so or pass to super if not.

widened access for testing ...

Overrides:
expandOrCollapseNode in class JXTreeTable.TreeTableHacker
Parameters:
column - the column index under the event, if any.
e - the event which might trigger a expand/collapse.
Returns:
this methods evaluation as to whether the event triggered a expand/collaps

getTreeMousePoint

protected java.awt.Point getTreeMousePoint(int column,
                                           java.awt.event.MouseEvent me)
This is a patch provided for Issue #980-swingx which should improve the bidi-compliance. Still doesn't work in our visual tests...

Problem was not in the translation to renderer coordinate system, it was in the method itself: the check whether we are "beyond" the cell content box is bidi-dependent. Plus (since 1.6), width of renderer must be > 0.

Parameters:
column - the column index under the event, if any.
e - the event which might trigger a expand/collapse.
Returns:
the Point adjusted for bidi


Copyright © 2011. All Rights Reserved.