+ /**
+ * Destroys this pin by removing all wires connected to it from the model the component is a part of.<br>
+ * Don't call this method from application code as it is automatically called in {@link ModelComponent#removePin(String)}.
+ */
+ public void destroyed()
+ {
+ Set<ModelWire> connectedWires = new HashSet<>();
+ for (ModelWire w : model.getWiresByName().values())
+ if (w.getPin1() == this || w.getPin2() == this)
+ connectedWires.add(w);
+ connectedWires.forEach(model::destroyWire);
+ }
+