/** * Updates the panel's text or the grids second settable dimension. * * @param toPanel true = from grid to panel, false = from panel to grid * @param grid */ private void updateSecondDimension(Grid grid, boolean toPanel) { if (grid.getCapabilities().isSecondDimensionAdjustmentSupported()) { if (toPanel) { // truncate to 3 decimal places double secondDim = Math.round(grid.getSecondDimension() * 1000.0) / 1000.0; gridSecondDimension.setText(Double.toString(secondDim)); } else { // toGrid double newMajDiameter = getDouble(gridSecondDimension.getText(), 0); grid.setSecondDimension(newMajDiameter); } } }