/** * Returns the preferred size. * * @param parent the parent. * * @return The preferred size. * @see LayoutManager */ public Dimension preferredLayoutSize(final Container parent) { final Dimension dim = new Dimension(0, 0); setSizes(parent); //Always add the container's insets! final Insets insets = parent.getInsets(); dim.width = this.preferredWidth + insets.left + insets.right; dim.height = this.preferredHeight + insets.top + insets.bottom; this.sizeUnknown = false; return dim; }
/** * Returns the preferred size. * * @param parent the parent. * * @return The preferred size. * @see LayoutManager */ public Dimension preferredLayoutSize(final Container parent) { final Dimension dim = new Dimension(0, 0); setSizes(parent); //Always add the container's insets! final Insets insets = parent.getInsets(); dim.width = this.preferredWidth + insets.left + insets.right; dim.height = this.preferredHeight + insets.top + insets.bottom; this.sizeUnknown = false; return dim; }
/** * Returns the preferred size. * * @param parent the parent. * * @return The preferred size. * @see LayoutManager */ public Dimension preferredLayoutSize(final Container parent) { final Dimension dim = new Dimension(0, 0); setSizes(parent); //Always add the container's insets! final Insets insets = parent.getInsets(); dim.width = this.preferredWidth + insets.left + insets.right; dim.height = this.preferredHeight + insets.top + insets.bottom; this.sizeUnknown = false; return dim; }
setSizes(parent);
setSizes(parent);