Search in sources :

Example 16 with DQScore

use of org.openlca.core.model.DQScore in project olca-app by GreenDelta.

the class DQSystemInfoPage method createIndicatorMatrix.

private void createIndicatorMatrix(Composite composite) {
    UI.gridLayout(composite, 2 * getModel().getScoreCount() + 3);
    createHeader(composite, true);
    createAddScoreButton(composite);
    for (DQIndicator indicator : getModel().indicators) {
        Text nameText = createTextCell(composite, 1, 15);
        ((GridData) nameText.getLayoutData()).verticalAlignment = SWT.TOP;
        getBinding().onString(() -> indicator, "name", nameText);
        indicatorTexts.put(indicator.position, nameText);
        commentControl(composite, "indicators[" + indicator.position + "]");
        for (DQScore score : indicator.scores) {
            Text descriptionText = createTextCell(composite, 8, 8);
            getBinding().onString(() -> score, "description", descriptionText);
            descriptionText.setBackground(DQUI.getColor(score.position, getModel().getScoreCount()));
            commentControl(composite, "indicators[" + indicator.position + "].scores[" + score.position + "].description");
        }
        createRemoveIndicatorButton(composite, indicator.position);
    }
    createAddIndicatorButton(composite);
    for (int i = 1; i <= getModel().getScoreCount(); i++) {
        UI.filler(composite);
        createRemoveScoreButton(composite, i);
    }
}
Also used : DQScore(org.openlca.core.model.DQScore) Text(org.eclipse.swt.widgets.Text) DQIndicator(org.openlca.core.model.DQIndicator)

Aggregations

DQScore (org.openlca.core.model.DQScore)16 DQIndicator (org.openlca.core.model.DQIndicator)12 Button (org.eclipse.swt.widgets.Button)3 JsonArray (com.google.gson.JsonArray)2 JsonObject (com.google.gson.JsonObject)2 Text (org.eclipse.swt.widgets.Text)2 DQSystem (org.openlca.core.model.DQSystem)2 JsonElement (com.google.gson.JsonElement)1 ArrayList (java.util.ArrayList)1 Label (org.eclipse.swt.widgets.Label)1 DQSystemDao (org.openlca.core.database.DQSystemDao)1