Components in the tree sometimes stop responding until deselected and

selected again
This commit is contained in:
Branislav Stojkovic
2018-12-15 19:47:21 +01:00
parent b9cf1b4aa8
commit 4aeaa25d1a
4 changed files with 713 additions and 703 deletions
Binary file not shown.
Binary file not shown.
@@ -1,23 +1,19 @@
/* /*
*
DIY Layout Creator (DIYLC). * DIY Layout Creator (DIYLC). Copyright (c) 2009-2018 held jointly by the individual authors.
Copyright (c) 2009-2018 held jointly by the individual authors. *
* This file is part of DIYLC.
This file is part of DIYLC. *
* DIYLC is free software: you can redistribute it and/or modify it under the terms of the GNU
DIYLC is free software: you can redistribute it and/or modify * General Public License as published by the Free Software Foundation, either version 3 of the
it under the terms of the GNU General Public License as published by * License, or (at your option) any later version.
the Free Software Foundation, either version 3 of the License, or *
(at your option) any later version. * DIYLC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
DIYLC is distributed in the hope that it will be useful, * Public License for more details.
but WITHOUT ANY WARRANTY; without even the implied warranty of *
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * You should have received a copy of the GNU General Public License along with DIYLC. If not, see
GNU General Public License for more details. * <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.diylc.swing.plugins.tree; package org.diylc.swing.plugins.tree;
@@ -220,6 +216,7 @@ public class TreePanel extends JPanel {
@Override @Override
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
if (plugInPort.getNewComponentTypeSlot() != componentType)
plugInPort.setNewComponentTypeSlot(componentType, null); plugInPort.setNewComponentTypeSlot(componentType, null);
} }
}); });
@@ -325,6 +322,15 @@ public class TreePanel extends JPanel {
int row = tree.getClosestRowForLocation(e.getX(), e.getY()); int row = tree.getClosestRowForLocation(e.getX(), e.getY());
tree.setSelectionRow(row); tree.setSelectionRow(row);
getPopup().show(e.getComponent(), e.getX(), e.getY()); 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.getClickListener() != null) {
payload.getClickListener().mouseClicked(e);
}
}
} }
} }
}); });
+4
View File
@@ -1894,6 +1894,10 @@
<changeType>BUG_FIX</changeType> <changeType>BUG_FIX</changeType>
<description>Measurement tool shows incorrect readings when zoomed in or out</description> <description>Measurement tool shows incorrect readings when zoomed in or out</description>
</org.diylc.appframework.update.Change> </org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>BUG_FIX</changeType>
<description>Components in the tree sometimes stop responding until deselected and selected again</description>
</org.diylc.appframework.update.Change>
</changes> </changes>
<url>https://github.com/bancika/diy-layout-creator/releases</url> <url>https://github.com/bancika/diy-layout-creator/releases</url>
</org.diylc.appframework.update.Version> </org.diylc.appframework.update.Version>