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;
}
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;
}
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;
}
Aggregations