Fixed a bug in Am2900; created dlatch8/80; relayouted some components
[Mograsim.git] / net.mograsim.logic.model / src / net / mograsim / logic / model / model / wires / ModelWire.java
index 1d7c9a4..1f44f57 100644 (file)
@@ -15,7 +15,7 @@ import net.mograsim.logic.core.types.BitVector;
 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;
@@ -30,13 +30,13 @@ public class ModelWire
        /**
         * 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;
        /**
@@ -65,11 +65,11 @@ public class ModelWire
        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;
 
@@ -80,7 +80,7 @@ public class ModelWire
         * 
         * @author Daniel Kirschten
         */
-       public ModelWire(ViewModelModifiable model, ModelWireCrossPoint pin1, ModelWireCrossPoint pin2)
+       public ModelWire(LogicModelModifiable model, ModelWireCrossPoint pin1, ModelWireCrossPoint pin2)
        {
                this(model, null, pin1, pin2);
        }
@@ -90,7 +90,7 @@ public class ModelWire
         * 
         * @author Daniel Kirschten
         */
-       public ModelWire(ViewModelModifiable model, ModelWireCrossPoint pin1, Pin pin2)
+       public ModelWire(LogicModelModifiable model, ModelWireCrossPoint pin1, Pin pin2)
        {
                this(model, null, pin1, pin2);
        }
@@ -100,7 +100,7 @@ public class ModelWire
         * 
         * @author Daniel Kirschten
         */
-       public ModelWire(ViewModelModifiable model, Pin pin1, ModelWireCrossPoint pin2)
+       public ModelWire(LogicModelModifiable model, Pin pin1, ModelWireCrossPoint pin2)
        {
                this(model, null, pin1, pin2);
        }
@@ -110,7 +110,7 @@ public class ModelWire
         * 
         * @author Daniel Kirschten
         */
-       public ModelWire(ViewModelModifiable model, Pin pin1, Pin pin2)
+       public ModelWire(LogicModelModifiable model, Pin pin1, Pin pin2)
        {
                this(model, null, pin1, pin2);
        }
@@ -120,7 +120,7 @@ public class ModelWire
         * 
         * @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);
        }
@@ -130,7 +130,7 @@ public class ModelWire
         * 
         * @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);
        }
@@ -140,7 +140,7 @@ public class ModelWire
         * 
         * @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);
        }
@@ -150,7 +150,7 @@ public class ModelWire
         * 
         * @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);
        }
@@ -160,7 +160,7 @@ public class ModelWire
         * 
         * @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);
        }
@@ -170,7 +170,7 @@ public class ModelWire
         * 
         * @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);
        }
@@ -180,7 +180,7 @@ public class ModelWire
         * 
         * @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);
        }
@@ -190,7 +190,7 @@ public class ModelWire
         * 
         * @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);
        }
@@ -200,7 +200,7 @@ public class ModelWire
         * 
         * @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);
        }
@@ -210,7 +210,7 @@ public class ModelWire
         * 
         * @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);
        }
@@ -220,7 +220,7 @@ public class ModelWire
         * 
         * @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);
        }
@@ -230,7 +230,7 @@ public class ModelWire
         * 
         * @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;
@@ -257,8 +257,8 @@ public class ModelWire
        }
 
        /**
-        * 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
         */
@@ -463,7 +463,7 @@ public class ModelWire
                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
@@ -472,7 +472,7 @@ public class ModelWire
         * 
         * @author Daniel Kirschten
         */
-       public void setLogicModelBinding(ReadEnd end)
+       public void setCoreModelBinding(ReadEnd end)
        {
                if (this.end != null)
                        this.end.deregisterObserver(logicObs);
@@ -482,17 +482,17 @@ public class ModelWire
        }
 
        /**
-        * 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
@@ -503,8 +503,8 @@ public class ModelWire
        }
 
        /**
-        * 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
         */