void (FeedbackLayer feedbackLayer, ComponentDragObject dragObject) { if (myContainer.getComponentCount() == 0) { Dimension initialSize = dragObject.getInitialSize(getContainer()); int originX; if (myAlignment == FlowLayout.CENTER) { originX = myContainer.getSize().width / 2 - initialSize.width / 2 - myHGap; } else if (isRightAlign()) { originX = myContainer.getSize().width - initialSize.width - 2 * myHGap; } else { originX = 2 * myHGap; } int height = Math.min(initialSize.height, myContainer.getBounds().height); Rectangle rc = new Rectangle(originX, 2 * myVGap, initialSize.width, height); feedbackLayer.putFeedback(myContainer.getDelegee(), rc, myContainer.getDisplayName()); } else if ((myInsertIndex == myContainer.getComponentCount() && !isRightAlign()) || (myInsertIndex == 0 && !isLeftAlign())) { Dimension initialSize = dragObject.getInitialSize(getContainer()); JComponent component = myContainer.getDelegee(); int minX = component.getComponent(0).getBounds().x; int maxX = 0; int maxSize = 0; int lastTop = myContainer.getDelegee().getInsets().top; for(Component child: component.getComponents()) { int childX = child.getBounds().x + child.getBounds().width; if (childX > maxX) maxX = childX; maxSize = Math.max(maxSize, child.getBounds().height); lastTop = child.getBounds().y; } maxSize = Math.max(maxSize, initialSize.height); maxSize = Math.min(maxSize, myContainer.getBounds().height); final Rectangle rc; if (myInsertIndex == 0) { rc = new Rectangle(minX - myHGap - initialSize.width, lastTop, initialSize.width, maxSize); } else { int initialWidth = Math.max(8, Math.min(initialSize.width, myContainer.getBounds().width - maxX)); rc = new Rectangle(maxX, lastTop, initialWidth, maxSize); } feedbackLayer.putFeedback(myContainer.getDelegee(), rc, myContainer.getDisplayName()); } else if (myInsertIndex == myContainer.getComponentCount()) { Rectangle bounds = myContainer.getComponent(myInsertIndex-1).getBounds(); Rectangle rc = new Rectangle(bounds.x+bounds.width, bounds.y, 8, bounds.height); feedbackLayer.putFeedback(myContainer.getDelegee(), rc, VertInsertFeedbackPainter.INSTANCE, myContainer.getDisplayName()); } else { Rectangle bounds = myContainer.getComponent(myInsertIndex).getBounds(); Rectangle rc = new Rectangle(bounds.x-4-myHGap, bounds.y, 8, bounds.height); feedbackLayer.putFeedback(myContainer.getDelegee(), rc, VertInsertFeedbackPainter.INSTANCE, myContainer.getDisplayName()); } }