Made LogicUI compatible with ReadEnd and ReadWriteEnd
[Mograsim.git] / LogicUI / src / era / mi / gui / components / BasicGUIComponent.java
index 29696e1..2d27685 100644 (file)
@@ -1,6 +1,6 @@
 package era.mi.gui.components;
 
-import era.mi.logic.wires.WireArray;
+import era.mi.logic.wires.Wire.ReadEnd;
 import net.haspamelodica.swt.helper.gcs.GeneralGC;
 import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
 import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
@@ -11,32 +11,34 @@ public interface BasicGUIComponent
         * Render this component to the given gc, at coordinates (0, 0).
         */
        public void render(GeneralGC gc);
+
        /**
-        * Returns the bounds of this component.
-        * Used for calculating which component is clicked.
+        * Returns the bounds of this component. Used for calculating which component is clicked.
         */
        public Rectangle getBounds();
+
        /**
-        * Called when this component is clicked. Relative coordinates of the click are given.
-        * Returns true if this component has to be redrawn.
+        * Called when this component is clicked. Relative coordinates of the click are given. Returns true if this component has to be redrawn.
         */
        public default boolean clicked(double x, double y)
        {
                return false;
        }
 
-       //TODO this code will be replaced by code in BasicComponent.
+       // TODO this code will be replaced by code in BasicComponent.
        /**
-        * Returns how many wire arrays are connected to this component.
-        * (Connections are static - they can't be removed and no new ones can be added)
+        * Returns how many wire arrays are connected to this component. (Connections are static - they can't be removed and no new ones can be
+        * added)
         */
-       public int getConnectedWireArraysCount();
+       public int getConnectedWireEndsCount();
+
        /**
         * Returns the n-th wire array connected to this component.
         */
-       public WireArray getConnectedWireArray(int connectionIndex);
+       public ReadEnd getConnectedWireEnd(int connectionIndex);
+
        /**
         * Returns relative coordinates where the n-th wire array is connected to this component.
         */
-       public Point getWireArrayConnectionPoint(int connectionIndex);
+       public Point getWireEndConnectionPoint(int connectionIndex);
 }
\ No newline at end of file