import net.mograsim.logic.core.types.BitVectorFormatter;
import net.mograsim.logic.core.wires.CoreWire;
import net.mograsim.logic.core.wires.CoreWire.ReadEnd;
-import net.mograsim.logic.model.model.ViewModelModifiable;
+import net.mograsim.logic.model.model.LogicModelModifiable;
import net.mograsim.preferences.ColorDefinition;
import net.mograsim.preferences.ColorManager;
import net.mograsim.preferences.Preferences;
/**
* The model this wire is a part of.
*/
- private final ViewModelModifiable model;
+ private final LogicModelModifiable model;
/**
* The name of this wire. Is unique for all wires in its model.
*/
public final String name;
/**
- * The logical width of this wire. Is equal to the logical with of {@link #pin1} and {@link #pin2}.
+ * The logical width of this wire. Is equal to the logical width of {@link #pin1} and {@link #pin2}.
*/
public final int logicWidth;
/**
private final List<Consumer<ModelWire>> pathChangedListeners;
/**
- * A LogicObserver calling redrawListeners. Used for logic model bindings.
+ * A LogicObserver calling redrawListeners. Used for core model bindings.
*/
private final LogicObserver logicObs;
/**
- * A ReadEnd of the logic wire this model wire currently is bound to.
+ * A ReadEnd of the core wire this model wire currently is bound to.
*/
private ReadEnd end;
*
* @author Daniel Kirschten
*/
- public ModelWire(ViewModelModifiable model, ModelWireCrossPoint pin1, ModelWireCrossPoint pin2)
+ public ModelWire(LogicModelModifiable model, ModelWireCrossPoint pin1, ModelWireCrossPoint pin2)
{
this(model, null, pin1, pin2);
}
*
* @author Daniel Kirschten
*/
- public ModelWire(ViewModelModifiable model, ModelWireCrossPoint pin1, Pin pin2)
+ public ModelWire(LogicModelModifiable model, ModelWireCrossPoint pin1, Pin pin2)
{
this(model, null, pin1, pin2);
}
*
* @author Daniel Kirschten
*/
- public ModelWire(ViewModelModifiable model, Pin pin1, ModelWireCrossPoint pin2)
+ public ModelWire(LogicModelModifiable model, Pin pin1, ModelWireCrossPoint pin2)
{
this(model, null, pin1, pin2);
}
*
* @author Daniel Kirschten
*/
- public ModelWire(ViewModelModifiable model, Pin pin1, Pin pin2)
+ public ModelWire(LogicModelModifiable model, Pin pin1, Pin pin2)
{
this(model, null, pin1, pin2);
}
*
* @author Daniel Kirschten
*/
- public ModelWire(ViewModelModifiable model, ModelWireCrossPoint pin1, ModelWireCrossPoint pin2, Point... path)
+ public ModelWire(LogicModelModifiable model, ModelWireCrossPoint pin1, ModelWireCrossPoint pin2, Point... path)
{
this(model, null, pin1, pin2, path);
}
*
* @author Daniel Kirschten
*/
- public ModelWire(ViewModelModifiable model, ModelWireCrossPoint pin1, Pin pin2, Point... path)
+ public ModelWire(LogicModelModifiable model, ModelWireCrossPoint pin1, Pin pin2, Point... path)
{
this(model, null, pin1, pin2, path);
}
*
* @author Daniel Kirschten
*/
- public ModelWire(ViewModelModifiable model, Pin pin1, ModelWireCrossPoint pin2, Point... path)
+ public ModelWire(LogicModelModifiable model, Pin pin1, ModelWireCrossPoint pin2, Point... path)
{
this(model, null, pin1, pin2, path);
}
*
* @author Daniel Kirschten
*/
- public ModelWire(ViewModelModifiable model, Pin pin1, Pin pin2, Point... path)
+ public ModelWire(LogicModelModifiable model, Pin pin1, Pin pin2, Point... path)
{
this(model, null, pin1, pin2, path);
}
*
* @author Daniel Kirschten
*/
- public ModelWire(ViewModelModifiable model, String name, ModelWireCrossPoint pin1, ModelWireCrossPoint pin2)
+ public ModelWire(LogicModelModifiable model, String name, ModelWireCrossPoint pin1, ModelWireCrossPoint pin2)
{
this(model, name, pin1, pin2, (Point[]) null);
}
*
* @author Daniel Kirschten
*/
- public ModelWire(ViewModelModifiable model, String name, ModelWireCrossPoint pin1, Pin pin2)
+ public ModelWire(LogicModelModifiable model, String name, ModelWireCrossPoint pin1, Pin pin2)
{
this(model, name, pin1, pin2, (Point[]) null);
}
*
* @author Daniel Kirschten
*/
- public ModelWire(ViewModelModifiable model, String name, Pin pin1, ModelWireCrossPoint pin2)
+ public ModelWire(LogicModelModifiable model, String name, Pin pin1, ModelWireCrossPoint pin2)
{
this(model, name, pin1, pin2, (Point[]) null);
}
*
* @author Daniel Kirschten
*/
- public ModelWire(ViewModelModifiable model, String name, Pin pin1, Pin pin2)
+ public ModelWire(LogicModelModifiable model, String name, Pin pin1, Pin pin2)
{
this(model, name, pin1, pin2, (Point[]) null);
}
*
* @author Daniel Kirschten
*/
- public ModelWire(ViewModelModifiable model, String name, ModelWireCrossPoint pin1, ModelWireCrossPoint pin2, Point... path)
+ public ModelWire(LogicModelModifiable model, String name, ModelWireCrossPoint pin1, ModelWireCrossPoint pin2, Point... path)
{
this(model, name, pin1.getPin(), pin2.getPin(), path);
}
*
* @author Daniel Kirschten
*/
- public ModelWire(ViewModelModifiable model, String name, ModelWireCrossPoint pin1, Pin pin2, Point... path)
+ public ModelWire(LogicModelModifiable model, String name, ModelWireCrossPoint pin1, Pin pin2, Point... path)
{
this(model, name, pin1.getPin(), pin2, path);
}
*
* @author Daniel Kirschten
*/
- public ModelWire(ViewModelModifiable model, String name, Pin pin1, ModelWireCrossPoint pin2, Point... path)
+ public ModelWire(LogicModelModifiable model, String name, Pin pin1, ModelWireCrossPoint pin2, Point... path)
{
this(model, name, pin1, pin2.getPin(), path);
}
*
* @author Daniel Kirschten
*/
- public ModelWire(ViewModelModifiable model, String name, Pin pin1, Pin pin2, Point... path)
+ public ModelWire(LogicModelModifiable model, String name, Pin pin1, Pin pin2, Point... path)
{
this.model = model;
this.name = name == null ? model.getDefaultWireName() : name;
}
/**
- * Destroys this wire. This method is called from {@link ViewModelModifiable#wireDestroyed(ModelWire) wireDestroyed()} of the model this
- * wire is a part of.
+ * Destroys this wire. This method is called from {@link LogicModelModifiable#wireDestroyed(ModelWire) wireDestroyed()} of the model
+ * this wire is a part of.
*
* @author Daniel Kirschten
*/
return new Point(p.x, p.y);
}
- // logic model binding
+ // core model binding
/**
* Binds this {@link ModelWire} to the given {@link ReadEnd}: The color of this {@link ModelWire} will now depend on the state of the
*
* @author Daniel Kirschten
*/
- public void setLogicModelBinding(ReadEnd end)
+ public void setCoreModelBinding(ReadEnd end)
{
if (this.end != null)
this.end.deregisterObserver(logicObs);
}
/**
- * Returns whether this {@link ModelWire} has a logic model binding or not.
+ * Returns whether this {@link ModelWire} has a core model binding or not.
*
* @author Daniel Kirschten
*/
- public boolean hasLogicModelBinding()
+ public boolean hasCoreModelBinding()
{
return end != null;
}
/**
- * If this {@link ModelWire} has a logic model binding, delegates to {@link CoreWire#forceValues(BitVector)} for the {@link CoreWire}
+ * If this {@link ModelWire} has a core model binding, delegates to {@link CoreWire#forceValues(BitVector)} for the {@link CoreWire}
* corresponding to this {@link ModelWire}.
*
* @author Daniel Kirschten
}
/**
- * If this {@link ModelWire} has a logic model binding, delegates to {@link ReadEnd#getValues()} for the {@link ReadEnd} corresponding
- * to this {@link ModelWire}.
+ * If this {@link ModelWire} has a core model binding, delegates to {@link ReadEnd#getValues()} for the {@link ReadEnd} corresponding to
+ * this {@link ModelWire}.
*
* @author Daniel Kirschten
*/