import net.mograsim.logic.core.wires.Wire.ReadEnd;
import net.mograsim.logic.model.model.ViewModelModifiable;
import net.mograsim.logic.model.model.components.GUIComponent;
+import net.mograsim.logic.model.serializing.IdentifierGetter;
import net.mograsim.logic.model.serializing.IndirectGUIComponentCreator;
import net.mograsim.preferences.ColorDefinition;
import net.mograsim.preferences.ColorManager;
private static final int CIRCLE_RADIUS = 1;
private static final int CIRCLE_DIAM = CIRCLE_RADIUS * 2;
+ /**
+ * The logical width of this cross point.
+ */
+ public final int logicWidth;
/**
* The (single) pin of this cross point.
*/
public WireCrossPoint(ViewModelModifiable model, int logicWidth, String name)
{
super(model, name);
- logicObs = (i) -> requestRedraw();
+ this.logicWidth = logicWidth;
+ logicObs = (i) -> model.requestRedraw();
setSize(CIRCLE_DIAM, CIRCLE_DIAM);
- addPin(this.pin = new Pin(this, "", logicWidth, CIRCLE_RADIUS, CIRCLE_RADIUS));
+ addPin(this.pin = new Pin(this, "", logicWidth, PinUsage.TRISTATE, CIRCLE_RADIUS, CIRCLE_RADIUS));
}
// pins
// serializing
@Override
- public JsonElement getParamsForSerializing()
+ public JsonElement getParamsForSerializing(IdentifierGetter idGetter)
{
- return new JsonPrimitive(pin.logicWidth);
+ return new JsonPrimitive(logicWidth);
}
static