package net.mograsim.logic.ui.model.wires;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonPrimitive;
+
import net.haspamelodica.swt.helper.gcs.GeneralGC;
import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
import net.mograsim.logic.core.LogicObserver;
*
* @author Daniel Kirschten
*/
-public class WireCrossPoint extends GUIComponent implements ConnectionPoint
+public class WireCrossPoint extends GUIComponent
{
private static final int CIRCLE_RADIUS = 1;
private static final int CIRCLE_DIAM = CIRCLE_RADIUS * 2;
// pins
- @Override
public Pin getPin()
{
return pin;
return end != null;
}
+ // serializing
+
+ @Override
+ public JsonElement getParams()
+ {
+ return new JsonPrimitive(pin.logicWidth);
+ }
+
static
{
- // TODO read params
- IndirectGUIComponentCreator.setComponentProvider(WireCrossPoint.class.getCanonicalName(), (m, p) -> new WireCrossPoint(m, 1));
+ IndirectGUIComponentCreator.setComponentSupplier(WireCrossPoint.class.getCanonicalName(),
+ (m, p) -> new WireCrossPoint(m, p.getAsInt()));
}
}
\ No newline at end of file