added correct tree root name

This commit is contained in:
hneemann 2017-03-26 13:37:45 +02:00
parent 71ee13ad2b
commit a221c9ffd0
3 changed files with 14 additions and 12 deletions

View File

@ -9,6 +9,7 @@ planned as v0.10
- Added N and P channel FETs and some CMOS examples, including a 16 bit SRAM - Added N and P channel FETs and some CMOS examples, including a 16 bit SRAM
- Improved and documented the file import strategy. - Improved and documented the file import strategy.
- Truth tables are easier to edit. - Truth tables are easier to edit.
- added a tree view to insert components
- added support for the ATF1502 and ATF1504 CPLDs - added support for the ATF1502 and ATF1504 CPLDs
- some minor bug fixes - some minor bug fixes

View File

@ -63,7 +63,7 @@ public class ElementLibrary implements Iterable<ElementLibrary.ElementContainer>
* Creates a new instance. * Creates a new instance.
*/ */
public ElementLibrary() { public ElementLibrary() {
root = new LibraryNode("root"); root = new LibraryNode(Lang.get("menu_elements"));
LibraryNode node = new LibraryNode(Lang.get("lib_Logic")); LibraryNode node = new LibraryNode(Lang.get("lib_Logic"));
node.add(And.DESCRIPTION); node.add(And.DESCRIPTION);

View File

@ -39,20 +39,21 @@ public class SelectTree extends JTree {
addMouseListener(new MouseAdapter() { addMouseListener(new MouseAdapter() {
@Override @Override
public void mouseClicked(MouseEvent mouseEvent) { public void mouseClicked(MouseEvent mouseEvent) {
TreePath path = getSelectionPath(); if (mouseEvent.getClickCount() == 2) {
if (path != null && path.getPathCount() > 0) { TreePath path = getSelectionPath();
LibraryNode node = (LibraryNode) path.getLastPathComponent(); if (path != null && path.getPathCount() > 0) {
if (node.isLeaf()) { LibraryNode node = (LibraryNode) path.getLastPathComponent();
try { if (node.isLeaf()) {
ElementTypeDescription d = node.getDescription(); try {
component.setPartToInsert(new VisualElement(d.getName()).setShapeFactory(shapeFactory)); ElementTypeDescription d = node.getDescription();
insertHistory.add(new InsertAction(node, insertHistory, component, shapeFactory)); component.setPartToInsert(new VisualElement(d.getName()).setShapeFactory(shapeFactory));
} catch (IOException e) { insertHistory.add(new InsertAction(node, insertHistory, component, shapeFactory));
e.printStackTrace(); } catch (IOException e) {
e.printStackTrace();
}
} }
} }
} }
} }
}); });
setCellRenderer(new MyCellRenderer()); setCellRenderer(new MyCellRenderer());