1281 |
g.translate(10, 10); |
g.translate(10, 10); |
1282 |
paintRecursive(g, 0, 0, 0, 0, tree, mod, mod.getRoot()); |
paintRecursive(g, 0, 0, 0, 0, tree, mod, mod.getRoot()); |
1283 |
paintControlIcons(g, 0, 0, 0, 0, tree, mod, mod.getRoot()); |
paintControlIcons(g, 0, 0, 0, 0, tree, mod, mod.getRoot()); |
1284 |
|
|
1285 |
|
TreePath lead = tree.getLeadSelectionPath(); |
1286 |
|
if (lead != null && tree.isPathSelected(lead)) |
1287 |
|
{ |
1288 |
|
Rectangle cell = getPathBounds(tree, lead); |
1289 |
|
g.setColor(UIManager.getLookAndFeelDefaults().getColor( |
1290 |
|
"Tree.selectionBorderColor")); |
1291 |
|
g.drawRect(cell.x + 11, cell.y, cell.width, cell.height); |
1292 |
|
} |
1293 |
|
|
1294 |
g.translate(-10, -10); |
g.translate(-10, -10); |
1295 |
} |
} |
1296 |
|
|
1945 |
boolean cntlClick = false; |
boolean cntlClick = false; |
1946 |
Rectangle bounds = BasicTreeUI.this.getPathBounds( |
Rectangle bounds = BasicTreeUI.this.getPathBounds( |
1947 |
BasicTreeUI.this.tree, path); |
BasicTreeUI.this.tree, path); |
1948 |
int x = (int) bounds.getX(); |
int x = (int) bounds.x; |
1949 |
int y = (int) bounds.getY(); |
int y = (int) bounds.y; |
1950 |
|
|
1951 |
if (clickY > y && clickY < (y + bounds.height + 10)) |
if (clickY > (y - 10) && clickY < (y + bounds.height + 10)) |
1952 |
{ |
{ |
1953 |
if (clickX > x && clickX < (x + bounds.width + 20)) |
if (clickX > (x - 5) && clickX < (x + bounds.width + 25)) |
1954 |
inBounds = true; |
inBounds = true; |
1955 |
else if (clickX < (x - rightChildIndent + 5) && |
else if (clickX < (x - rightChildIndent + 5) && |
1956 |
clickX > (x - rightChildIndent - 5)) |
clickX > (x - rightChildIndent - 5)) |
2528 |
} |
} |
2529 |
return null; |
return null; |
2530 |
} |
} |
2531 |
|
|
2532 |
/** |
/** |
2533 |
* Retrieves the location of some node, recursively starting at from |
* Retrieves the location of some node, recursively starting at from |
2534 |
* some node. |
* some node. |
2601 |
getCellBounds(x, y, leaf)); |
getCellBounds(x, y, leaf)); |
2602 |
} |
} |
2603 |
else |
else |
2604 |
{ |
{ |
2605 |
Component c = dtcr.getTreeCellRendererComponent( |
Component c = dtcr.getTreeCellRendererComponent( |
2606 |
tree, leaf, false, false, true, 0, false); |
tree, leaf, false, false, true, 0, false); |
2607 |
|
|