expandable items tuned

This commit is contained in:
Anton Makeev
2010-07-14 17:59:23 +04:00
parent ca43b47f2f
commit edb7f18429
2 changed files with 18 additions and 6 deletions
@@ -99,8 +99,26 @@ abstract public class AbstractExpandableItemsHandler<KeyType, ComponentType exte
public void componentMoved(ComponentEvent e) {
handleSelectionChange(myKey);
}
@Override
public void componentResized(ComponentEvent e) {
handleSelectionChange(myKey);
}
}
);
myComponent.addHierarchyBoundsListener(new HierarchyBoundsAdapter() {
@Override
public void ancestorMoved(HierarchyEvent e) {
handleSelectionChange(myKey);
}
@Override
public void ancestorResized(HierarchyEvent e) {
handleSelectionChange(myKey);
}
});
myComponent.addHierarchyListener(
new HierarchyListener() {
public void hierarchyChanged(HierarchyEvent e) {
@@ -156,12 +156,6 @@ public class TreeExpandableItemsHandler extends AbstractExpandableItemsHandler<I
super.doFillBackground(ui instanceof UIUtil.MacTreeUI && ((UIUtil.MacTreeUI)ui).isWideSelection()? height - 1 : height, width, g);
}
@Override
protected boolean doPaintBorder(final Integer row) {
final TreeUI ui = myComponent.getUI();
return (!(ui instanceof UIUtil.MacTreeUI) || !((UIUtil.MacTreeUI)ui).isWideSelection()) || !myComponent.isRowSelected(row);
}
@Override
protected void doPaintTooltipImage(final Component rComponent, final Rectangle cellBounds, final int height, final Graphics2D g, Integer key) {
if (myComponent.isRowSelected(key) && rComponent instanceof JComponent) {