1 package era.mi.gui.components;
3 import era.mi.logic.wires.Wire.WireEnd;
4 import net.haspamelodica.swt.helper.gcs.GeneralGC;
5 import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
6 import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
8 public interface BasicGUIComponent
11 * Render this component to the given gc, at coordinates (0, 0).
13 public void render(GeneralGC gc);
16 * Returns the bounds of this component. Used for calculating which component is clicked.
18 public Rectangle getBounds();
21 * Called when this component is clicked. Relative coordinates of the click are given. Returns true if this component has to be redrawn.
23 public default boolean clicked(double x, double y)
28 // TODO this code will be replaced by code in BasicComponent.
30 * Returns how many wire arrays are connected to this component. (Connections are static - they can't be removed and no new ones can be
33 public int getConnectedWireEndsCount();
36 * Returns the n-th wire array connected to this component.
38 public WireEnd getConnectedWireEnd(int connectionIndex);
41 * Returns relative coordinates where the n-th wire array is connected to this component.
43 public Point getWireEndConnectionPoint(int connectionIndex);