public DeleteDecisionRuleCommand(final DecisionTable dtable, final GridData uiModel, final int uiRowIndex, final org.uberfire.mvp.Command canvasOperation) { this.dtable = dtable; this.uiModel = uiModel; this.uiRowIndex = uiRowIndex; this.canvasOperation = canvasOperation; this.oldRule = dtable.getRule().get(uiRowIndex); this.oldUiModelRow = uiModel.getRow(uiRowIndex); }
@Override public boolean isRowDragPermitted(final GridWidgetDnDHandlersState state) { final GridWidgetHandlersOperation operation = state.getOperation(); if (operation == GridWidgetHandlersOperation.ROW_MOVE_PENDING) { final int lastRowIndex = model.getRowCount() - 1; final List<GridRow> rows = state.getActiveGridRows(); return !rows.contains(model.getRow(lastRowIndex)); } return true; }
public DeleteContextEntryCommand(final Context context, final GridData uiModel, final int uiRowIndex, final org.uberfire.mvp.Command canvasOperation) { this.context = context; this.uiModel = uiModel; this.uiRowIndex = uiRowIndex; this.canvasOperation = canvasOperation; this.oldContextEntry = context.getContextEntry().get(uiRowIndex); this.oldUiModelRow = uiModel.getRow(uiRowIndex); }
public DeleteRelationRowCommand(final Relation relation, final GridData uiModel, final int uiRowIndex, final org.uberfire.mvp.Command canvasOperation) { this.relation = relation; this.uiModel = uiModel; this.uiRowIndex = uiRowIndex; this.canvasOperation = canvasOperation; this.oldRow = relation.getRow().get(uiRowIndex); this.oldUiModelRow = uiModel.getRow(uiRowIndex); }
public DeleteParameterBindingCommand(final Invocation invocation, final GridData uiModel, final int uiRowIndex, final org.uberfire.mvp.Command canvasOperation) { this.invocation = invocation; this.uiModel = uiModel; this.uiRowIndex = uiRowIndex; this.canvasOperation = canvasOperation; this.oldParameterBinding = invocation.getBinding().get(uiRowIndex); this.oldUiModelRow = uiModel.getRow(uiRowIndex); }
Function<SelectedRange, Double> getBodySelectionHeightStrategy() { return selectedRange -> IntStream.range(0, selectedRange.getHeight()) .mapToObj(rowIndex -> model.getRow(selectedRange.getUiRowIndex() + rowIndex)) .mapToDouble(GridRow::getHeight) .sum(); }
Function<SelectedRange, Double> getBodySelectionHeightStrategy() { return selectedRange -> IntStream.range(0, selectedRange.getHeight()) .mapToObj(rowIndex -> model.getRow(selectedRange.getUiRowIndex() + rowIndex)) .mapToDouble(GridRow::getHeight) .sum(); }
protected static double getCellHeight(final int rowIndex, final GridData model, final GridCell<?> cell) { return IntStream.range(rowIndex, rowIndex + cell.getMergedCellCount()) .mapToDouble(index -> model.getRow(index).getHeight()) .sum(); }
protected static double getCellHeight(final int rowIndex, final GridData model, final GridCell<?> cell) { return IntStream.range(rowIndex, rowIndex + cell.getMergedCellCount()) .mapToDouble(index -> model.getRow(index).getHeight()) .sum(); }
@Override public void onStart(final IAnimation iAnimation, final IAnimationHandle iAnimationHandle) { //Store the rows' target heights for (int i = 0; i < rowCount; i++) { final GridRow row = gridWidget.getModel().getRow(uiRowIndex + i); heights.add(row.peekHeight()); } //Mark cells as expanded gridWidget.getModel().expandCell(uiRowIndex, uiColumnIndex); }
private double getMergedCellHeight(final int uiRowIndex, final int uiColumnIndex) { double height = 0; final GridCell<?> cell = gridModel.getCell(uiRowIndex, uiColumnIndex); for (int i = uiRowIndex; i < uiRowIndex + cell.getMergedCellCount(); i++) { height = height + gridModel.getRow(i).getHeight(); } return height; }
private double getMergedCellHeight(final int uiRowIndex, final int uiColumnIndex) { double height = 0; final GridCell<?> cell = gridModel.getCell(uiRowIndex, uiColumnIndex); for (int i = uiRowIndex; i < uiRowIndex + cell.getMergedCellCount(); i++) { height = height + gridModel.getRow(i).getHeight(); } return height; }
@Override public void onStart(final IAnimation iAnimation, final IAnimationHandle iAnimationHandle) { //Store the rows' target heights for (int i = 0; i < rowCount; i++) { final GridRow row = gridWidget.getModel().getRow(uiRowIndex + i); heights.add(row.peekHeight()); } //Mark cells as expanded gridWidget.getModel().expandCell(uiRowIndex, uiColumnIndex); }
@Before public void setUp() throws Exception { doReturn(gridRow).when(gridData).getRow(anyInt()); doReturn(BaseGridWidgetRenderingTestUtils.HEADER_ROW_HEIGHT).when(gridRow).getHeight(); }
public void onDeleteCell(final GridData.Range range, final int columnIndex) { final int minRowIndex = range.getMinRowIndex(); final int maxRowIndex = range.getMaxRowIndex(); for (int i = minRowIndex; i <= maxRowIndex; i++) { final GridRow row = gridData.getRow(i); updateRowMergedCells(row); } updateMergeMetaData(minRowIndex, columnIndex); }
public void onDeleteCell(final GridData.Range range, final int columnIndex) { final int minRowIndex = range.getMinRowIndex(); final int maxRowIndex = range.getMaxRowIndex(); for (int i = minRowIndex; i <= maxRowIndex; i++) { final GridRow row = gridData.getRow(i); updateRowMergedCells(row); } updateMergeMetaData(minRowIndex, columnIndex); }
@Override public void onFrame(final IAnimation iAnimation, final IAnimationHandle iAnimationHandle) { //Set the rows' height from zero to their starting height final double pct = assertPct(iAnimation.getPercent()); for (int i = 1; i < rowCount; i++) { final GridRow row = gridWidget.getModel().getRow(uiRowIndex + i); row.setHeight(pct * heights.get(i)); } gridWidget.getLayer().batch(); }
@Override public void onFrame(final IAnimation iAnimation, final IAnimationHandle iAnimationHandle) { //Set the rows' height from zero to their starting height final double pct = assertPct(iAnimation.getPercent()); for (int i = 1; i < rowCount; i++) { final GridRow row = gridWidget.getModel().getRow(uiRowIndex + i); row.setHeight(pct * heights.get(i)); } gridWidget.getLayer().batch(); }
@Override public void onFrame(final IAnimation iAnimation, final IAnimationHandle iAnimationHandle) { //Set the rows' height to their starting height down to zero final double pct = assertPct(iAnimation.getPercent()); for (int i = 1; i < rowCount; i++) { final GridRow row = gridWidget.getModel().getRow(uiRowIndex + i); row.setHeight((1.0 - pct) * row.peekHeight()); } gridWidget.getLayer().batch(); }
@Override public void onFrame(final IAnimation iAnimation, final IAnimationHandle iAnimationHandle) { //Set the rows' height to their starting height down to zero final double pct = assertPct(iAnimation.getPercent()); for (int i = 1; i < rowCount; i++) { final GridRow row = gridWidget.getModel().getRow(uiRowIndex + i); row.setHeight((1.0 - pct) * row.peekHeight()); } gridWidget.getLayer().batch(); }