//
// PlayN Performance Tests
// http://github.com/threerings/playn-perf/blob/master/LICENSE

package com.threerings.perf.core;

import react.Functions;
import react.UnitSlot;

import tripleplay.ui.Button;
import tripleplay.ui.Constraints;
import tripleplay.ui.Group;
import tripleplay.ui.Label;
import tripleplay.ui.Slider;
import tripleplay.ui.ValueLabel;
import tripleplay.ui.layout.AxisLayout;
import tripleplay.ui.layout.TableLayout;

/**
 * A class that handles configuring a test before launching it.
 */
public abstract class TestConfig extends Group
{
    protected TestConfig () {
        super(new TableLayout(TableLayout.COL.alignLeft(),
                              TableLayout.COL.alignRight()).gaps(5, 5));
    }

    protected void addHeader (String header) {
        add(TableLayout.colspan(new Label(header), 2));
    }

    protected void addIntSlider (String label, Slider slider, String minFmt) {
        ValueLabel value = new ValueLabel(slider.value.map(Functions.INT_VALUE)).
            setConstraint(Constraints.minSize(minFmt));
        add(new Label(label), new Group(AxisLayout.horizontal()).add(slider, value));
    }

    protected void addStartButton () {
        Button start = new Button("Start");
        start.clicked().connect(new UnitSlot() { public void onEmit () {
            PerfTest.stack.push(create());
        }});
        add(TableLayout.colspan(start, 2));
    }

    protected abstract AbstractTest create ();
}

@@ -233,16 +233,46 @@
 raints;%0A
+import tripleplay.ui.Element;%0A
 import t
@@ -291,16 +291,16 @@
 .Group;%0A
-
 import t
@@ -728,12 +728,11 @@
 lign
-Righ
+Lef
 t())
@@ -744,32 +744,133 @@
 (5, 5));%0A    %7D%0A%0A
+    protected void add (String label, Element%3C?%3E elem) %7B%0A        add(new Label(label), elem);%0A    %7D%0A%0A
     protected vo
@@ -1192,32 +1192,21 @@
     add(
-new Label(
 label
-)
 , new Gr

Make config two columns, added convenient adder for labeled widget.