X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=LogicUI%2Fsrc%2Fera%2Fmi%2Fcomponents%2Fgui%2FBasicGUIComponent.java;h=55929b9d6d332b55ab0af2e075d4c9e782b9e22e;hb=12dce36e4b1b7ce0aba25ef698d262b588c8b53c;hp=d11bc71e035a375034c0adf7161cd7f61df8c266;hpb=08672d724f2c908dbf3e85e465df2bdfd0ca9acf;p=Mograsim.git diff --git a/LogicUI/src/era/mi/components/gui/BasicGUIComponent.java b/LogicUI/src/era/mi/components/gui/BasicGUIComponent.java index d11bc71e..55929b9d 100644 --- a/LogicUI/src/era/mi/components/gui/BasicGUIComponent.java +++ b/LogicUI/src/era/mi/components/gui/BasicGUIComponent.java @@ -3,12 +3,32 @@ package era.mi.components.gui; import era.mi.logic.wires.WireArray; import net.haspamelodica.swt.helper.gcs.GeneralGC; import net.haspamelodica.swt.helper.swtobjectwrappers.Point; +import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle; 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. + */ + public Rectangle getBounds(); + //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) + */ public int getConnectedWireArraysCount(); + /** + * Returns the n-th wire array connected to this component. + */ public WireArray getConnectedWireArray(int connectionIndex); + /** + * Returns relative coordinates where the n-th wire array is connected to this component. + */ public Point getWireArrayConnectionPoint(int connectionIndex); } \ No newline at end of file