int () { int preferredDefinitionWidth = getPreferredSectionWidth("definition"); int preferredLocationWidth = Math.max(getPreferredSectionWidth("bottom-no-content"), getPreferredSectionWidth("bottom")); if (preferredDefinitionWidth < 0) { return -1; } int preferredContentWidth = getPreferredContentWidth(getDocument().getLength()); return Math.max(preferredContentWidth, Math.max(preferredDefinitionWidth, preferredLocationWidth)); }