private void updateTargetGap()

in kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/driver/gridpane/GridPaneMosaic.java [904:982]


    private void updateTargetGap() {
        
        /*
         * targetGapShadowV
         */
        if (targetGapColumnIndex == -1) {
            targetGapShadowV.setVisible(false);
        } else {
            targetGapShadowV.setVisible(true);
            
            final double startX, startY, endY, strokeWidth;
            if (targetGapColumnIndex < columnCount) {
                final Bounds topCellBounds = getCellBounds(targetGapColumnIndex, 0);
                final Bounds bottomCellBounds = getCellBounds(targetGapColumnIndex, rowCount-1);
                startY = topCellBounds.getMinY();
                endY = bottomCellBounds.getMaxY();
                if (targetGapColumnIndex == 0) {
                    startX = topCellBounds.getMinX();
                    strokeWidth = MIN_STROKE_WIDTH;
                } else {
                    assert targetGapColumnIndex >= 1;
                    final Bounds leftTopCellBounds = getCellBounds(targetGapColumnIndex-1, 0);
                    startX = (leftTopCellBounds.getMaxX() + topCellBounds.getMinX()) / 2.0;
                    strokeWidth = Math.abs(leftTopCellBounds.getMaxX() - topCellBounds.getMinX());
                }
            } else {
                final Bounds topCellBounds = getCellBounds(columnCount-1, 0);
                final Bounds bottomCellBounds = getCellBounds(columnCount-1, rowCount-1);
                startX = topCellBounds.getMaxX();
                startY = topCellBounds.getMinY();
                endY = bottomCellBounds.getMaxY();
                strokeWidth = MIN_STROKE_WIDTH;
            }
            targetGapShadowV.setStartX(startX);
            targetGapShadowV.setStartY(startY);
            targetGapShadowV.setEndX(startX);
            targetGapShadowV.setEndY(endY);
            targetGapShadowV.setStrokeWidth(Math.max(strokeWidth, MIN_STROKE_WIDTH));
        }
        
        /*
         * targetGapShadowH
         */
        if (targetGapRowIndex == -1) {
            targetGapShadowH.setVisible(false);
        } else {
            targetGapShadowH.setVisible(true);
            
            final double startX, endX, startY, strokeWidth;
            if (targetGapRowIndex < rowCount) {
                final Bounds leftCellBounds = getCellBounds(0, targetGapRowIndex);
                final Bounds rightCellBounds = getCellBounds(columnCount-1, targetGapRowIndex);
                startX = leftCellBounds.getMinX();
                endX = rightCellBounds.getMaxX();
                if (targetGapRowIndex == 0) {
                    startY = leftCellBounds.getMinY();
                    strokeWidth = MIN_STROKE_WIDTH;
                } else {
                    assert targetGapRowIndex >= 1;
                    final Bounds aboveLeftCellBounds = getCellBounds(0, targetGapRowIndex-1);
                    startY = (aboveLeftCellBounds.getMaxY() + leftCellBounds.getMinY()) / 2.0;
                    strokeWidth = Math.abs(aboveLeftCellBounds.getMaxY() - leftCellBounds.getMinY());
                }
            } else {
                final Bounds leftCellBounds = getCellBounds(0, rowCount-1);
                final Bounds rightCellBounds = getCellBounds(columnCount-1, rowCount-1);
                startX = leftCellBounds.getMinX();
                endX = rightCellBounds.getMaxX();
                startY = leftCellBounds.getMaxY();
                strokeWidth = MIN_STROKE_WIDTH;
            }
            targetGapShadowH.setStartX(startX);
            targetGapShadowH.setStartY(startY);
            targetGapShadowH.setEndX(endX);
            targetGapShadowH.setEndY(startY);
            targetGapShadowH.setStrokeWidth(Math.max(strokeWidth, MIN_STROKE_WIDTH));
        }
        
    }