use of org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget in project drools-wb by kiegroup.
the class ColumnHeaderPopOverImpl method getScreenX.
private int getScreenX(final GuidedDecisionTableModellerView modellerView, final GuidedDecisionTableView.Presenter dtPresenter, final int uiColumnIndex) {
final GridWidget gridWidget = dtPresenter.getView();
final GridColumn<?> uiColumn = gridWidget.getModel().getColumns().get(uiColumnIndex);
final double gx = gridWidget.getX();
final GridLayer layer = modellerView.getGridLayerView();
final int containerX = layer.getDomElementContainer().getAbsoluteLeft();
final double vx = layer.getVisibleBounds().getX();
final Transform t = layer.getViewport().getTransform();
final BaseGridRendererHelper rendererHelper = gridWidget.getRendererHelper();
final BaseGridRendererHelper.RenderingInformation ri = rendererHelper.getRenderingInformation();
final BaseGridRendererHelper.RenderingBlockInformation floatingBlockInformation = ri.getFloatingBlockInformation();
final double offsetX = floatingBlockInformation.getColumns().contains(uiColumn) ? floatingBlockInformation.getX() : 0;
final int screenX = containerX + (int) ((gx - vx + offsetX + rendererHelper.getColumnOffset(uiColumn) + uiColumn.getWidth() / 2) * t.getScaleX());
return screenX;
}
use of org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget in project drools-wb by kiegroup.
the class GuidedDecisionTableModellerViewImplTest method testSelect.
@Test
public void testSelect() {
final GridWidget gridWidget = mock(GridWidget.class);
final DefaultGridLayer gridLayer = mock(DefaultGridLayer.class);
doReturn(gridLayer).when(view).getGridLayer();
view.select(gridWidget);
verify(gridLayer).select(gridWidget);
}
use of org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget in project drools-wb by kiegroup.
the class ColumnHeaderPopOverImpl method getScreenY.
private int getScreenY(final GuidedDecisionTableModellerView modellerView, final GuidedDecisionTableView.Presenter dtPresenter) {
final GridWidget gridWidget = dtPresenter.getView();
final double gy = gridWidget.getY();
final GridLayer layer = modellerView.getGridLayerView();
final int containerY = layer.getDomElementContainer().getAbsoluteTop();
final double vy = layer.getVisibleBounds().getY();
final Transform t = layer.getViewport().getTransform();
final Group header = gridWidget.getHeader();
final double headerHeight = gridWidget.getRenderer().getHeaderHeight();
final double headerRowHeight = gridWidget.getRenderer().getHeaderRowHeight();
final double offsetY = header == null ? 0 : header.getY();
final int screenY = containerY + (int) ((gy - vy + offsetY + headerHeight - headerRowHeight / 2) * t.getScaleX());
return screenY;
}
Aggregations