1 package era.mi.components.gui;
\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
8 public interface BasicGUIComponent
\r
11 * Render this component to the given gc, at coordinates (0, 0).
\r
13 public void render(GeneralGC gc);
\r
15 * Returns the bounds of this component.
\r
16 * Used for calculating which component is clicked.
\r
18 public Rectangle getBounds();
\r
20 * Called when this component is clicked. Relative coordinates of the click are given.
\r
21 * Returns true if this component has to be redrawn.
\r
23 public default boolean clicked(double x, double y)
\r
28 //TODO this code will be replaced by code in BasicComponent.
\r
30 * Returns how many wire arrays are connected to this component.
\r
31 * (Connections are static - they can't be removed and no new ones can be added)
\r
33 public int getConnectedWireArraysCount();
\r
35 * Returns the n-th wire array connected to this component.
\r
37 public WireArray getConnectedWireArray(int connectionIndex);
\r
39 * Returns relative coordinates where the n-th wire array is connected to this component.
\r
41 public Point getWireArrayConnectionPoint(int connectionIndex);
\r