Search in sources :

Example 1 with GridRenderer

use of org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.GridRenderer in project drools-wb by kiegroup.

the class ColumnHeaderPopOverHandler method isMouseOverTableHeader.

private boolean isMouseOverTableHeader(final GridWidget gridWidget, final double cy) {
    final Group header = gridWidget.getHeader();
    final GridRenderer renderer = gridWidget.getRenderer();
    final double headerHeight = renderer.getHeaderHeight();
    final double headerRowsYOffset = getHeaderRowsYOffset(gridWidget);
    final double headerMinY = (header == null ? headerRowsYOffset : header.getY() + headerRowsYOffset);
    final double headerMaxY = (header == null ? headerHeight : headerHeight + header.getY());
    return headerMinY < cy && cy < headerMaxY;
}
Also used : Group(com.ait.lienzo.client.core.shape.Group) GridRenderer(org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.GridRenderer)

Example 2 with GridRenderer

use of org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.GridRenderer in project drools-wb by kiegroup.

the class GuidedDecisionTableModellerContextMenuSupportTest method makeDecisionTable.

private GuidedDecisionTableView.Presenter makeDecisionTable(final double x, final double y) {
    final GridData uiModel = spy(new BaseGridData());
    final GuidedDecisionTableView.Presenter dtPresenter = mock(GuidedDecisionTableView.Presenter.class);
    final GuidedDecisionTableView dtView = mock(GuidedDecisionTableView.class);
    final GridRenderer renderer = mock(GridRenderer.class);
    final BaseGridRendererHelper helper = mock(BaseGridRendererHelper.class);
    uiModel.appendRow(new BaseGridRow());
    when(dtPresenter.getView()).thenReturn(dtView);
    when(dtPresenter.getAccess()).thenReturn(mock(GuidedDecisionTablePresenter.Access.class));
    when(dtPresenter.getModel()).thenReturn(mock(GuidedDecisionTable52.class));
    when(dtView.getViewport()).thenReturn(viewport);
    when(dtView.getLayer()).thenReturn(layer);
    when(dtView.getLocation()).thenReturn(new Point2D(x, y));
    when(dtView.getAbsoluteX()).thenReturn(x);
    when(dtView.getAbsoluteY()).thenReturn(y);
    when(dtView.getWidth()).thenReturn(50.0);
    when(dtView.getHeight()).thenReturn(52.0);
    when(dtView.getModel()).thenReturn(uiModel);
    when(dtView.getRenderer()).thenReturn(renderer);
    when(renderer.getHeaderHeight()).thenReturn(32.0);
    when(dtView.getRendererHelper()).thenReturn(helper);
    when(helper.getColumnInformation(any(Double.class))).thenReturn(columnInformation);
    return dtPresenter;
}
Also used : GuidedDecisionTable52(org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52) BaseGridRow(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridRow) Point2D(com.ait.lienzo.client.core.types.Point2D) GridData(org.uberfire.ext.wires.core.grids.client.model.GridData) BaseGridData(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData) BaseGridData(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData) GridRenderer(org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.GridRenderer) BaseGridRendererHelper(org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper)

Example 3 with GridRenderer

use of org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.GridRenderer in project drools-wb by kiegroup.

the class ColumnHeaderPopOverHandler method getHeaderRowsYOffset.

private double getHeaderRowsYOffset(final GridWidget gridWidget) {
    final GridData model = gridWidget.getModel();
    final int headerRowCount = model.getHeaderRowCount();
    final GridRenderer renderer = gridWidget.getRenderer();
    final double headerHeight = renderer.getHeaderHeight();
    final double headerRowHeight = renderer.getHeaderRowHeight();
    final double headerRowsHeight = headerRowHeight * headerRowCount;
    final double headerRowsYOffset = headerHeight - headerRowsHeight;
    return headerRowsYOffset;
}
Also used : GridData(org.uberfire.ext.wires.core.grids.client.model.GridData) GridRenderer(org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.GridRenderer)

Aggregations

GridRenderer (org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.GridRenderer)3 GridData (org.uberfire.ext.wires.core.grids.client.model.GridData)2 Group (com.ait.lienzo.client.core.shape.Group)1 Point2D (com.ait.lienzo.client.core.types.Point2D)1 GuidedDecisionTable52 (org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)1 BaseGridData (org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData)1 BaseGridRow (org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridRow)1 BaseGridRendererHelper (org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper)1