final Dimension s = parent.getSize ();
final int w = s.width - i.right - i.left;
final int h = s.height - i.top - i.bottom;
final boolean ltr = root.getComponentOrientation ().isLeftToRight ();
final WebButtonGroup windowButtons = rootUI.getWindowButtons ();
final JComponent titleComponent = rootUI.getTitleComponent ();
final JMenuBar menuBar = root.getJMenuBar ();
final JComponent resizeCorner = rootUI.getResizeCorner ();
final boolean showWindowButtons = windowButtons != null && rootUI.isShowWindowButtons () &&
( rootUI.isShowMinimizeButton () || rootUI.isShowMaximizeButton () || rootUI.isShowCloseButton () );
final boolean showTitleComponent = titleComponent != null && rootUI.isShowTitleComponent ();
final boolean showMenuBar = menuBar != null && rootUI.isShowMenuBar ();
final boolean showResizeCorner =
resizeCorner != null && rootUI.isResizable () && rootUI.isShowResizeCorner () && !rootUI.isFrameMaximized ();
int nextY = 0;
// Placing window buttons
int buttonsWidth = 0;
if ( showWindowButtons )
{
// Moving buttons to top layer
parent.setComponentZOrder ( windowButtons, 0 );
// Placing buttons properly
final Dimension ps = windowButtons.getPreferredSize ();
final int buttonsShear = getButtonsShear ( rootUI );
final int x = ltr ? s.width - i.right - buttonsShear - ps.width : i.left + buttonsShear;
windowButtons.setVisible ( true );
windowButtons.setBounds ( x, i.top, ps.width, ps.height );
buttonsWidth = ps.width;
}
else if ( windowButtons != null )
{
windowButtons.setVisible ( false );
}
// Placing window title component
if ( showTitleComponent )
{