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 class GUIMux extends Mux implements BasicGUIComponent
{
{
super(processTime, out, select, inputs);
- double height = inputs.length * 10;
+ double height = inputs.length * 5;
if(height < 10)
height = 10;
this.height = height;
{
connectedWireArraysModifiable.addAll(Arrays.asList(inputs));
- double inputHeightIncrement = height / (inputs.length - 1);
- double inputHeight = 10;
+ double inputHeightIncrement = (height + 20) / inputs.length;
+ double inputHeight = inputHeightIncrement / 2;
for(int i = 0; i < inputs.length; i ++, inputHeight += inputHeightIncrement)
wireArrayConnectionPointsModifiable.add(new Point(0, inputHeight));
}
this.connectedWireArrays = Collections.unmodifiableList(connectedWireArraysModifiable);
this.wireArrayConnectionPoints = Collections.unmodifiableList(wireArrayConnectionPointsModifiable);
}
+
+ @Override
+ public Rectangle getBounds()
+ {
+ return new Rectangle(0, 0, 20, height + 20);
+ }
@Override
public void render(GeneralGC gc)
{