Dimension (AbstractPosition position) { Dimension size = myContent.getPreferredSize(); if (myShadowBorderProvider == null) { JBInsets.addTo(size, position.createBorder(this).getBorderInsets()); } return size; }