/** * The method is an implementation of appropriate layout manager method. The method performs * layouting of the child layoutable components for the specified target component. * * @param target the specified layoutable container. */ public void layout(LayoutContainer target) { Insets targetInsets = getInsets(); int y = 0, x = 0, w = 0, h = 0; if (label != null && label.isVisible()) { Dimension ps = label.getPreferredSize(); y = (getTitleAlignment() == LwToolkit.BOTTOM) ? (height - targetInsets.bottom - ps.height) : targetInsets.top; x = (xAlignment == LwToolkit.LEFT) ? targetInsets.left + INDENT : ((xAlignment == LwToolkit.RIGHT) ? width - targetInsets.right - ps.width - INDENT : (width - ps.width) / 2); w = ps.width; h = ps.height; label.setSize(w, h); label.setLocation(x, y); } if (center != null && center.isVisible()) { center.setLocation( targetInsets.left + hGap, (getTitleAlignment() == LwToolkit.BOTTOM ? targetInsets.top : targetInsets.top + h) + vGap); center.setSize( width - targetInsets.right - targetInsets.left - 2 * hGap, height - targetInsets.top - targetInsets.bottom - h - 2 * vGap); } }