Search in sources :

Example 1 with GridWidget

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;
}
Also used : GridWidget(org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget) GridLayer(org.uberfire.ext.wires.core.grids.client.widget.layer.GridLayer) Transform(com.ait.lienzo.client.core.types.Transform) BaseGridRendererHelper(org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper)

Example 2 with GridWidget

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);
}
Also used : GridWidget(org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget) DefaultGridLayer(org.uberfire.ext.wires.core.grids.client.widget.layer.impl.DefaultGridLayer) Test(org.junit.Test)

Example 3 with 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;
}
Also used : Group(com.ait.lienzo.client.core.shape.Group) GridWidget(org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget) GridLayer(org.uberfire.ext.wires.core.grids.client.widget.layer.GridLayer) Transform(com.ait.lienzo.client.core.types.Transform)

Aggregations

GridWidget (org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget)3 Transform (com.ait.lienzo.client.core.types.Transform)2 GridLayer (org.uberfire.ext.wires.core.grids.client.widget.layer.GridLayer)2 Group (com.ait.lienzo.client.core.shape.Group)1 Test (org.junit.Test)1 BaseGridRendererHelper (org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper)1 DefaultGridLayer (org.uberfire.ext.wires.core.grids.client.widget.layer.impl.DefaultGridLayer)1