1932 |
TreePath path = BasicTreeUI.this.tree.getPathForRow(row); |
TreePath path = BasicTreeUI.this.tree.getPathForRow(row); |
1933 |
|
|
1934 |
boolean inBounds = false; |
boolean inBounds = false; |
1935 |
|
boolean cntlClick = false; |
1936 |
Rectangle bounds = BasicTreeUI.this.getPathBounds( |
Rectangle bounds = BasicTreeUI.this.getPathBounds( |
1937 |
BasicTreeUI.this.tree, path); |
BasicTreeUI.this.tree, path); |
1938 |
int x = (int) bounds.getX(); |
int x = (int) bounds.getX(); |
1939 |
int y = (int) bounds.getY(); |
int y = (int) bounds.getY(); |
|
if ((clickY >= (y - 10) && clickY <= (y + bounds.height + 10)) |
|
|
&& (clickX >= x && clickX <= (x + bounds.width + 25))) |
|
|
inBounds = true; |
|
1940 |
|
|
1941 |
if (inBounds && path != null && BasicTreeUI.this.tree.isVisible(path)) |
if (clickY > y && clickY < (y + bounds.height + 10)) |
1942 |
|
{ |
1943 |
|
if (clickX > x && clickX < (x + bounds.width + 20)) |
1944 |
|
inBounds = true; |
1945 |
|
else if (clickX < (x - rightChildIndent + 5) && |
1946 |
|
clickX > (x - rightChildIndent - 5)) |
1947 |
|
cntlClick = true; |
1948 |
|
} |
1949 |
|
|
1950 |
|
if ((inBounds || cntlClick) && path != null && |
1951 |
|
BasicTreeUI.this.tree.isVisible(path)) |
1952 |
{ |
{ |
1953 |
if (!BasicTreeUI.this.isLeaf(row)) |
if (!cntlClick && !BasicTreeUI.this.isLeaf(row)) |
1954 |
clickCount++; |
clickCount++; |
1955 |
|
|
1956 |
if (clickCount == 2) |
if (clickCount == 2 || cntlClick == true) |
1957 |
{ |
{ |
|
BasicTreeUI.this.tree.getSelectionModel().clearSelection(); |
|
1958 |
clickCount = 0; |
clickCount = 0; |
1959 |
|
BasicTreeUI.this.tree.getSelectionModel().clearSelection(); |
1960 |
if (BasicTreeUI.this.tree.isExpanded(path)) |
if (BasicTreeUI.this.tree.isExpanded(path)) |
1961 |
{ |
{ |
1962 |
BasicTreeUI.this.tree.collapsePath(path); |
BasicTreeUI.this.tree.collapsePath(path); |
1968 |
BasicTreeUI.this.tree.fireTreeExpanded(path); |
BasicTreeUI.this.tree.fireTreeExpanded(path); |
1969 |
} |
} |
1970 |
} |
} |
1971 |
|
|
1972 |
BasicTreeUI.this.selectPath(BasicTreeUI.this.tree, path); |
BasicTreeUI.this.selectPath(BasicTreeUI.this.tree, path); |
1973 |
} |
} |
1974 |
} |
} |