Search in sources :

Example 1 with DimensionModel

use of org.activityinfo.ui.client.analysis.model.DimensionModel in project activityinfo by bedatadriven.

the class DimensionPane method onDimensionsDropped.

private void onDimensionsDropped(int insertIndex, List<EffectiveDimension> dropped) {
    List<DimensionModel> dims = new ArrayList<>();
    for (EffectiveDimension effectiveDimension : dropped) {
        dims.add(ImmutableDimensionModel.builder().from(effectiveDimension.getModel()).axis(this.axis).build());
    }
    String afterDimId = null;
    EffectiveDimension afterItem = listStore.get(insertIndex);
    if (afterItem != null) {
        afterDimId = afterItem.getId();
    }
    viewModel.updateModel(viewModel.getWorkingModel().reorderDimensions(afterDimId, dims));
}
Also used : DimensionModel(org.activityinfo.ui.client.analysis.model.DimensionModel) ImmutableDimensionModel(org.activityinfo.ui.client.analysis.model.ImmutableDimensionModel) ArrayList(java.util.ArrayList) EffectiveDimension(org.activityinfo.ui.client.analysis.viewModel.EffectiveDimension)

Example 2 with DimensionModel

use of org.activityinfo.ui.client.analysis.model.DimensionModel in project activityinfo by bedatadriven.

the class NewDimensionDialog method onOkClicked.

private void onOkClicked(SelectEvent event) {
    DimensionModel selectedItem = tree.getSelectionModel().getSelectedItem().dimensionModel();
    if (selectedItem != null) {
        SelectionEvent.fire(this, selectedItem);
        dialog.hide();
    }
}
Also used : DimensionModel(org.activityinfo.ui.client.analysis.model.DimensionModel)

Aggregations

DimensionModel (org.activityinfo.ui.client.analysis.model.DimensionModel)2 ArrayList (java.util.ArrayList)1 ImmutableDimensionModel (org.activityinfo.ui.client.analysis.model.ImmutableDimensionModel)1 EffectiveDimension (org.activityinfo.ui.client.analysis.viewModel.EffectiveDimension)1