mirror of
https://github.com/hneemann/Digital.git
synced 2025-10-01 08:50:47 -04:00
added correct tree root name
This commit is contained in:
parent
71ee13ad2b
commit
a221c9ffd0
@ -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
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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());
|
||||
|
Loading…
x
Reference in New Issue
Block a user