diff --git a/distribution/ReleaseNotes.txt b/distribution/ReleaseNotes.txt index 75ebe5e31..460210c52 100644 --- a/distribution/ReleaseNotes.txt +++ b/distribution/ReleaseNotes.txt @@ -4,7 +4,7 @@ planned as v0.10 - User can select the expressions representation format in the settings dialog. - Better formatting of minimized expressions. - Mouse actions can be canceled by the ESC key. -- With the right mouse button you can now select and move/delete wires. +- With CTRL + mouse button you can now select and move/delete wires. - Added a real bidirectional switch and a relay. - Added N and P channel FETs and some CMOS examples, including a 16 bit SRAM - Improved and documented the file import strategy. diff --git a/src/main/java/de/neemann/digital/gui/components/CircuitComponent.java b/src/main/java/de/neemann/digital/gui/components/CircuitComponent.java index f2aeb397b..d380b1c1a 100644 --- a/src/main/java/de/neemann/digital/gui/components/CircuitComponent.java +++ b/src/main/java/de/neemann/digital/gui/components/CircuitComponent.java @@ -36,7 +36,6 @@ import java.awt.geom.AffineTransform; import java.awt.geom.NoninvertibleTransformException; import java.awt.geom.Point2D; import java.awt.image.BufferedImage; -import java.io.File; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; @@ -568,23 +567,15 @@ public class CircuitComponent extends JComponent implements Circuit.ChangedListe @Override public void actionPerformed(ActionEvent e) { attributeDialog.dispose(); - SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - new Main(CircuitComponent.this, - ((LibrarySelector.ElementTypeDescriptionCustom) elementType).getFile(), - new SavedListener() { - @Override - public void saved(File filename) { - if (parentsSavedListener != null) - parentsSavedListener.saved(filename); - library.removeElement(filename); - circuit.clearState(); - hasChanged(); - } - }).setVisible(true); - } - }); + SwingUtilities.invokeLater(() -> new Main(CircuitComponent.this, + ((LibrarySelector.ElementTypeDescriptionCustom) elementType).getFile(), + filename -> { + if (parentsSavedListener != null) + parentsSavedListener.saved(filename); + library.removeElement(filename); + circuit.clearState(); + hasChanged(); + }).setVisible(true)); } }.setToolTip(Lang.get("attr_openCircuit_tt"))); } @@ -724,7 +715,7 @@ public class CircuitComponent extends JComponent implements Circuit.ChangedListe if (list.size() == 1) vp = list.get(0); else if (list.size() > 1) { - ItemPicker picker = new ItemPicker(CircuitComponent.this, list); + ItemPicker picker = new ItemPicker<>(CircuitComponent.this, list); vp = picker.select(); } return vp; @@ -738,20 +729,19 @@ public class CircuitComponent extends JComponent implements Circuit.ChangedListe VisualElement vp = getVisualElement(pos, true); if (vp != null) editAttributes(vp, e); - else { - Wire wire = circuit.getWireAt(pos, SIZE2); - if (wire != null) - mouseMoveWire.activate(wire, pos); - } } else if (e.getButton() == MouseEvent.BUTTON1) { VisualElement vp = getVisualElement(pos, false); if (vp != null) { - if (circuit.isPinPos(raster(pos), vp)) + if (circuit.isPinPos(raster(pos), vp) && !e.isControlDown()) mouseWire.activate(pos); else mouseMoveElement.activate(vp, pos); } else { - if (!focusWasLost) + if (e.isControlDown()) { + Wire wire = circuit.getWireAt(pos, SIZE2); + if (wire != null) + mouseMoveWire.activate(wire, pos); + } else if (!focusWasLost) mouseWire.activate(pos); } } @@ -909,7 +899,7 @@ public class CircuitComponent extends JComponent implements Circuit.ChangedListe super.activate(); this.wire = wire; this.pos = raster(pos); - this.initialPos=this.pos; + this.initialPos = this.pos; deleteAction.setActive(true); removeHighLighted(); hasChanged(); diff --git a/src/test/resources/docu/static_de.xml b/src/test/resources/docu/static_de.xml index 8c783feca..66e7628be 100644 --- a/src/test/resources/docu/static_de.xml +++ b/src/test/resources/docu/static_de.xml @@ -172,12 +172,12 @@ Wie kann ich eine Leitung verschieben? Mit der Rechteckauswahl einen Endpunkt auswählen und dann mit der Maus verschieben. - Alternativ kann eine einzelne Leitung mit der rechten Maustaste selektiert werden. + Alternativ kann eine einzelne Leitung mit STRG+Mausklick selektiert werden. Wie kann ich eine Leitung löschen? Mit der Rechteckauswahl einen Endpunkt auswählen und dann Entfernen drücken bzw. auf den Papierkorb klicken. - Alternativ kann eine einzelne Leitung mit der rechten Maustaste selektiert werden. + Alternativ kann eine einzelne Leitung mit STRG+Mausklick selektiert werden. Wie kann ich ein Element verschieben und dabei alle angeschlossenen Leitungen mitnehmen? diff --git a/src/test/resources/docu/static_en.xml b/src/test/resources/docu/static_en.xml index 22e653c2b..813fa7142 100644 --- a/src/test/resources/docu/static_en.xml +++ b/src/test/resources/docu/static_en.xml @@ -164,12 +164,12 @@ How to move a wire? Select on of the end points with the rectangular selection. The move this point using the mouse. - You can also select a wire with the right mouse button. + You can also select a wire with CTRL + mouse button. How to delete a wire? Select on of the end points and press DEL or click on the trashcan. - You can also select a wire with the right mouse button. + You can also select a wire with CTRL + mouse button. How to move a component including all the connected wires?