*/
protected void destroyed()
{
- pinsByName.values().forEach(p -> pinRemovedListeners.forEach(l -> l.accept(p)));
+ pinsByName.values().forEach(this::removePinWithoutRedraw);
}
// pins
*/
protected void removePin(String name)
{
- Pin pin = pinsByName.remove(name);
- callPinRemovedListeners(pin);
+ removePinWithoutRedraw(pinsByName.remove(name));
model.requestRedraw();
}
+ private void removePinWithoutRedraw(Pin pin)
+ {
+ pin.destroyed();
+ callPinRemovedListeners(pin);
+ }
+
/**
* Returns a collection of pins of this component.
*