mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-28 07:28:20 -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) {
|
public SelectTree(LibraryTreeModel model, CircuitComponent component, ShapeFactory shapeFactory, InsertHistory insertHistory) {
|
||||||
super(model);
|
super(model);
|
||||||
this.shapeFactory = shapeFactory;
|
this.shapeFactory = shapeFactory;
|
||||||
|
setSelectionModel(null);
|
||||||
addMouseListener(new MouseAdapter() {
|
addMouseListener(new MouseAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void mouseClicked(MouseEvent mouseEvent) {
|
public void mousePressed(MouseEvent mouseEvent) {
|
||||||
TreePath path = getSelectionPath();
|
TreePath path = getClosestPathForLocation(mouseEvent.getX(), mouseEvent.getY());
|
||||||
if (path != null && path.getPathCount() > 0) {
|
if (path != null && path.getPathCount() > 0) {
|
||||||
LibraryNode node = (LibraryNode) path.getLastPathComponent();
|
LibraryNode node = (LibraryNode) path.getLastPathComponent();
|
||||||
if (node.isLeaf() && node.isUnique()) {
|
if (node.isLeaf() && node.isUnique()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user