Added getBounds() in BasicGUIComponent
[Mograsim.git] / LogicUI / src / era / mi / components / gui / BasicGUIComponent.java
1 package era.mi.components.gui;\r
2 \r
3 import era.mi.logic.wires.WireArray;\r
4 import net.haspamelodica.swt.helper.gcs.GeneralGC;\r
5 import net.haspamelodica.swt.helper.swtobjectwrappers.Point;\r
6 import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;\r
7 \r
8 public interface BasicGUIComponent\r
9 {\r
10         /**\r
11          * Render this component to the given gc, at coordinates (0, 0).\r
12          */\r
13         public void render(GeneralGC gc);\r
14         /**\r
15          * Returns the bounds of this component.\r
16          * Used for calculating which component is clicked.\r
17          */\r
18         public Rectangle getBounds();\r
19 \r
20         //TODO this code will be replaced by code in BasicComponent.\r
21         /**\r
22          * Returns how many wire arrays are connected to this component.\r
23          * (Connections are static - they can't be removed and no new ones can be added)\r
24          */\r
25         public int getConnectedWireArraysCount();\r
26         /**\r
27          * Returns the n-th wire array connected to this component.\r
28          */\r
29         public WireArray getConnectedWireArray(int connectionIndex);\r
30         /**\r
31          * Returns relative coordinates where the n-th wire array is connected to this component.\r
32          */\r
33         public Point getWireArrayConnectionPoint(int connectionIndex);\r
34 }