import java.util.stream.Collectors;
import java.util.stream.Stream;
+import net.mograsim.logic.model.am2900.Am2900Loader;
import net.mograsim.logic.model.model.ViewModelModifiable;
import net.mograsim.logic.model.model.wires.GUIWire;
import net.mograsim.logic.model.model.wires.MovablePin;
{
public static void main(String[] args) throws IOException
{
+ Am2900Loader.setup();
try (Scanner sysin = new Scanner(System.in))
{
System.out.print("Directory to search for JSONs in / JSON file to reserialize >");
try
{
DeserializedSubmodelComponent comp = (DeserializedSubmodelComponent) IndirectGUIComponentCreator
- .createComponent(new ViewModelModifiable(), "file:" + json.toString());
+ .createComponent(new ViewModelModifiable(), "jsonfile:" + json.toString());
System.out.println("Reserializing " + json);
comp.getSupermodelPins().entrySet().stream().sorted(Comparator.comparing(Entry::getKey)).map(Entry::getValue).forEach(pin ->
{
{
Set<GUIWire> wiresConnectedToPin = comp.submodel.getWiresByName().values().stream()
.filter(w -> w.getPin1() == interfacePin || w.getPin2() == interfacePin).collect(Collectors.toSet());
- wiresConnectedToPin.forEach(GUIWire::destroy);
+ wiresConnectedToPin.forEach(comp.getSubmodelModifiable()::destroyWire);
comp.removeSubmodelInterface(interfacePin.name);
comp.addSubmodelInterface(
new MovablePin(comp, interfacePin.name, interfacePin.logicWidth, usage, interfacePin.getRelX(), interfacePin.getRelY()));