mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-26 22:41:59 -04:00
selection disabled in the tree view
This commit is contained in:
parent
f7c82e4893
commit
30c3d44ab4
@ -37,10 +37,11 @@ public class SelectTree extends JTree {
|
||||
public SelectTree(LibraryTreeModel model, CircuitComponent component, ShapeFactory shapeFactory, InsertHistory insertHistory) {
|
||||
super(model);
|
||||
this.shapeFactory = shapeFactory;
|
||||
setSelectionModel(null);
|
||||
addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent mouseEvent) {
|
||||
TreePath path = getSelectionPath();
|
||||
public void mousePressed(MouseEvent mouseEvent) {
|
||||
TreePath path = getClosestPathForLocation(mouseEvent.getX(), mouseEvent.getY());
|
||||
if (path != null && path.getPathCount() > 0) {
|
||||
LibraryNode node = (LibraryNode) path.getLastPathComponent();
|
||||
if (node.isLeaf() && node.isUnique()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user