- /**
- * Add a graphical wire between the given connection points of the given components. The given components have to be added and the given
- * connection points have to be connected logically first.
- *
- * @author Daniel Kirschten
- */
- public void addWire(BasicGUIComponent component1, int component1ConnectionIndex, BasicGUIComponent component2,
- int component2ConnectionIndex, Point... path)
- {
- wires.add(new GUIWire(this::redrawThreadsafe, component1, component1ConnectionIndex, componentPositions.get(component1), component2,
- component2ConnectionIndex, componentPositions.get(component2), path));
+ addZoomedRenderer(gc ->
+ {
+ Rectangle visibleRegion = new Rectangle(offX, offY, gW / zoom, gH / zoom);
+ model.getComponents().forEach(c -> drawComponent(gc, c, visibleRegion));
+ });
+ addZoomedRenderer(gc -> model.getWires().forEach(w -> w.render(gc)));
+ addListener(SWT.MouseDown, this::mouseDown);