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
- Improved and documented the file import strategy.
- Truth tables are easier to edit.
- added a tree view to insert components
- added support for the ATF1502 and ATF1504 CPLDs
- some minor bug fixes

View File

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

View File

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