private BaseGridRendererHelper.RenderingInformation prepare() { this.body = null; this.header = null; this.floatingBody = null; this.floatingHeader = null; this.bodySelections = null; this.headerSelections = null; this.floatingBodySelections = null; this.floatingHeaderSelections = null; this.boundary = null; this.selection = null; this.allColumns.clear(); this.bodyColumns.clear(); this.floatingColumns.clear(); this.renderQueue.clear(); //If there's no RenderingInformation the GridWidget is not visible final BaseGridRendererHelper.RenderingInformation renderingInformation = rendererHelper.getRenderingInformation(); if (renderingInformation == null) { return null; } final BaseGridRendererHelper.RenderingBlockInformation bodyBlockInformation = renderingInformation.getBodyBlockInformation(); final BaseGridRendererHelper.RenderingBlockInformation floatingBlockInformation = renderingInformation.getFloatingBlockInformation(); final List<GridColumn<?>> allColumns = renderingInformation.getAllColumns(); final List<GridColumn<?>> bodyColumns = bodyBlockInformation.getColumns(); final List<GridColumn<?>> floatingColumns = floatingBlockInformation.getColumns(); this.allColumns.addAll(allColumns); this.bodyColumns.addAll(bodyColumns); this.floatingColumns.addAll(floatingColumns); return renderingInformation; }
private BaseGridRendererHelper.RenderingInformation prepare() { this.body = null; this.header = null; this.floatingBody = null; this.floatingHeader = null; this.bodySelections = null; this.headerSelections = null; this.floatingBodySelections = null; this.floatingHeaderSelections = null; this.boundary = null; this.selection = null; this.allColumns.clear(); this.bodyColumns.clear(); this.floatingColumns.clear(); this.renderQueue.clear(); //If there's no RenderingInformation the GridWidget is not visible final BaseGridRendererHelper.RenderingInformation renderingInformation = rendererHelper.getRenderingInformation(); if (renderingInformation == null) { return null; } final BaseGridRendererHelper.RenderingBlockInformation bodyBlockInformation = renderingInformation.getBodyBlockInformation(); final BaseGridRendererHelper.RenderingBlockInformation floatingBlockInformation = renderingInformation.getFloatingBlockInformation(); final List<GridColumn<?>> allColumns = renderingInformation.getAllColumns(); final List<GridColumn<?>> bodyColumns = bodyBlockInformation.getColumns(); final List<GridColumn<?>> floatingColumns = floatingBlockInformation.getColumns(); this.allColumns.addAll(allColumns); this.bodyColumns.addAll(bodyColumns); this.floatingColumns.addAll(floatingColumns); return renderingInformation; }
private BaseGridRendererHelper.ColumnInformation getBodyColumnInformation(final int uiColumnIndex) { final GridColumn<?> column = gridModel.getColumns().get(uiColumnIndex); final BaseGridRendererHelper rendererHelper = gridWidget.getRendererHelper(); final BaseGridRendererHelper.RenderingInformation renderingInformation = rendererHelper.getRenderingInformation(); final BaseGridRendererHelper.RenderingBlockInformation bodyBlockInformation = renderingInformation.getBodyBlockInformation(); final List<GridColumn<?>> bodyColumns = bodyBlockInformation.getColumns(); if (!bodyColumns.contains(column)) { return null; } return new BaseGridRendererHelper.ColumnInformation(column, uiColumnIndex, bodyBlockInformation.getX() + rendererHelper.getColumnOffset(bodyColumns, bodyColumns.indexOf(column))); }
final BaseGridRendererHelper.RenderingBlockInformation bodyBlockInformation = renderingInformation.getBodyBlockInformation(); final BaseGridRendererHelper.RenderingBlockInformation floatingBlockInformation = renderingInformation.getFloatingBlockInformation(); final List<GridColumn<?>> bodyColumns = bodyBlockInformation.getColumns();
final BaseGridRendererHelper.RenderingBlockInformation bodyBlockInformation = renderingInformation.getBodyBlockInformation(); final BaseGridRendererHelper.RenderingBlockInformation floatingBlockInformation = renderingInformation.getFloatingBlockInformation(); final List<GridColumn<?>> allColumns = view.getModel().getColumns();
final RenderingBlockInformation bodyBlockInformation = renderingInformation.getBodyBlockInformation(); final RenderingBlockInformation floatingBlockInformation = renderingInformation.getFloatingBlockInformation(); final List<GridColumn<?>> bodyColumns = bodyBlockInformation.getColumns();
final RenderingBlockInformation bodyBlockInformation = renderingInformation.getBodyBlockInformation(); final RenderingBlockInformation floatingBlockInformation = renderingInformation.getFloatingBlockInformation(); final List<GridColumn<?>> bodyColumns = bodyBlockInformation.getColumns();
protected void drawHeader(final BaseGridRendererHelper.RenderingInformation renderingInformation) { final List<GridColumn<?>> allColumns = renderingInformation.getAllColumns(); final BaseGridRendererHelper.RenderingBlockInformation bodyBlockInformation = renderingInformation.getBodyBlockInformation(); final BaseGridRendererHelper.RenderingBlockInformation floatingBlockInformation = renderingInformation.getFloatingBlockInformation();
protected void drawBody(final BaseGridRendererHelper.RenderingInformation renderingInformation) { final BaseGridRendererHelper.RenderingBlockInformation bodyBlockInformation = renderingInformation.getBodyBlockInformation(); final BaseGridRendererHelper.RenderingBlockInformation floatingBlockInformation = renderingInformation.getFloatingBlockInformation();
protected void drawHeader(final BaseGridRendererHelper.RenderingInformation renderingInformation) { final List<GridColumn<?>> allColumns = renderingInformation.getAllColumns(); final BaseGridRendererHelper.RenderingBlockInformation bodyBlockInformation = renderingInformation.getBodyBlockInformation(); final BaseGridRendererHelper.RenderingBlockInformation floatingBlockInformation = renderingInformation.getFloatingBlockInformation();
protected void drawBody(final BaseGridRendererHelper.RenderingInformation renderingInformation) { final BaseGridRendererHelper.RenderingBlockInformation bodyBlockInformation = renderingInformation.getBodyBlockInformation(); final BaseGridRendererHelper.RenderingBlockInformation floatingBlockInformation = renderingInformation.getFloatingBlockInformation();
double x = 0; final List<GridColumn<?>> allColumns = new ArrayList<>(); final BaseGridRendererHelper.RenderingBlockInformation bodyBlockInformation = renderingInformation.getBodyBlockInformation(); final BaseGridRendererHelper.RenderingBlockInformation floatingBlockInformation = renderingInformation.getFloatingBlockInformation();
double x = 0; final List<GridColumn<?>> allColumns = new ArrayList<>(); final BaseGridRendererHelper.RenderingBlockInformation bodyBlockInformation = renderingInformation.getBodyBlockInformation(); final BaseGridRendererHelper.RenderingBlockInformation floatingBlockInformation = renderingInformation.getFloatingBlockInformation();
private boolean isOverRowDragHandleColumn(final GridWidget view, final double cx) { //Gather information on columns final BaseGridRendererHelper rendererHelper = view.getRendererHelper(); final BaseGridRendererHelper.RenderingInformation renderingInformation = rendererHelper.getRenderingInformation(); if (renderingInformation == null) { return false; } final BaseGridRendererHelper.RenderingBlockInformation bodyBlockInformation = renderingInformation.getBodyBlockInformation(); final BaseGridRendererHelper.RenderingBlockInformation floatingBlockInformation = renderingInformation.getFloatingBlockInformation(); final List<GridColumn<?>> bodyColumns = bodyBlockInformation.getColumns(); final List<GridColumn<?>> floatingColumns = floatingBlockInformation.getColumns(); final double bodyX = bodyBlockInformation.getX(); final double floatingX = floatingBlockInformation.getX(); //Check floating columns if (findRowDragHandleColumn(floatingColumns, floatingX, cx) != null) { return true; } //Check all other columns return findRowDragHandleColumn(bodyColumns, bodyX, cx) != null; }
private boolean isOverRowDragHandleColumn(final GridWidget view, final double cx) { //Gather information on columns final BaseGridRendererHelper rendererHelper = view.getRendererHelper(); final BaseGridRendererHelper.RenderingInformation renderingInformation = rendererHelper.getRenderingInformation(); if (renderingInformation == null) { return false; } final BaseGridRendererHelper.RenderingBlockInformation bodyBlockInformation = renderingInformation.getBodyBlockInformation(); final BaseGridRendererHelper.RenderingBlockInformation floatingBlockInformation = renderingInformation.getFloatingBlockInformation(); final List<GridColumn<?>> bodyColumns = bodyBlockInformation.getColumns(); final List<GridColumn<?>> floatingColumns = floatingBlockInformation.getColumns(); final double bodyX = bodyBlockInformation.getX(); final double floatingX = floatingBlockInformation.getX(); //Check floating columns if (findRowDragHandleColumn(floatingColumns, floatingX, cx) != null) { return true; } //Check all other columns return findRowDragHandleColumn(bodyColumns, bodyX, cx) != null; }
private Bounds getSelectorBounds(final double width, final double height, final BaseGridRendererHelper.RenderingInformation renderingInformation) { final BaseGridRendererHelper.RenderingBlockInformation bodyBlockInformation = renderingInformation.getBodyBlockInformation(); final BaseGridRendererHelper.RenderingBlockInformation floatingBlockInformation = renderingInformation.getFloatingBlockInformation(); double boundsX = 0.0; double boundsY = 0.0; double boundsWidth = width; double boundsHeight = height; if (!floatingBlockInformation.getColumns().isEmpty()) { boundsX = floatingBlockInformation.getX(); boundsWidth = boundsWidth - floatingBlockInformation.getX(); } if (renderingInformation.isFloatingHeader()) { boundsY = bodyBlockInformation.getHeaderY(); boundsHeight = boundsHeight - bodyBlockInformation.getHeaderY(); } return new BaseBounds(boundsX, boundsY, boundsWidth, boundsHeight); }
@Before public void setup() { this.uiModel = new GuidedDecisionTableUiModel(synchronizer); this.uiColumn = new RowNumberColumn(); this.uiModel.appendColumn(uiColumn); this.uiModel.appendRow(new BaseGridRow()); this.renderer = new GuidedDecisionTableRenderer(uiModel, new GuidedDecisionTable52()); doReturn(new ArrayList<Double>() {{ add(20.0); }}).when(renderingInformation).getVisibleRowOffsets(); doReturn(new ArrayList<GridColumn<?>>() {{ add(uiColumn); }}).when(context).getBlockColumns(); doReturn(bodyBlockInformation).when(renderingInformation).getBodyBlockInformation(); doReturn(new ArrayList<GridColumn<?>>() {{ add(uiColumn); }}).when(bodyBlockInformation).getColumns(); doReturn(floatingBlockInformation).when(renderingInformation).getFloatingBlockInformation(); doReturn(Collections.emptyList()).when(floatingBlockInformation).getColumns(); doReturn(renderer).when(context).getRenderer(); }
private Bounds getSelectorBounds(final double width, final double height, final BaseGridRendererHelper.RenderingInformation renderingInformation) { final BaseGridRendererHelper.RenderingBlockInformation bodyBlockInformation = renderingInformation.getBodyBlockInformation(); final BaseGridRendererHelper.RenderingBlockInformation floatingBlockInformation = renderingInformation.getFloatingBlockInformation(); double boundsX = 0.0; double boundsY = 0.0; double boundsWidth = width; double boundsHeight = height; if (!floatingBlockInformation.getColumns().isEmpty()) { boundsX = floatingBlockInformation.getX(); boundsWidth = boundsWidth - floatingBlockInformation.getX(); } if (renderingInformation.isFloatingHeader()) { boundsY = bodyBlockInformation.getHeaderY(); boundsHeight = boundsHeight - bodyBlockInformation.getHeaderY(); } return new BaseBounds(boundsX, boundsY, boundsWidth, boundsHeight); }
@Before @SuppressWarnings("unchecked") public void setup() { super.setUp(); this.clickEvent = new NodeMouseClickEvent(nativeClickEvent); this.doubleClickEvent = new NodeMouseDoubleClickEvent(nativeDoubleClickEvent); when(scenarioGridMock.getRendererHelper()).thenReturn(rendererHelper); when(scenarioGridMock.getViewport()).thenReturn(viewportMock); when(scenarioGridMock.getComputedLocation()).thenReturn(computedLocation); when(rendererHelper.getRenderingInformation()).thenReturn(renderingInformation); when(rendererHelper.getColumnInformation(anyDouble())).thenReturn(columnInformation); when(columnInformation.getColumn()).thenReturn((GridColumn) gridColumnMock); when(renderingInformation.getBodyBlockInformation()).thenReturn(renderingBlockInformation); when(renderingInformation.getFloatingBlockInformation()).thenReturn(renderingBlockInformation); when(informationHeaderMetaDataMock.getSupportedEditAction()).thenReturn(GridCellEditAction.SINGLE_CLICK); this.handler = spy(new ScenarioSimulationGridWidgetMouseEventHandler()); }
private BaseGridRendererHelper.ColumnInformation getBodyColumnInformation(final int uiColumnIndex) { final GridColumn<?> column = gridModel.getColumns().get(uiColumnIndex); final BaseGridRendererHelper rendererHelper = gridWidget.getRendererHelper(); final BaseGridRendererHelper.RenderingInformation renderingInformation = rendererHelper.getRenderingInformation(); final BaseGridRendererHelper.RenderingBlockInformation bodyBlockInformation = renderingInformation.getBodyBlockInformation(); final List<GridColumn<?>> bodyColumns = bodyBlockInformation.getColumns(); if (!bodyColumns.contains(column)) { return null; } return new BaseGridRendererHelper.ColumnInformation(column, uiColumnIndex, bodyBlockInformation.getX() + rendererHelper.getColumnOffset(bodyColumns, bodyColumns.indexOf(column))); }