/** * Find the x-offset relative to the GridWidget origin where Floating columns are positioned. * @return */ private double getFloatingColumnOffset() { final Bounds bounds = getVisibleBounds(); return bounds.getX() - view.getAbsoluteX(); }
/** * Find the x-offset relative to the GridWidget origin where Floating columns are positioned. * @return */ private double getFloatingColumnOffset() { final Bounds bounds = getVisibleBounds(); return bounds.getX() - view.getAbsoluteX(); }
Double maxBoundX() { final List<Double> boundsValues = getVisibleGridWidgets() .map(gridWidget -> gridWidget.getX() + gridWidget.getWidth()) .collect(Collectors.toList()); addExtraBounds(boundsValues, bounds -> bounds.getX() + bounds.getWidth()); return maxValue(boundsValues); }
Double maxBoundX() { final List<Double> boundsValues = getVisibleGridWidgets() .map(gridWidget -> gridWidget.getX() + gridWidget.getWidth()) .collect(Collectors.toList()); addExtraBounds(boundsValues, bounds -> bounds.getX() + bounds.getWidth()); return maxValue(boundsValues); }
public void setBounds(final Bounds bounds) { this.minX = bounds.getX(); this.minY = bounds.getY(); this.maxX = minX + bounds.getWidth(); this.maxY = minY + bounds.getHeight(); }
public void setBounds(final Bounds bounds) { this.minX = bounds.getX(); this.minY = bounds.getY(); this.maxX = minX + bounds.getWidth(); this.maxY = minY + bounds.getHeight(); }
private double getCellScrollDeltaX(final GridWidget gridWidget) { final GridData gridModel = gridWidget.getModel(); final List<GridColumn<?>> columns = gridModel.getColumns(); final GridData.SelectedCell origin = gridModel.getSelectedCellsOrigin(); final int uiColumnIndex = ColumnIndexUtilities.findUiColumnIndex(columns, origin.getColumnIndex()); double dx = 0; final Bounds bounds = gridLayer.getVisibleBounds(); final double columnWidth = columns.get(uiColumnIndex).getWidth(); final double gridCellX = gridWidget.getX() + gridWidget.getRendererHelper().getColumnOffset(uiColumnIndex); if (gridCellX + columnWidth >= bounds.getX() + bounds.getWidth()) { dx = bounds.getX() + bounds.getWidth() - gridCellX - columnWidth; } else if (gridCellX <= bounds.getX()) { dx = bounds.getX() - gridCellX; } return dx; }
private void updateBounds() { final Bounds bounds = getBounds(); this.minX = bounds.getX(); this.minY = bounds.getY(); this.maxX = this.minX + bounds.getWidth(); this.maxY = this.minY + bounds.getHeight(); }
private void updateBounds() { final Bounds bounds = view.getBounds(); this.minX = bounds.getX(); this.minY = bounds.getY(); this.maxX = this.minX + bounds.getWidth(); this.maxY = this.minY + bounds.getHeight(); }
private void updateBounds() { final Bounds bounds = view.getBounds(); this.minX = bounds.getX(); this.minY = bounds.getY(); this.maxX = this.minX + bounds.getWidth(); this.maxY = this.minY + bounds.getHeight(); }
private double getDecisionTableX(final GuidedDecisionTableView.Presenter dtPresenter) { final Bounds bounds = getView().getBounds(); final double x = bounds.getX() + (bounds.getWidth() - dtPresenter.getView().getWidth()) / 2; return x; }
private double getDecisionTableX(final GuidedDecisionTableView.Presenter dtPresenter) { final Bounds bounds = getView().getBounds(); final double x = bounds.getX() + (bounds.getWidth() - dtPresenter.getView().getWidth()) / 2; return x; }
private Transform getTransform( final Bounds bounds ) { final Transform t = new Transform(); t.scale( (double) RADAR_WIDTH / bounds.getWidth(), (double) RADAR_HEIGHT / bounds.getHeight() ).translate( -bounds.getX(), -bounds.getY() ); return t; }
private Transform getTransform( final Bounds bounds ) { final Transform t = new Transform(); t.scale( (double) RADAR_WIDTH / bounds.getWidth(), (double) RADAR_HEIGHT / bounds.getHeight() ).translate( -bounds.getX(), -bounds.getY() ); return t; }
@Override public void setModellerBounds( final Bounds bounds ) { this.minX = bounds.getX(); this.maxX = minX + bounds.getWidth(); this.minY = bounds.getY(); this.maxY = minY + bounds.getHeight(); this.radarLayer.getViewport().setTransform( getTransform( bounds ) ); }
@Override public void setModellerBounds( final Bounds bounds ) { this.minX = bounds.getX(); this.maxX = minX + bounds.getWidth(); this.minY = bounds.getY(); this.maxY = minY + bounds.getHeight(); this.radarLayer.getViewport().setTransform( getTransform( bounds ) ); }
@Override public void setVisibleBounds( final Bounds bounds ) { radarLayer.remove( visibleBounds ); visibleBounds.setLocation( new Point2D( bounds.getX(), bounds.getY() ) ); visibleBounds.setHeight( bounds.getHeight() ); visibleBounds.setWidth( bounds.getWidth() ); radarLayer.add( visibleBounds ); visibleBounds.moveToTop(); radarLayer.batch(); }
@Override public void setVisibleBounds( final Bounds bounds ) { radarLayer.remove( visibleBounds ); visibleBounds.setLocation( new Point2D( bounds.getX(), bounds.getY() ) ); visibleBounds.setHeight( bounds.getHeight() ); visibleBounds.setWidth( bounds.getWidth() ); radarLayer.add( visibleBounds ); visibleBounds.moveToTop(); radarLayer.batch(); }
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; }
@Test public void emptyCollection() { final Bounds b = helper.getBounds( Collections.<GuidedDecisionTableView.Presenter>emptySet() ); assertEquals( BOUNDS_MIN_X, b.getX(), 0.0 ); assertEquals( BOUNDS_MIN_Y, b.getY(), 0.0 ); assertEquals( BOUNDS_MAX_X - BOUNDS_MIN_X, b.getWidth(), 0.0 ); assertEquals( BOUNDS_MAX_Y - BOUNDS_MIN_Y, b.getHeight(), 0.0 ); }