}
@Override
protected void addSubComponents ()
{
add ( new BorderPanel ( new WebLabel ( frame.getTitle (), new Icon ()
{
@Override
public void paintIcon ( final Component c, final Graphics g, final int x, final int y )
{
if ( frame.getFrameIcon () != null )
{
frame.getFrameIcon ().paintIcon ( c, g, x, y );
}
}
@Override
public int getIconWidth ()
{
return frame.getFrameIcon () != null ? frame.getFrameIcon ().getIconWidth () : 16;
}
@Override
public int getIconHeight ()
{
return frame.getFrameIcon () != null ? frame.getFrameIcon ().getIconHeight () : 16;
}
}, WebLabel.LEFT )
{
{
setOpaque ( false );
setForeground ( Color.WHITE );
setFont ( WebFonts.getSystemTitleFont () );
}
}, isFrameTitle () ? 3 : 1, 3, 0, 3 ), BorderLayout.CENTER );
final int buttons = ( frame.isIconifiable () ? 1 : 0 ) + ( frame.isMaximizable () ? 1 : 0 ) +
( frame.isClosable () ? 1 : 0 );
final JPanel buttonsPanel = new JPanel ( new GridLayout ( 1, buttons ) );
buttonsPanel.setOpaque ( false );
if ( frame.isIconifiable () )
{
buttonsPanel.add ( iconButton );
}
if ( frame.isMaximizable () )
{
buttonsPanel.add ( maxButton );
}
if ( frame.isClosable () )
{
buttonsPanel.add ( closeButton );
}
add ( new BorderPanel ( buttonsPanel, 0, 0, 0, 0 ), BorderLayout.EAST );
}