mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
tree improvements
perfboard improvements trace cut improvements
This commit is contained in:
@@ -197,19 +197,18 @@ public class TreePanel extends JPanel {
|
||||
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
TreePath path = tree.getClosestPathForLocation(e.getX(), e.getY());
|
||||
DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();
|
||||
if (node != null && node.getUserObject() != null) {
|
||||
Payload payload = (Payload) node.getUserObject();
|
||||
if (payload.getComponentType() != null) {
|
||||
plugInPort.setNewComponentTypeSlot(payload.getComponentType(), null);
|
||||
}
|
||||
}
|
||||
if (SwingUtilities.isRightMouseButton(e)) {
|
||||
int row = tree.getClosestRowForLocation(e.getX(), e.getY());
|
||||
tree.setSelectionRow(row);
|
||||
getPopup().show(e.getComponent(), e.getX(), e.getY());
|
||||
} else {
|
||||
TreePath path = tree.getClosestPathForLocation(e.getX(), e.getY());
|
||||
DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();
|
||||
if (node != null && node.getUserObject() != null) {
|
||||
Payload payload = (Payload) node.getUserObject();
|
||||
if (payload.getComponentType() != null) {
|
||||
plugInPort.setNewComponentTypeSlot(payload.getComponentType(), null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user